From fe4bd254d3cc74b86828a24783f4beb6777b46b5 Mon Sep 17 00:00:00 2001 From: Carlton Hanna <73041609+channa-figure@users.noreply.github.com> Date: Tue, 3 Aug 2021 13:21:22 -0600 Subject: [PATCH] Removal of v39 v40 migrations (#410) * Delete v039 and v040 migrations * Update change log --- CHANGELOG.md | 1 + app/migrate.go | 118 - cmd/provenanced/cmd/root.go | 1 - docs/proto-docs.md | 876 ----- internal/legacy/migration.go | 34 - internal/legacy/v040/migrate.go | 313 -- proto/provenance/metadata/v0/contract.proto | 88 - proto/provenance/metadata/v0/query.proto | 29 - proto/provenance/metadata/v0/readme.md | 2 - proto/provenance/metadata/v0/scope.proto | 110 - proto/provenance/metadata/v0/spec.proto | 51 - proto/provenance/metadata/v0/tx.proto | 61 - proto/provenance/metadata/v0/types.proto | 112 - x/attribute/legacy/v039/types.go | 23 - x/attribute/legacy/v040/migrate.go | 31 - x/attribute/legacy/v040/migrate_test.go | 67 - x/attribute/legacy/v040/types.go | 5 - x/marker/legacy/v039/types.go | 706 ---- x/marker/legacy/v040/migrate.go | 53 - x/marker/legacy/v040/migrate_test.go | 96 - x/marker/legacy/v040/types.go | 5 - x/metadata/legacy/v039/codec.go | 46 - x/metadata/legacy/v039/contract.pb.go | 2486 -------------- x/metadata/legacy/v039/crypto.go | 34 - x/metadata/legacy/v039/query.pb.go | 589 ---- x/metadata/legacy/v039/query.pb.gw.go | 184 -- x/metadata/legacy/v039/scope.pb.go | 2338 -------------- x/metadata/legacy/v039/spec.pb.go | 1795 ----------- x/metadata/legacy/v039/tx.pb.go | 1508 --------- x/metadata/legacy/v039/types.go | 47 - x/metadata/legacy/v039/types.pb.go | 3222 ------------------- x/metadata/legacy/v040/migrate.go | 282 -- x/metadata/legacy/v040/migrate_test.go | 382 --- x/metadata/legacy/v040/types.go | 5 - x/name/legacy/v039/types.go | 45 - x/name/legacy/v040/migrate.go | 27 - x/name/legacy/v040/migrate_test.go | 71 - x/name/legacy/v040/types.go | 5 - 38 files changed, 1 insertion(+), 15847 deletions(-) delete mode 100644 app/migrate.go delete mode 100644 internal/legacy/migration.go delete mode 100644 internal/legacy/v040/migrate.go delete mode 100644 proto/provenance/metadata/v0/contract.proto delete mode 100644 proto/provenance/metadata/v0/query.proto delete mode 100644 proto/provenance/metadata/v0/readme.md delete mode 100644 proto/provenance/metadata/v0/scope.proto delete mode 100644 proto/provenance/metadata/v0/spec.proto delete mode 100644 proto/provenance/metadata/v0/tx.proto delete mode 100644 proto/provenance/metadata/v0/types.proto delete mode 100644 x/attribute/legacy/v039/types.go delete mode 100644 x/attribute/legacy/v040/migrate.go delete mode 100644 x/attribute/legacy/v040/migrate_test.go delete mode 100644 x/attribute/legacy/v040/types.go delete mode 100644 x/marker/legacy/v039/types.go delete mode 100644 x/marker/legacy/v040/migrate.go delete mode 100644 x/marker/legacy/v040/migrate_test.go delete mode 100644 x/marker/legacy/v040/types.go delete mode 100644 x/metadata/legacy/v039/codec.go delete mode 100644 x/metadata/legacy/v039/contract.pb.go delete mode 100644 x/metadata/legacy/v039/crypto.go delete mode 100644 x/metadata/legacy/v039/query.pb.go delete mode 100644 x/metadata/legacy/v039/query.pb.gw.go delete mode 100644 x/metadata/legacy/v039/scope.pb.go delete mode 100644 x/metadata/legacy/v039/spec.pb.go delete mode 100644 x/metadata/legacy/v039/tx.pb.go delete mode 100644 x/metadata/legacy/v039/types.go delete mode 100644 x/metadata/legacy/v039/types.pb.go delete mode 100644 x/metadata/legacy/v040/migrate.go delete mode 100644 x/metadata/legacy/v040/migrate_test.go delete mode 100644 x/metadata/legacy/v040/types.go delete mode 100644 x/name/legacy/v039/types.go delete mode 100644 x/name/legacy/v040/migrate.go delete mode 100644 x/name/legacy/v040/migrate_test.go delete mode 100644 x/name/legacy/v040/types.go diff --git a/CHANGELOG.md b/CHANGELOG.md index a7e0ab0f2e..f356443f37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,6 +67,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * Updated log message for circulation adjustment [#381](https://github.com/provenance-io/provenance/issues/381) * Updated third party proto files to pull from cosmos 0.43 [#391](https://github.com/provenance-io/provenance/issues/391) * Removed legacy api endpoints [#380](https://github.com/provenance-io/provenance/issues/380) +* Removed v039 and v040 migrations [#374](https://github.com/provenance-io/provenance/issues/374) ## [v1.5.0](https://github.com/provenance-io/provenance/releases/tag/v1.5.0) - 2021-06-23 diff --git a/app/migrate.go b/app/migrate.go deleted file mode 100644 index c3f70a4e8d..0000000000 --- a/app/migrate.go +++ /dev/null @@ -1,118 +0,0 @@ -package app - -// This file implements a genesis migration from sdk 0.39 to 0.40 based Provenance Blockchains. It migrates state from -// the modules as well including marker, metadata, name, and account (attribute) -// This file also implements setting an initial height from an upgrade. - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "time" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/version" - "github.com/cosmos/cosmos-sdk/x/genutil/types" - "github.com/pkg/errors" - "github.com/spf13/cobra" - tmjson "github.com/tendermint/tendermint/libs/json" - tmtypes "github.com/tendermint/tendermint/types" - - legacy "github.com/provenance-io/provenance/internal/legacy" -) - -const ( - flagGenesisTime = "genesis-time" - flagInitialHeight = "initial-height" -) - -// MigrateGenesisCmd returns a command to execute genesis state migration. -func MigrateGenesisCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "migrate [target-version] [genesis-file]", - Short: "Migrate genesis to a specified target version", - Long: fmt.Sprintf(`Migrate the source genesis into the target version and print to STDOUT. - -Example: -$ %s migrate v1.0.0 /path/to/genesis.json --chain-id=provenance-2 --genesis-time=2020-01-1T00:00:00Z --initial-height=5000 -`, version.AppName), - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - var err error - - target := args[0] - importGenesis := args[1] - - migrationFunc := legacy.GetMigrationCallback(target) - if migrationFunc == nil { - return fmt.Errorf("unknown migration function for version: %s", target) - } - - jsonBlob, err := ioutil.ReadFile(importGenesis) - - if err != nil { - return errors.Wrap(err, "failed to read provided genesis file") - } - - genDoc, err := tmtypes.GenesisDocFromJSON(jsonBlob) - if err != nil { - return errors.Wrapf(err, "failed to read genesis document from file %s", importGenesis) - } - - var initialState types.AppMap - if err = json.Unmarshal(genDoc.AppState, &initialState); err != nil { - return errors.Wrap(err, "failed to JSON unmarshal initial genesis state") - } - - newGenState := migrationFunc(initialState, clientCtx) - genDoc.AppState, err = json.Marshal(newGenState) - if err != nil { - return errors.Wrap(err, "failed to JSON marshal migrated genesis state") - } - - genesisTime, _ := cmd.Flags().GetString(flagGenesisTime) - if genesisTime != "" { - var t time.Time - - err = t.UnmarshalText([]byte(genesisTime)) - if err != nil { - return errors.Wrap(err, "failed to unmarshal genesis time") - } - - genDoc.GenesisTime = t - } - - chainID, _ := cmd.Flags().GetString(flags.FlagChainID) - if chainID != "" { - genDoc.ChainID = chainID - } - - initialHeight, _ := cmd.Flags().GetInt(flagInitialHeight) - - genDoc.InitialHeight = int64(initialHeight) - - bz, err := tmjson.Marshal(genDoc) - if err != nil { - return errors.Wrap(err, "failed to marshal genesis doc") - } - - sortedBz, err := sdk.SortJSON(bz) - if err != nil { - return errors.Wrap(err, "failed to sort JSON genesis doc") - } - - fmt.Println(string(sortedBz)) - return nil - }, - } - - cmd.Flags().String(flagGenesisTime, "", "override genesis_time with this flag") - cmd.Flags().Int(flagInitialHeight, 0, "Set the starting height for the chain") - cmd.Flags().String(flags.FlagChainID, "", "override chain_id with this flag") - - return cmd -} diff --git a/cmd/provenanced/cmd/root.go b/cmd/provenanced/cmd/root.go index 6df7e7a762..8f14e4b0fe 100644 --- a/cmd/provenanced/cmd/root.go +++ b/cmd/provenanced/cmd/root.go @@ -128,7 +128,6 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { rootCmd.AddCommand( InitCmd(app.ModuleBasics, app.DefaultNodeHome), genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome), - app.MigrateGenesisCmd(), genutilcli.GenTxCmd(app.ModuleBasics, encodingConfig.TxConfig, banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome), genutilcli.ValidateGenesisCmd(app.ModuleBasics), AddGenesisAccountCmd(app.DefaultNodeHome), diff --git a/docs/proto-docs.md b/docs/proto-docs.md index ba17e278b9..358cee3724 100644 --- a/docs/proto-docs.md +++ b/docs/proto-docs.md @@ -135,68 +135,6 @@ - [Msg](#provenance.marker.v1.Msg) -- [provenance/metadata/v0/types.proto](#provenance/metadata/v0/types.proto) - - [AuditFields](#types.AuditFields) - - [BooleanResult](#types.BooleanResult) - - [Date](#types.Date) - - [Fact](#types.Fact) - - [GogoTimeHack](#types.GogoTimeHack) - - [Location](#types.Location) - - [ProvenanceReference](#types.ProvenanceReference) - - [PublicKey](#types.PublicKey) - - [Signature](#types.Signature) - - [SignatureSet](#types.SignatureSet) - - [SigningAndEncryptionPublicKeys](#types.SigningAndEncryptionPublicKeys) - - [UUID](#types.UUID) - - - [PartyType](#types.PartyType) - - [PublicKeyCurve](#types.PublicKeyCurve) - - [PublicKeyType](#types.PublicKeyType) - -- [provenance/metadata/v0/spec.proto](#provenance/metadata/v0/spec.proto) - - [ConditionSpec](#spec.ConditionSpec) - - [ConsiderationSpec](#spec.ConsiderationSpec) - - [ContractSpec](#spec.ContractSpec) - - [DefinitionSpec](#spec.DefinitionSpec) - - [OutputSpec](#spec.OutputSpec) - - - [DefinitionSpecType](#spec.DefinitionSpecType) - -- [provenance/metadata/v0/contract.proto](#provenance/metadata/v0/contract.proto) - - [Condition](#contract.Condition) - - [Consideration](#contract.Consideration) - - [Contract](#contract.Contract) - - [ExecutionResult](#contract.ExecutionResult) - - [ProposedFact](#contract.ProposedFact) - - [Recital](#contract.Recital) - - [Recitals](#contract.Recitals) - - - [ExecutionResultType](#contract.ExecutionResultType) - -- [provenance/metadata/v0/scope.proto](#provenance/metadata/v0/scope.proto) - - [Event](#scope.Event) - - [Record](#scope.Record) - - [RecordGroup](#scope.RecordGroup) - - [RecordInput](#scope.RecordInput) - - [Scope](#scope.Scope) - - [ScopeCollection](#scope.ScopeCollection) - - - [RecordInputType](#scope.RecordInputType) - -- [provenance/metadata/v0/query.proto](#provenance/metadata/v0/query.proto) - - [ScopeRequest](#query.ScopeRequest) - - [ScopeResponse](#query.ScopeResponse) - - - [Query](#query.Query) - -- [provenance/metadata/v0/tx.proto](#provenance/metadata/v0/tx.proto) - - [ChangeOwnershipResponse](#tx.ChangeOwnershipResponse) - - [MemorializeContractResponse](#tx.MemorializeContractResponse) - - [MsgChangeOwnershipRequest](#tx.MsgChangeOwnershipRequest) - - [MsgMemorializeContractRequest](#tx.MsgMemorializeContractRequest) - - - [Msg](#tx.Msg) - - [provenance/metadata/v1/events.proto](#provenance/metadata/v1/events.proto) - [EventContractSpecificationCreated](#provenance.metadata.v1.EventContractSpecificationCreated) - [EventContractSpecificationDeleted](#provenance.metadata.v1.EventContractSpecificationDeleted) @@ -2206,820 +2144,6 @@ Msg defines the Marker Msg service. - -

Top

- -## provenance/metadata/v0/types.proto - - - - - -### AuditFields -Audit - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `created_date` | [GogoTimeHack](#types.GogoTimeHack) | | | -| `created_by` | [string](#string) | | | -| `updated_date` | [GogoTimeHack](#types.GogoTimeHack) | | | -| `updated_by` | [string](#string) | | | -| `version` | [int32](#int32) | | | -| `message` | [string](#string) | | | - - - - - - - - -### BooleanResult -Wrap a boolean result type. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `value` | [bool](#bool) | | | - - - - - - - - -### Date -Wrapper for an ISO8601 date string. EX: "2020-05-22" - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `value` | [string](#string) | | | - - - - - - - - -### Fact -Wrap a factual data element. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `name` | [string](#string) | | | -| `data_location` | [Location](#types.Location) | | | - - - - - - - - -### GogoTimeHack -proto 3 timestamp structure (hack to get around gogo issues with invalid dates) - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `seconds` | [int64](#int64) | | | -| `nanos` | [int32](#int32) | | | - - - - - - - - -### Location -Wrap a location. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `ref` | [ProvenanceReference](#types.ProvenanceReference) | | | -| `classname` | [string](#string) | | | - - - - - - - - -### ProvenanceReference - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `scope_uuid` | [UUID](#types.UUID) | | [Req] [Scope.uuid] Scope ID | -| `group_uuid` | [UUID](#types.UUID) | | [Opt] [RecordGroup.group_uuid] require record to be within a specific group | -| `hash` | [string](#string) | | [Opt] [Record.result_hash] specify a specific record inside a scope (and group) by result-hash | -| `name` | [string](#string) | | [Opt] [Record.result_name] specify a result-name of a record within a scope | - - - - - - - - -### PublicKey - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `public_key_bytes` | [bytes](#bytes) | | | -| `type` | [PublicKeyType](#types.PublicKeyType) | | | -| `curve` | [PublicKeyCurve](#types.PublicKeyCurve) | | | - - - - - - - - -### Signature -Wrapper around a standard signature. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `algo` | [string](#string) | | Signature Detail | -| `provider` | [string](#string) | | | -| `signature` | [string](#string) | | | -| `signer` | [SigningAndEncryptionPublicKeys](#types.SigningAndEncryptionPublicKeys) | | Identity of signer | - - - - - - - - -### SignatureSet -A collection of signatures - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `signatures` | [Signature](#types.Signature) | repeated | | - - - - - - - - -### SigningAndEncryptionPublicKeys - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `signing_public_key` | [PublicKey](#types.PublicKey) | | | -| `encryption_public_key` | [PublicKey](#types.PublicKey) | | | - - - - - - - - -### UUID -Wrapper type for a standard uuid. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `value` | [string](#string) | | | - - - - - - - - - - -### PartyType - - -| Name | Number | Description | -| ---- | ------ | ----------- | -| PARTY_TYPE_UNKNOWN | 0 | | -| PARTY_TYPE_ORIGINATOR | 1 | | -| PARTY_TYPE_SERVICER | 2 | | -| PARTY_TYPE_INVESTOR | 3 | | -| PARTY_TYPE_CUSTODIAN | 4 | | -| PARTY_TYPE_OWNER | 5 | | -| PARTY_TYPE_AFFILIATE | 6 | | -| PARTY_TYPE_OMNIBUS | 7 | | -| PARTY_TYPE_PROVENANCE | 8 | | -| PARTY_TYPE_MARKER | 9 | | - - - - - -### PublicKeyCurve - - -| Name | Number | Description | -| ---- | ------ | ----------- | -| SECP256K1 | 0 | | -| P256 | 1 | | - - - - - -### PublicKeyType - - -| Name | Number | Description | -| ---- | ------ | ----------- | -| ELLIPTIC | 0 | | - - - - - - - - - - - -

Top

- -## provenance/metadata/v0/spec.proto - - - - - -### ConditionSpec - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `func_name` | [string](#string) | | | -| `input_specs` | [DefinitionSpec](#spec.DefinitionSpec) | repeated | | -| `output_spec` | [OutputSpec](#spec.OutputSpec) | | | - - - - - - - - -### ConsiderationSpec - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `func_name` | [string](#string) | | | -| `responsible_party` | [types.PartyType](#types.PartyType) | | Invoking party | -| `input_specs` | [DefinitionSpec](#spec.DefinitionSpec) | repeated | | -| `output_spec` | [OutputSpec](#spec.OutputSpec) | | | - - - - - - - - -### ContractSpec - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `definition` | [DefinitionSpec](#spec.DefinitionSpec) | | | -| `input_specs` | [DefinitionSpec](#spec.DefinitionSpec) | repeated | | -| `parties_involved` | [types.PartyType](#types.PartyType) | repeated | | -| `condition_specs` | [ConditionSpec](#spec.ConditionSpec) | repeated | | -| `consideration_specs` | [ConsiderationSpec](#spec.ConsiderationSpec) | repeated | | - - - - - - - - -### DefinitionSpec - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `name` | [string](#string) | | | -| `resource_location` | [types.Location](#types.Location) | | | -| `signature` | [types.Signature](#types.Signature) | | | -| `type` | [DefinitionSpecType](#spec.DefinitionSpecType) | | | - - - - - - - - -### OutputSpec - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `spec` | [DefinitionSpec](#spec.DefinitionSpec) | | | - - - - - - - - - - -### DefinitionSpecType - - -| Name | Number | Description | -| ---- | ------ | ----------- | -| DEFINITION_SPEC_TYPE_UNKNOWN | 0 | | -| DEFINITION_SPEC_TYPE_PROPOSED | 1 | | -| DEFINITION_SPEC_TYPE_FACT | 2 | | -| DEFINITION_SPEC_TYPE_FACT_LIST | 3 | | - - - - - - - - - - - -

Top

- -## provenance/metadata/v0/contract.proto - - - - - -### Condition - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `condition_name` | [string](#string) | | | -| `result` | [ExecutionResult](#contract.ExecutionResult) | | | - - - - - - - - -### Consideration - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `consideration_name` | [string](#string) | | | -| `inputs` | [ProposedFact](#contract.ProposedFact) | repeated | Data pushed to a consideration that will ultimately match the output_spec of the consideration | -| `result` | [ExecutionResult](#contract.ExecutionResult) | | | - - - - - - - - -### Contract - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `definition` | [spec.DefinitionSpec](#spec.DefinitionSpec) | | | -| `spec` | [types.Fact](#types.Fact) | | Points to the proto for the contractSpec | -| `invoker` | [types.SigningAndEncryptionPublicKeys](#types.SigningAndEncryptionPublicKeys) | | Invoker of this contract | -| `inputs` | [types.Fact](#types.Fact) | repeated | Constructor arguments. These are always the output of a previously recorded consideration. | -| `conditions` | [Condition](#contract.Condition) | repeated | | -| `considerations` | [Consideration](#contract.Consideration) | repeated | | -| `recitals` | [Recital](#contract.Recital) | repeated | | -| `times_executed` | [int32](#int32) | | | -| `start_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | This is only set once when the contract is initially executed | - - - - - - - - -### ExecutionResult - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `output` | [ProposedFact](#contract.ProposedFact) | | | -| `result` | [ExecutionResultType](#contract.ExecutionResultType) | | | -| `recorded_at` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| `error_message` | [string](#string) | | | - - - - - - - - -### ProposedFact -Input to a consideration defined at runtime, and emitted as a proposed fact for inclusion on the blockchain. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `name` | [string](#string) | | | -| `hash` | [string](#string) | | | -| `classname` | [string](#string) | | | -| `ancestor` | [types.ProvenanceReference](#types.ProvenanceReference) | | | - - - - - - - - -### Recital - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `signer_role` | [types.PartyType](#types.PartyType) | | | -| `signer` | [types.SigningAndEncryptionPublicKeys](#types.SigningAndEncryptionPublicKeys) | | | -| `address` | [bytes](#bytes) | | | - - - - - - - - -### Recitals - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `parties` | [Recital](#contract.Recital) | repeated | | - - - - - - - - - - -### ExecutionResultType - - -| Name | Number | Description | -| ---- | ------ | ----------- | -| RESULT_TYPE_UNKNOWN | 0 | | -| RESULT_TYPE_PASS | 1 | | -| RESULT_TYPE_SKIP | 2 | Couldn't process the condition/consideration due to missing facts being generated by other considerations. | -| RESULT_TYPE_FAIL | 3 | | - - - - - - - - - - - -

Top

- -## provenance/metadata/v0/scope.proto - - - - - -### Event -Event references in relation to scope - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `group_uuid` | [types.UUID](#types.UUID) | | | -| `execution_uuid` | [types.UUID](#types.UUID) | | | - - - - - - - - -### Record -A record (of fact) is attached to an group or each consideration output from a contract. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `name` | [string](#string) | | ConsiderationSpec.func_name <--> ConsiderationProto.consideration_name (method on the classname below that generated this) | -| `hash` | [string](#string) | | ConsiderationSpec.outputSpec.spec.resourceLocation.ref.hash (this is the hash of the consideration which generated the record, see also result_hash) | -| `classname` | [string](#string) | | ContractSpec.definition.resourceLocation.classname (class that contains the method 'name' as given above) | -| `inputs` | [RecordInput](#scope.RecordInput) | repeated | ConsiderationProto.inputs for reference with ConsiderationSpec.input_spec for type | -| `result` | [contract.ExecutionResultType](#contract.ExecutionResultType) | | ConsiderationProto.result.result (indicates SKIP [not allowed], PASS, or FAIL result) | -| `result_name` | [string](#string) | | ConsiderationProto.result.output.name | -| `result_hash` | [string](#string) | | ConsiderationProto.result.output.hash (the hash of the data output from the consideration) | - - - - - - - - -### RecordGroup -An record group is created for each contract memorialized against a scope. This tracks who controls each record for -future use. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `specification` | [string](#string) | | contract.spec.data_location.hash -- the specific contract specification that was used to create this group. | -| `group_uuid` | [types.UUID](#types.UUID) | | Unique ID for building up ProvenanceReferences. Set to the value on of group_uuid on the incoming contract ref. | -| `executor` | [types.SigningAndEncryptionPublicKeys](#types.SigningAndEncryptionPublicKeys) | | Identity that is memorializing this contract | -| `parties` | [contract.Recital](#contract.Recital) | repeated | Set of identities that signed this contract | -| `records` | [Record](#scope.Record) | repeated | Accumulated records (of fact) resulting from Considerations | -| `classname` | [string](#string) | | name of the class associated with this record group specification | -| `audit` | [types.AuditFields](#types.AuditFields) | | Created by, updated by, timestamps, version number, and related info. | - - - - - - - - -### RecordInput -Tracks the inputs used with a Consideration to establish the output record. -FACT references must have come from the input fact list. -For proposed we will only have the hash - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `name` | [string](#string) | | Name value included to link back to the definition spec. | -| `hash` | [string](#string) | | For proposed facts we only have the hash ... for facts this hash maps to something in the input list. | -| `classname` | [string](#string) | | from proposed fact structure to unmarshal | -| `type` | [RecordInputType](#scope.RecordInputType) | | Indicates if this input was a recorded fact on chain or just a given hashed input | - - - - - - - - -### Scope -A ContractScope is a context that binds multiple p8e working together to create a set of facts managed a defined -set of affiliates. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `uuid` | [types.UUID](#types.UUID) | | Unique ID for building up ProvenanceReferences | -| `parties` | [contract.Recital](#contract.Recital) | repeated | Required parties on this scope. These are union with any contract specific recital requirements | -| `record_group` | [RecordGroup](#scope.RecordGroup) | repeated | Each contract memorialized in this scope is stored in this list of contract_group. The list of groups is keyed as a hashmap based on the contract_spec_ref as a unique key. | -| `last_event` | [Event](#scope.Event) | | Last event that resulted in scope changes. | - - - - - - - - -### ScopeCollection -A collection wrapper around scopes - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `scopes` | [Scope](#scope.Scope) | repeated | | - - - - - - - - - - -### RecordInputType -RecordInputType indicates if an input is data on or off chain. - -| Name | Number | Description | -| ---- | ------ | ----------- | -| RECORD_INPUT_TYPE_UNKNOWN | 0 | invalid status | -| RECORD_INPUT_TYPE_PROPOSED | 1 | input is proposed data for recording to the blockchain | -| RECORD_INPUT_TYPE_FACT | 2 | input is a data element referencing an existing scope/record on chain | - - - - - - - - - - - -

Top

- -## provenance/metadata/v0/query.proto - - - - - -### ScopeRequest -ScopeRequest is used for requesting a scope by id - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `scope_id` | [string](#string) | | | - - - - - - - - -### ScopeResponse -ScopeResponse is the response to a scope request. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `scope` | [scope.Scope](#scope.Scope) | | | - - - - - - - - - - - - - - -### Query -Query defines the Metadata Query service. - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `Scope` | [ScopeRequest](#query.ScopeRequest) | [ScopeResponse](#query.ScopeResponse) | Scope returns a specific scope by id | GET|/provenance/metadata/v0/scope/{scope_id}| - - - - - - -

Top

- -## provenance/metadata/v0/tx.proto - - - - - -### ChangeOwnershipResponse -ChangeOwnershipResponse from a contract execution ownership change request - - - - - - - - -### MemorializeContractResponse -MemorializeContractResponse from a contract execution memorialization request - - - - - - - - -### MsgChangeOwnershipRequest -MsgChangeOwnershipRequest records the result of a change ownership p8e contract execution - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `scope_id` | [string](#string) | | The scope of the object being modified on blockchain. | -| `group_id` | [string](#string) | | The uuid of the contract execution. | -| `execution_id` | [string](#string) | | Unique identifier for determining contract/group execution instance | -| `recitals` | [contract.Recitals](#contract.Recitals) | | The recitals to use for the scope parties | -| `contract` | [contract.Contract](#contract.Contract) | | The executed contract. | -| `signatures` | [types.SignatureSet](#types.SignatureSet) | | The contract signatures | -| `notary` | [string](#string) | | The address of the notary (ie the broadcaster of this message). | - - - - - - - - -### MsgMemorializeContractRequest -MsgMemorializeContractRequest is a request from a P8e execution environment to record results of a contract - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `scope_id` | [string](#string) | | The scope of the object being modified on blockchain. | -| `group_id` | [string](#string) | | The uuid of the contract execution. | -| `execution_id` | [string](#string) | | Unique identifier for determining contract/group execution instance | -| `contract` | [contract.Contract](#contract.Contract) | | The executed contract. | -| `signatures` | [types.SignatureSet](#types.SignatureSet) | | The contract signatures | -| `ScopeRefID` | [string](#string) | | ID of the scope snapshot reference for executing | -| `notary` | [string](#string) | | The address of the notary (ie the broadcaster of this message). | - - - - - - - - - - - - - - -### Msg -Msg defines the Metadata Msg service. - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `MemorializeContract` | [MsgMemorializeContractRequest](#tx.MsgMemorializeContractRequest) | [MemorializeContractResponse](#tx.MemorializeContractResponse) | MemorializeContract records the results of a P8e contract execution as a record group and set of records in a scope | | -| `ChangeOwnership` | [MsgChangeOwnershipRequest](#tx.MsgChangeOwnershipRequest) | [ChangeOwnershipResponse](#tx.ChangeOwnershipResponse) | ChangeOwnership allows P8e contracts to record a new set of owners on a scope | | - - - - -

Top

diff --git a/internal/legacy/migration.go b/internal/legacy/migration.go deleted file mode 100644 index 11e56e2d71..0000000000 --- a/internal/legacy/migration.go +++ /dev/null @@ -1,34 +0,0 @@ -package legacy - -import ( - "sort" - - "github.com/cosmos/cosmos-sdk/x/genutil/types" - - v040 "github.com/provenance-io/provenance/internal/legacy/v040" -) - -var migrationMap = types.MigrationMap{ - "v1.0.0": v040.Migrate, // provenance 1.0 blockchain is based on v40 sdk -} - -// GetMigrationCallback returns a MigrationCallback for a given version. -func GetMigrationCallback(version string) types.MigrationCallback { - return migrationMap[version] -} - -// GetMigrationVersions get all migration version in a sorted slice. -func GetMigrationVersions() []string { - versions := make([]string, len(migrationMap)) - - var i int - - for version := range migrationMap { - versions[i] = version - i++ - } - - sort.Strings(versions) - - return versions -} diff --git a/internal/legacy/v040/migrate.go b/internal/legacy/v040/migrate.go deleted file mode 100644 index bb995d1812..0000000000 --- a/internal/legacy/v040/migrate.go +++ /dev/null @@ -1,313 +0,0 @@ -package v040 - -import ( - "encoding/json" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - - v038auth "github.com/cosmos/cosmos-sdk/x/auth/legacy/v038" - v039auth "github.com/cosmos/cosmos-sdk/x/auth/legacy/v039" - v040auth "github.com/cosmos/cosmos-sdk/x/auth/legacy/v040" - v036supply "github.com/cosmos/cosmos-sdk/x/bank/legacy/v036" - v038bank "github.com/cosmos/cosmos-sdk/x/bank/legacy/v038" - v040bank "github.com/cosmos/cosmos-sdk/x/bank/legacy/v040" - v039crisis "github.com/cosmos/cosmos-sdk/x/crisis/legacy/v039" - v040crisis "github.com/cosmos/cosmos-sdk/x/crisis/legacy/v040" - v036distr "github.com/cosmos/cosmos-sdk/x/distribution/legacy/v036" - v038distr "github.com/cosmos/cosmos-sdk/x/distribution/legacy/v038" - v040distr "github.com/cosmos/cosmos-sdk/x/distribution/legacy/v040" - v038evidence "github.com/cosmos/cosmos-sdk/x/evidence/legacy/v038" - v040evidence "github.com/cosmos/cosmos-sdk/x/evidence/legacy/v040" - v039genutil "github.com/cosmos/cosmos-sdk/x/genutil/legacy/v039" - v040gentypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - v036gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v036" - v040gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v040" - v039mint "github.com/cosmos/cosmos-sdk/x/mint/legacy/v039" - v040mint "github.com/cosmos/cosmos-sdk/x/mint/legacy/v040" - v036params "github.com/cosmos/cosmos-sdk/x/params/legacy/v036" - v039slashing "github.com/cosmos/cosmos-sdk/x/slashing/legacy/v039" - v040slashing "github.com/cosmos/cosmos-sdk/x/slashing/legacy/v040" - v038staking "github.com/cosmos/cosmos-sdk/x/staking/legacy/v038" - v040staking "github.com/cosmos/cosmos-sdk/x/staking/legacy/v040" - v038upgrade "github.com/cosmos/cosmos-sdk/x/upgrade/legacy/v038" - - captypes "github.com/cosmos/cosmos-sdk/x/capability/types" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - ibcxfertypes "github.com/cosmos/ibc-go/modules/apps/transfer/types" - ibchost "github.com/cosmos/ibc-go/modules/core/24-host" - ibcexported "github.com/cosmos/ibc-go/modules/core/exported" - ibccoretypes "github.com/cosmos/ibc-go/modules/core/types" - - v039attribute "github.com/provenance-io/provenance/x/attribute/legacy/v039" - v040attribute "github.com/provenance-io/provenance/x/attribute/legacy/v040" - v039marker "github.com/provenance-io/provenance/x/marker/legacy/v039" - v040marker "github.com/provenance-io/provenance/x/marker/legacy/v040" - v039metadata "github.com/provenance-io/provenance/x/metadata/legacy/v039" - v040metadata "github.com/provenance-io/provenance/x/metadata/legacy/v040" - // v039name "github.com/provenance-io/provenance/x/name/legacy/v039" - // v040name "github.com/provenance-io/provenance/x/name/legacy/v040" -) - -func migrateGenutil(oldGenState v039genutil.GenesisState) *v040gentypes.GenesisState { - return &v040gentypes.GenesisState{ - GenTxs: oldGenState.GenTxs, - } -} - -// Migrate migrates exported state from v0.39 to a v0.40 genesis state. -func Migrate(appState v040gentypes.AppMap, clientCtx client.Context) v040gentypes.AppMap { - v039Codec := codec.NewLegacyAmino() - - // marker must be registered first to have markeraccount types available for auth module use - v039marker.RegisterLegacyAminoCodec(v039Codec) - - v039auth.RegisterLegacyAminoCodec(v039Codec) - v036gov.RegisterLegacyAminoCodec(v039Codec) - v036distr.RegisterLegacyAminoCodec(v039Codec) - v036params.RegisterLegacyAminoCodec(v039Codec) - v038upgrade.RegisterLegacyAminoCodec(v039Codec) - - v040Codec := clientCtx.JSONCodec - - if appState[v038bank.ModuleName] != nil { - // unmarshal relative source genesis application state - var bankGenState v038bank.GenesisState - v039Codec.MustUnmarshalJSON(appState[v038bank.ModuleName], &bankGenState) - - // unmarshal x/auth genesis state to retrieve all account balances - var authGenState v039auth.GenesisState - v039Codec.MustUnmarshalJSON(appState[v039auth.ModuleName], &authGenState) - - // unmarshal x/supply genesis state to retrieve total supply - var supplyGenState v036supply.GenesisState - v039Codec.MustUnmarshalJSON(appState[v036supply.ModuleName], &supplyGenState) - - // delete deprecated x/bank genesis state - delete(appState, v038bank.ModuleName) - - // delete deprecated x/supply genesis state - delete(appState, v036supply.ModuleName) - - // Migrate relative source genesis application state and marshal it into - // the respective key. - appState[v040bank.ModuleName] = v040Codec.MustMarshalJSON(v040bank.Migrate(bankGenState, authGenState, supplyGenState)) - } - - var authMarkers = make([]v039marker.MarkerAccount, 0) - // remove balances from existing accounts - if appState[v039auth.ModuleName] != nil { - // unmarshal relative source genesis application state - var authGenState v039auth.GenesisState - v039Codec.MustUnmarshalJSON(appState[v039auth.ModuleName], &authGenState) - - var regular = make([]v038auth.GenesisAccount, 0) - for _, v039Account := range authGenState.Accounts { - switch v039Account := v039Account.(type) { - case *v039marker.MarkerAccount: - { - authMarkers = append(authMarkers, *v039Account) - } - default: - { - regular = append(regular, v039Account) - } - } - } - authGenState.Accounts = regular - - // delete deprecated x/auth genesis state - delete(appState, v039auth.ModuleName) - - // Migrate relative source genesis application state and marshal it into - // the respective key. - appState[v040auth.ModuleName] = v040Codec.MustMarshalJSON(v040auth.Migrate(authGenState)) - } - - // Migrate x/crisis. - if appState[v039crisis.ModuleName] != nil { - // unmarshal relative source genesis application state - var crisisGenState v039crisis.GenesisState - v039Codec.MustUnmarshalJSON(appState[v039crisis.ModuleName], &crisisGenState) - - // delete deprecated x/crisis genesis state - delete(appState, v039crisis.ModuleName) - - // Migrate relative source genesis application state and marshal it into - // the respective key. - appState[v040crisis.ModuleName] = v040Codec.MustMarshalJSON(v040crisis.Migrate(crisisGenState)) - } - - // Migrate x/distribution. - if appState[v038distr.ModuleName] != nil { - // unmarshal relative source genesis application state - var distributionGenState v038distr.GenesisState - v039Codec.MustUnmarshalJSON(appState[v038distr.ModuleName], &distributionGenState) - - // delete deprecated x/distribution genesis state - delete(appState, v038distr.ModuleName) - - // Migrate relative source genesis application state and marshal it into - // the respective key. - appState[v040distr.ModuleName] = v040Codec.MustMarshalJSON(v040distr.Migrate(distributionGenState)) - } - - // Migrate x/evidence. - if appState[v038evidence.ModuleName] != nil { - // unmarshal relative source genesis application state - var evidenceGenState v038evidence.GenesisState - v039Codec.MustUnmarshalJSON(appState[v038bank.ModuleName], &evidenceGenState) - - // delete deprecated x/evidence genesis state - delete(appState, v038evidence.ModuleName) - - // Migrate relative source genesis application state and marshal it into - // the respective key. - appState[v040evidence.ModuleName] = v040Codec.MustMarshalJSON(v040evidence.Migrate(evidenceGenState)) - } - - // Migrate x/gov. - if appState[v036gov.ModuleName] != nil { - // unmarshal relative source genesis application state - var govGenState v036gov.GenesisState - v039Codec.MustUnmarshalJSON(appState[v036gov.ModuleName], &govGenState) - - // delete deprecated x/gov genesis state - delete(appState, v036gov.ModuleName) - - // Migrate relative source genesis application state and marshal it into - // the respective key. - appState[v040gov.ModuleName] = v040Codec.MustMarshalJSON(v040gov.Migrate(govGenState)) - } - - // Migrate x/mint. - if appState[v039mint.ModuleName] != nil { - // unmarshal relative source genesis application state - var mintGenState v039mint.GenesisState - v039Codec.MustUnmarshalJSON(appState[v039mint.ModuleName], &mintGenState) - - // delete deprecated x/mint genesis state - delete(appState, v039mint.ModuleName) - - // Migrate relative source genesis application state and marshal it into - // the respective key. - appState[v040mint.ModuleName] = v040Codec.MustMarshalJSON(v040mint.Migrate(mintGenState)) - } - - // Migrate x/slashing. - if appState[v039slashing.ModuleName] != nil { - // unmarshal relative source genesis application state - var slashingGenState v039slashing.GenesisState - v039Codec.MustUnmarshalJSON(appState[v039slashing.ModuleName], &slashingGenState) - - // delete deprecated x/slashing genesis state - delete(appState, v039slashing.ModuleName) - - // Migrate relative source genesis application state and marshal it into - // the respective key. - appState[v040slashing.ModuleName] = v040Codec.MustMarshalJSON(v040slashing.Migrate(slashingGenState)) - } - - // Migrate x/staking. - if appState[v038staking.ModuleName] != nil { - // unmarshal relative source genesis application state - var stakingGenState v038staking.GenesisState - v039Codec.MustUnmarshalJSON(appState[v038staking.ModuleName], &stakingGenState) - - // delete deprecated x/staking genesis state - delete(appState, v038staking.ModuleName) - - // Migrate relative source genesis application state and marshal it into - // the respective key. - stakingGenesis := v040staking.Migrate(stakingGenState) - - stakingGenesis.Params.HistoricalEntries = 10000 - appState[v040staking.ModuleName] = v040Codec.MustMarshalJSON(stakingGenesis) - } - - // Migrate x/genutil - if appState[v039genutil.ModuleName] != nil { - // unmarshal relative source genesis application state - var genutilGenState v039genutil.GenesisState - v039Codec.MustUnmarshalJSON(appState[v039genutil.ModuleName], &genutilGenState) - - // delete deprecated x/staking genesis state - delete(appState, v039genutil.ModuleName) - - // Migrate relative source genesis application state and marshal it into - // the respective key. - appState[v040gentypes.ModuleName] = v040Codec.MustMarshalJSON(migrateGenutil(genutilGenState)) - } - - // Default capabilities initialization - capGenesis := captypes.DefaultGenesis() - appState[captypes.ModuleName] = v040Codec.MustMarshalJSON(capGenesis) - - ibcTransferGenesis := ibcxfertypes.DefaultGenesisState() - ibcCoreGenesis := ibccoretypes.DefaultGenesisState() - evGenesis := evidencetypes.DefaultGenesisState() - - ibcTransferGenesis.Params.ReceiveEnabled = true - ibcTransferGenesis.Params.SendEnabled = true - ibcCoreGenesis.ClientGenesis.Params.AllowedClients = []string{ibcexported.Solomachine, ibcexported.Tendermint} - - appState[ibcxfertypes.ModuleName] = v040Codec.MustMarshalJSON(ibcTransferGenesis) - appState[ibchost.ModuleName] = v040Codec.MustMarshalJSON(ibcCoreGenesis) - appState[v040evidence.ModuleName] = v040Codec.MustMarshalJSON(evGenesis) - - // Migrate x/account (attribute) - if appState[v039attribute.ModuleName] != nil { - var attributeGenState v039attribute.GenesisState - v039Codec.MustUnmarshalJSON(appState[v039attribute.ModuleName], &attributeGenState) - - // delete deprecated x/account (attribute) genesis state - delete(appState, v039attribute.ModuleName) - - // Migrate relative source genesis application state and marshal it into - // the respective key. - appState[v040attribute.ModuleName] = v040Codec.MustMarshalJSON(v040attribute.Migrate(attributeGenState)) - } - - // Migrate x/marker - if appState[v039marker.ModuleName] != nil { - var markerGenState v039marker.GenesisState - v039Codec.MustUnmarshalJSON(appState[v039marker.ModuleName], &markerGenState) - - // append the marker accounts from the auth accounts collection. - markerGenState.Markers = append(markerGenState.Markers, authMarkers...) - - // delete deprecated x/marker genesis state - delete(appState, v039marker.ModuleName) - - // Migrate relative source genesis application state and marshal it into - // the respective key. - appState[v040marker.ModuleName] = v040Codec.MustMarshalJSON(v040marker.Migrate(markerGenState)) - } - - // Migrate x/metadata (and deprecated /x/spec) - if appState[v039metadata.ModuleName] != nil { - var metadataGenState v039metadata.GenesisState - if err := json.Unmarshal(appState[v039metadata.ModuleName], &metadataGenState); err != nil { - panic(err) - } - - if appState[v039metadata.SpecModuleName] != nil { - // unmarshal relative source genesis application state - var specGenState v039metadata.SpecGenesisState - v039Codec.MustUnmarshalJSON(appState[v039metadata.SpecModuleName], &specGenState) - - metadataGenState.Specifications = specGenState.ContractSpecRecords - // delete deprecated x/spec genesis state - delete(appState, v039metadata.SpecModuleName) - } - - // delete deprecated x/metadata genesis state - delete(appState, v039metadata.ModuleName) - - // Migrate relative source genesis application state and marshal it into - // the respective key. - appState[v040metadata.ModuleName] = v040Codec.MustMarshalJSON(v040metadata.Migrate(metadataGenState)) - } - - return appState -} diff --git a/proto/provenance/metadata/v0/contract.proto b/proto/provenance/metadata/v0/contract.proto deleted file mode 100644 index e6cc88d091..0000000000 --- a/proto/provenance/metadata/v0/contract.proto +++ /dev/null @@ -1,88 +0,0 @@ -syntax = "proto3"; - -package contract; - -option go_package = "github.com/provenance-io/provenance/x/metadata/legacy/v039"; -option java_package = "io.provenance.metadata.v0"; -option java_multiple_files = true; - -import "gogoproto/gogo.proto"; -import "provenance/metadata/v0/spec.proto"; -import "provenance/metadata/v0/types.proto"; - -import "google/protobuf/timestamp.proto"; - -message Recital { - types.PartyType signer_role = 1; - types.SigningAndEncryptionPublicKeys signer = 2; - bytes address = 3; -} - -message Recitals { - repeated Recital parties = 1; -} - -message Contract { - spec.DefinitionSpec definition = 1; - - // Points to the proto for the contractSpec - types.Fact spec = 2; - - // Invoker of this contract - types.SigningAndEncryptionPublicKeys invoker = 3; - - // Constructor arguments. - // These are always the output of a previously recorded consideration. - repeated types.Fact inputs = 4; - - repeated contract.Condition conditions = 5; - repeated contract.Consideration considerations = 6; - - repeated contract.Recital recitals = 7; - - int32 times_executed = 8; - - // This is only set once when the contract is initially executed - google.protobuf.Timestamp start_time = 9 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"start_time\""]; - ; -} - -message Condition { - string condition_name = 1; - contract.ExecutionResult result = 2; -} - -message Consideration { - string consideration_name = 1; - - // Data pushed to a consideration that will ultimately match the output_spec of the consideration - repeated contract.ProposedFact inputs = 2; - - contract.ExecutionResult result = 3; -} - -// Input to a consideration defined at runtime, and emitted as a proposed fact for inclusion on the blockchain. -message ProposedFact { - string name = 1; - string hash = 2; - string classname = 3; - types.ProvenanceReference ancestor = 4; -} - -enum ExecutionResultType { - RESULT_TYPE_UNKNOWN = 0; - RESULT_TYPE_PASS = 1; - // Couldn't process the condition/consideration due to missing facts being generated by other considerations. - RESULT_TYPE_SKIP = 2; - RESULT_TYPE_FAIL = 3; -} - -message ExecutionResult { - contract.ProposedFact output = 1; - contract.ExecutionResultType result = 2; - google.protobuf.Timestamp recorded_at = 3 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"recorded_at\""]; - ; - string error_message = 4; -} \ No newline at end of file diff --git a/proto/provenance/metadata/v0/query.proto b/proto/provenance/metadata/v0/query.proto deleted file mode 100644 index 88d210de50..0000000000 --- a/proto/provenance/metadata/v0/query.proto +++ /dev/null @@ -1,29 +0,0 @@ -syntax = "proto3"; -package query; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "provenance/metadata/v0/scope.proto"; - -option go_package = "github.com/provenance-io/provenance/x/metadata/legacy/v039"; - -option java_package = "io.provenance.metadata.v0"; -option java_multiple_files = true; - -// Query defines the Metadata Query service. -service Query { - // Scope returns a specific scope by id - rpc Scope(ScopeRequest) returns (ScopeResponse) { - option (google.api.http).get = "/provenance/metadata/v0/scope/{scope_id}"; - } -} - -// ScopeRequest is used for requesting a scope by id -message ScopeRequest { - string scope_id = 1; -} - -// ScopeResponse is the response to a scope request. -message ScopeResponse { - scope.Scope scope = 1 [(gogoproto.nullable) = false]; -} \ No newline at end of file diff --git a/proto/provenance/metadata/v0/readme.md b/proto/provenance/metadata/v0/readme.md deleted file mode 100644 index 8ba281d733..0000000000 --- a/proto/provenance/metadata/v0/readme.md +++ /dev/null @@ -1,2 +0,0 @@ -Metadata V0 contains protobuf definitions used by Figure Technologies for their private blockchain implementation based -on the 0.39 version of the Cosmos SDK. \ No newline at end of file diff --git a/proto/provenance/metadata/v0/scope.proto b/proto/provenance/metadata/v0/scope.proto deleted file mode 100644 index 4b8991c3e7..0000000000 --- a/proto/provenance/metadata/v0/scope.proto +++ /dev/null @@ -1,110 +0,0 @@ -syntax = "proto3"; - -package scope; - -option go_package = "github.com/provenance-io/provenance/x/metadata/legacy/v039"; -option java_package = "io.provenance.metadata.v0"; -option java_multiple_files = true; - -import "provenance/metadata/v0/contract.proto"; -import "provenance/metadata/v0/types.proto"; - -import "google/protobuf/descriptor.proto"; - -// -// Overview -// -// When memorializing a contract the only pieces that matter are the results and facts. We scope these inside the -// contract_group structure to represent a scope around this information and keep the controlling parties (recitals) -// attached which prevents a co-mingling of the rights to change/update these records. The proof submitted to record -// the facts is part of the readset (the submitted Contract package) and is not important now that the information has -// been recorded. If the source is required it can be pulled from the ReadSet and referenced (or any of the members -// that stored it under the associated URI. - -// Event references in relation to scope -message Event { - types.UUID group_uuid = 1; - types.UUID execution_uuid = 2; -} - -// A ContractScope is a context that binds multiple p8e working together to create a set of facts managed a defined -// set of affiliates. -message Scope { - // Unique ID for building up ProvenanceReferences - types.UUID uuid = 1; - // Required parties on this scope. These are union with any contract specific recital requirements - repeated contract.Recital parties = 2; - // Each contract memorialized in this scope is stored in this list of contract_group. The list of groups is keyed - // as a hashmap based on the contract_spec_ref as a unique key. - repeated scope.RecordGroup record_group = 3; - // Last event that resulted in scope changes. - scope.Event last_event = 4; -} - -// A collection wrapper around scopes -message ScopeCollection { - repeated scope.Scope scopes = 1; -} - -// An record group is created for each contract memorialized against a scope. This tracks who controls each record for -// future use. -message RecordGroup { - // contract.spec.data_location.hash -- the specific contract specification that was used to create this group. - string specification = 1; - // Unique ID for building up ProvenanceReferences. Set to the value on of group_uuid on the incoming contract ref. - types.UUID group_uuid = 2; - // Identity that is memorializing this contract - types.SigningAndEncryptionPublicKeys executor = 3; - // Set of identities that signed this contract - repeated contract.Recital parties = 4; - // Accumulated records (of fact) resulting from Considerations - repeated scope.Record records = 5; - // name of the class associated with this record group specification - string classname = 6; - // Created by, updated by, timestamps, version number, and related info. - types.AuditFields audit = 99; -} - -// A record (of fact) is attached to an group or each consideration output from a contract. -message Record { - // ConsiderationSpec.func_name <--> ConsiderationProto.consideration_name (method on the classname below that - // generated this) - string name = 1; - // ConsiderationSpec.outputSpec.spec.resourceLocation.ref.hash (this is the hash of the consideration which generated - // the record, see also result_hash) - string hash = 2; - // ContractSpec.definition.resourceLocation.classname (class that contains the method 'name' as given above) - string classname = 3; - // ConsiderationProto.inputs for reference with ConsiderationSpec.input_spec for type - repeated RecordInput inputs = 4; - // ConsiderationProto.result.result (indicates SKIP [not allowed], PASS, or FAIL result) - contract.ExecutionResultType result = 5; - // ConsiderationProto.result.output.name - string result_name = 6; - // ConsiderationProto.result.output.hash (the hash of the data output from the consideration) - string result_hash = 7; -} - -// RecordInputType indicates if an input is data on or off chain. -enum RecordInputType { - // invalid status - RECORD_INPUT_TYPE_UNKNOWN = 0; - // input is proposed data for recording to the blockchain - RECORD_INPUT_TYPE_PROPOSED = 1; - // input is a data element referencing an existing scope/record on chain - RECORD_INPUT_TYPE_FACT = 2; -} - -// Tracks the inputs used with a Consideration to establish the output record. -// FACT references must have come from the input fact list. -// For proposed we will only have the hash -message RecordInput { - // Name value included to link back to the definition spec. - string name = 1; - // For proposed facts we only have the hash ... for facts this hash maps to something in the input list. - string hash = 2; - // from proposed fact structure to unmarshal - string classname = 3; - // Indicates if this input was a recorded fact on chain or just a given hashed input - scope.RecordInputType type = 4; -} \ No newline at end of file diff --git a/proto/provenance/metadata/v0/spec.proto b/proto/provenance/metadata/v0/spec.proto deleted file mode 100644 index 06f25793a5..0000000000 --- a/proto/provenance/metadata/v0/spec.proto +++ /dev/null @@ -1,51 +0,0 @@ -syntax = 'proto3'; - -package spec; - -option go_package = "github.com/provenance-io/provenance/x/metadata/legacy/v039"; -option java_package = "io.provenance.metadata.v0"; -option java_multiple_files = true; - -import "provenance/metadata/v0/types.proto"; - -enum DefinitionSpecType { - DEFINITION_SPEC_TYPE_UNKNOWN = 0; - DEFINITION_SPEC_TYPE_PROPOSED = 1; - DEFINITION_SPEC_TYPE_FACT = 2; - DEFINITION_SPEC_TYPE_FACT_LIST = 3; -} - -message DefinitionSpec { - string name = 1; - types.Location resource_location = 2; - types.Signature signature = 3; - spec.DefinitionSpecType type = 4; -} - -message ContractSpec { - spec.DefinitionSpec definition = 1; - repeated spec.DefinitionSpec input_specs = 2; - repeated types.PartyType parties_involved = 3; - repeated spec.ConditionSpec condition_specs = 4; - repeated spec.ConsiderationSpec consideration_specs = 5; -} - -message ConditionSpec { - string func_name = 1; - repeated spec.DefinitionSpec input_specs = 2; - spec.OutputSpec output_spec = 3; -} - -message ConsiderationSpec { - string func_name = 1; - - // Invoking party - types.PartyType responsible_party = 2; - - repeated spec.DefinitionSpec input_specs = 3; - spec.OutputSpec output_spec = 4; -} - -message OutputSpec { - spec.DefinitionSpec spec = 1; -} \ No newline at end of file diff --git a/proto/provenance/metadata/v0/tx.proto b/proto/provenance/metadata/v0/tx.proto deleted file mode 100644 index 9b97b86413..0000000000 --- a/proto/provenance/metadata/v0/tx.proto +++ /dev/null @@ -1,61 +0,0 @@ -syntax = "proto3"; -package tx; - -import "gogoproto/gogo.proto"; -import "provenance/metadata/v0/contract.proto"; -import "provenance/metadata/v0/types.proto"; - -option go_package = "github.com/provenance-io/provenance/x/metadata/legacy/v039"; - -option java_package = "io.provenance.metadata.v0"; -option java_multiple_files = true; - -// Msg defines the Metadata Msg service. -service Msg { - // MemorializeContract records the results of a P8e contract execution as a record group and set of records in a scope - rpc MemorializeContract(MsgMemorializeContractRequest) returns (MemorializeContractResponse); - // ChangeOwnership allows P8e contracts to record a new set of owners on a scope - rpc ChangeOwnership(MsgChangeOwnershipRequest) returns (ChangeOwnershipResponse); -} - -// MsgMemorializeContractRequest is a request from a P8e execution environment to record results of a contract -message MsgMemorializeContractRequest { - // The scope of the object being modified on blockchain. - string scope_id = 1; - // The uuid of the contract execution. - string group_id = 2; - // Unique identifier for determining contract/group execution instance - string execution_id = 3; - // The executed contract. - contract.Contract contract = 4 [(gogoproto.nullable) = false]; - // The contract signatures - types.SignatureSet signatures = 5 [(gogoproto.nullable) = false]; - // ID of the scope snapshot reference for executing - string ScopeRefID = 6; - // The address of the notary (ie the broadcaster of this message). - string notary = 7; -} - -// MemorializeContractResponse from a contract execution memorialization request -message MemorializeContractResponse {} - -// MsgChangeOwnershipRequest records the result of a change ownership p8e contract execution -message MsgChangeOwnershipRequest { - // The scope of the object being modified on blockchain. - string scope_id = 1; - // The uuid of the contract execution. - string group_id = 2; - // Unique identifier for determining contract/group execution instance - string execution_id = 3; - // The recitals to use for the scope parties - contract.Recitals recitals = 4 [(gogoproto.nullable) = false]; - // The executed contract. - contract.Contract contract = 5 [(gogoproto.nullable) = false]; - // The contract signatures - types.SignatureSet signatures = 6 [(gogoproto.nullable) = false]; - // The address of the notary (ie the broadcaster of this message). - string notary = 7; -} - -// ChangeOwnershipResponse from a contract execution ownership change request -message ChangeOwnershipResponse {} \ No newline at end of file diff --git a/proto/provenance/metadata/v0/types.proto b/proto/provenance/metadata/v0/types.proto deleted file mode 100644 index e23f3e7141..0000000000 --- a/proto/provenance/metadata/v0/types.proto +++ /dev/null @@ -1,112 +0,0 @@ -syntax = 'proto3'; - -package types; - -option go_package = "github.com/provenance-io/provenance/x/metadata/legacy/v039"; -option java_package = "io.provenance.metadata.v0"; -option java_multiple_files = true; - -// Wrapper for an ISO8601 date string. EX: "2020-05-22" -message Date { - string value = 1; -} - -// Wrapper type for a standard uuid. -message UUID { - string value = 1; -} - -// Wrap a boolean result type. -message BooleanResult { - bool value = 1; -} - -// Wrap a location. -message Location { - types.ProvenanceReference ref = 1; - string classname = 2; -} - -// Wrap a factual data element. -message Fact { - string name = 1; - types.Location data_location = 2; -} - -message ProvenanceReference { - // [Req] [Scope.uuid] - // Scope ID - types.UUID scope_uuid = 1; - // [Opt] [RecordGroup.group_uuid] - // require record to be within a specific group - types.UUID group_uuid = 2; - // [Opt] [Record.result_hash] - // specify a specific record inside a scope (and group) by result-hash - string hash = 3; - // [Opt] [Record.result_name] - // specify a result-name of a record within a scope - string name = 4; -} - -// Wrapper around a standard signature. -message Signature { - // Signature Detail - string algo = 1; - string provider = 2; - string signature = 3; - - // Identity of signer - types.SigningAndEncryptionPublicKeys signer = 4; -} - -// A collection of signatures -message SignatureSet { - repeated Signature signatures = 1; -} - -enum PublicKeyType { ELLIPTIC = 0; } - -enum PublicKeyCurve { - SECP256K1 = 0; - P256 = 1; -} - -message PublicKey { - bytes public_key_bytes = 1; - PublicKeyType type = 2; - PublicKeyCurve curve = 3; -} - -message SigningAndEncryptionPublicKeys { - types.PublicKey signing_public_key = 1; - types.PublicKey encryption_public_key = 2; -} - -enum PartyType { - PARTY_TYPE_UNKNOWN = 0; - PARTY_TYPE_ORIGINATOR = 1; - PARTY_TYPE_SERVICER = 2; - PARTY_TYPE_INVESTOR = 3; - PARTY_TYPE_CUSTODIAN = 4; - PARTY_TYPE_OWNER = 5; - PARTY_TYPE_AFFILIATE = 6; - PARTY_TYPE_OMNIBUS = 7; - PARTY_TYPE_PROVENANCE = 8; - PARTY_TYPE_MARKER = 9; -} - -// Audit -message AuditFields { - GogoTimeHack created_date = 1; - string created_by = 2; - GogoTimeHack updated_date = 3; - string updated_by = 4; - int32 version = 5; - string message = 6; -} - -// proto 3 timestamp structure (hack to get around gogo issues with invalid dates) -message GogoTimeHack { - int64 seconds = 1; - int32 nanos = 2; -} \ No newline at end of file diff --git a/x/attribute/legacy/v039/types.go b/x/attribute/legacy/v039/types.go deleted file mode 100644 index c11b5e8921..0000000000 --- a/x/attribute/legacy/v039/types.go +++ /dev/null @@ -1,23 +0,0 @@ -package v039 - -// ModuleName is the name of this module. -const ModuleName string = "account" - -// Attribute is a typed key-value pair we can store under an account. -type Attribute struct { - // The attribute name. - Name string `json:"name"` - // The attribute value. - Value []byte `json:"value"` - // The attribute value type. - Type string `json:"type"` - // The attribute address (used only for genesis import/export) - Address string `json:"address,omitempty"` - // The block height this attr was added in. - Height int64 `json:"height,omitempty"` -} - -// GenesisState is the module state at genesis. -type GenesisState struct { - Attributes []Attribute `json:"attributes"` -} diff --git a/x/attribute/legacy/v040/migrate.go b/x/attribute/legacy/v040/migrate.go deleted file mode 100644 index c36f6d9ed2..0000000000 --- a/x/attribute/legacy/v040/migrate.go +++ /dev/null @@ -1,31 +0,0 @@ -package v040 - -import ( - v039attribute "github.com/provenance-io/provenance/x/attribute/legacy/v039" - v040attribute "github.com/provenance-io/provenance/x/attribute/types" -) - -// Migrate accepts exported x/attribute genesis state from v0.39 and migrates it -// to v0.40 x/attribute genesis state. The migration includes: -// -// - Convert addresses from bytes to bech32 strings. -// - Re-encode in v0.40 GenesisState. -func Migrate(oldGenState v039attribute.GenesisState) *v040attribute.GenesisState { - var attributeAccounts = make([]v040attribute.Attribute, 0, len(oldGenState.Attributes)) - for _, at := range oldGenState.Attributes { - atType, err := v040attribute.AttributeTypeFromString(at.Type) - if err != nil { - panic(err) - } - attributeAccounts = append(attributeAccounts, v040attribute.Attribute{ - Name: at.Name, - Address: at.Address, - Value: at.Value, - AttributeType: atType, - }) - } - return &v040attribute.GenesisState{ - Params: v040attribute.DefaultParams(), - Attributes: attributeAccounts, - } -} diff --git a/x/attribute/legacy/v040/migrate_test.go b/x/attribute/legacy/v040/migrate_test.go deleted file mode 100644 index 7b6395bc29..0000000000 --- a/x/attribute/legacy/v040/migrate_test.go +++ /dev/null @@ -1,67 +0,0 @@ -package v040_test - -import ( - "encoding/json" - "fmt" - "testing" - - "github.com/stretchr/testify/require" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/simapp" - sdk "github.com/cosmos/cosmos-sdk/types" - - v039 "github.com/provenance-io/provenance/x/attribute/legacy/v039" - v040 "github.com/provenance-io/provenance/x/attribute/legacy/v040" -) - -func TestMigrate(t *testing.T) { - encodingConfig := simapp.MakeTestEncodingConfig() - clientCtx := client.Context{}. - WithInterfaceRegistry(encodingConfig.InterfaceRegistry). - WithTxConfig(encodingConfig.TxConfig). - WithLegacyAmino(encodingConfig.Amino). - WithJSONCodec(encodingConfig.Marshaler) - - addr1, err := sdk.AccAddressFromBech32("cosmos16xyempempp92x9hyzz9wrgf94r6j9h5f06pxxv") - require.NoError(t, err) - - gs := v039.GenesisState{ - Attributes: []v039.Attribute{ - { - Name: "test", - Value: []byte("test-value"), - Type: "String", - Address: addr1.String(), - Height: 2, - }, - }, - } - - migrated := v040.Migrate(gs) - expected := fmt.Sprintf(`{ - "attributes": [ - { - "address": "%s", - "attribute_type": "ATTRIBUTE_TYPE_STRING", - "name": "test", - "value": "dGVzdC12YWx1ZQ==" - } - ], - "params": { - "max_value_length": 10000 - } -}`, addr1.String()) - - bz, err := clientCtx.JSONCodec.MarshalJSON(migrated) - require.NoError(t, err) - - // Indent the JSON bz correctly. - var jsonObj map[string]interface{} - err = json.Unmarshal(bz, &jsonObj) - require.NoError(t, err) - indentedBz, err := json.MarshalIndent(jsonObj, "", " ") - require.NoError(t, err) - - require.Equal(t, expected, string(indentedBz)) -} diff --git a/x/attribute/legacy/v040/types.go b/x/attribute/legacy/v040/types.go deleted file mode 100644 index 0890416bf6..0000000000 --- a/x/attribute/legacy/v040/types.go +++ /dev/null @@ -1,5 +0,0 @@ -package v040 - -const ( - ModuleName = "attribute" -) diff --git a/x/marker/legacy/v039/types.go b/x/marker/legacy/v039/types.go deleted file mode 100644 index a7d6fd76a6..0000000000 --- a/x/marker/legacy/v039/types.go +++ /dev/null @@ -1,706 +0,0 @@ -package v039 - -import ( - "encoding/json" - "fmt" - "strings" - - "github.com/cosmos/cosmos-sdk/codec" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - sdk "github.com/cosmos/cosmos-sdk/types" - v038auth "github.com/cosmos/cosmos-sdk/x/auth/legacy/v038" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/legacy/v039" - "github.com/tendermint/tendermint/crypto" - "gopkg.in/yaml.v2" -) - -const ( - AccessMint = "mint" - AccessBurn = "burn" - AccessDeposit = "deposit" - AccessWithdraw = "withdraw" - AccessDelete = "delete" - AccessAdmin = "grant" - - AllPermissions = "mint,burn,deposit,withdraw,delete,grant" - SupplyPermissions = "mint,burn" - AssetPermissions = "deposit,withdraw" - ModuleName = "marker" -) - -// MarkerAccount defines a marker account interface for modules that interact with markers -type MarkerAccountI interface { - v038auth.Account - - Validate() error - - GetDenom() string - GetManager() sdk.AccAddress - GetMarkerType() string - - GetStatus() string - SetStatus(string) error - - GetSupply() sdk.Coin - SetSupply(sdk.Coin) error - - GrantAccess(AccessGrant) error - RevokeAccess(sdk.AccAddress) error - - AddressHasPermission(sdk.AccAddress, string) bool - AddressListForPermission(string) []sdk.AccAddress -} - -// AccessGrant defines an interface for interacting with roles assigned to a given address. -type AccessGrantI interface { - Validate() error - GetAddress() sdk.AccAddress - - HasPermission(string) bool - GetPermissions() []string - - AddPermission(string) error - RemovePermission(string) error - - MergeAdd(AccessGrant) error - MergeRemove(AccessGrant) error -} - -// GenesisState is the initial marker module state. -type GenesisState struct { - Markers []MarkerAccount `json:"markers"` -} - -// AccessGrant is a structure for assigning a set of marker management permissions to an address -type AccessGrant struct { - Permissions []string `json:"permissions" yaml:"permissions"` - Address sdk.AccAddress `json:"address" yaml:"address"` -} - -// MarkerAssets is a list of scope ids that a given address (of a marker) is associated with -type MarkerAssets struct { - // Address of the marker - Address sdk.AccAddress `json:"address" yaml:"address"` - // List of scope uuids that have the marker as a party member - ScopeID []string `json:"scope_id" yaml:"scope_id"` -} - -// MarkerAccount is a configuration structure that defines a Token and the resulting supply of coins. -type MarkerAccount struct { - *authtypes.BaseAccount - - // Address that owns the marker configuration. This account must sign any requests - // to change marker config (only valid for statuses prior to finalization) - Manager sdk.AccAddress `json:"manager,omitempty" yaml:"manager"` - // Access control lists - AccessControls []AccessGrant `json:"accesscontrol,omitempty" yaml:"accesscontrol"` - - // Indicates the current status of this marker record. - Status MarkerStatus `json:"status" yaml:"status"` - - // value denomination and total supply for the token. - Denom string `json:"denom" yaml:"denom"` - Supply sdk.Int `json:"total_supply" yaml:"total_supply"` - // Marker type information - MarkerType string `json:"type,omitempty" yaml:"type"` -} - -// NewEmptyMarkerAccount creates a new empty marker account in a Proposed state -func NewEmptyMarkerAccount(denom string, grants []AccessGrant) *MarkerAccount { - baseAcc := authtypes.NewBaseAccountWithAddress(MustGetMarkerAddress(denom)) - return &MarkerAccount{ - BaseAccount: &baseAcc, - AccessControls: grants, - Denom: denom, - Supply: sdk.ZeroInt(), - Status: StatusProposed, - MarkerType: "COIN", - } -} - -// NewMarkerAccount creates a marker account initialized over a given base account. -func NewMarkerAccount( - baseAcc *authtypes.BaseAccount, - totalSupply sdk.Coin, - accessControls []AccessGrant, - status MarkerStatus, - markerType string, -) *MarkerAccount { - return &MarkerAccount{ - BaseAccount: baseAcc, - Denom: totalSupply.Denom, - Supply: totalSupply.Amount, - AccessControls: accessControls, - Status: status, - MarkerType: markerType, - } -} - -// GetDenom the denomination of the coin associated with this marker -func (ma MarkerAccount) GetDenom() string { return ma.Denom } - -// AddressHasPermission returns true if the provided address has been assigned the provided -// role within the current MarkerAccount AccessControls -func (ma *MarkerAccount) AddressHasPermission(addr sdk.AccAddress, role string) bool { - for _, g := range ma.AccessControls { - if g.Address.Equals(addr) && g.HasPermission(role) { - return true - } - } - return false -} - -// AddressListForPermission returns a list of all addresses with the provided rule within the -// current MarkerAccount AccessControls list -func (ma *MarkerAccount) AddressListForPermission(role string) []sdk.AccAddress { - var addressList []sdk.AccAddress - - for _, g := range ma.AccessControls { - if g.HasPermission(role) { - addressList = append(addressList, g.GetAddress()) - } - } - return addressList -} - -// Validate performs minimal sanity checking over the current MarkerAccount instance -func (ma MarkerAccount) Validate() error { - if !ValidMarkerStatus(ma.Status) { - return fmt.Errorf("invalid marker status") - } - // unlikely as this is set using Coin which prohibits negative values. - if ma.Supply.IsNegative() { - return fmt.Errorf("total supply must be greater than or equal to zero") - } - if ma.Status != StatusProposed && len(ma.AddressListForPermission(AccessMint)) == 0 && ma.Supply.IsZero() { - return fmt.Errorf("cannot create a marker with zero total supply and no authorization for minting more") - } - // unlikely as this is set using a Coin which prohibits this value. - if strings.TrimSpace(ma.Denom) == "" { - return fmt.Errorf("marker denom cannot be empty") - } - markerAddress, err := MarkerAddress(ma.Denom) - if err != nil { - return fmt.Errorf("marker denom is invalid, only 3-16 lowercase letters or numbers are allowed") - } - if !ma.BaseAccount.Address.Equals(markerAddress) { - return fmt.Errorf("address %s cannot be derived from the marker denom '%s'", ma.Address, ma.Denom) - } - if err := ValidateGrants(ma.AccessControls...); err != nil { - return fmt.Errorf("invalid access privileges granted: %v", err) - } - selfGrant := GrantsForAddress(ma.Address, ma.AccessControls...).GetPermissions() - if len(selfGrant) > 0 { - return fmt.Errorf("permissions cannot be granted to '%s' marker account: %v", ma.Denom, selfGrant) - } - return ma.BaseAccount.Validate() -} - -// SetPubKey implements authtypes.Account (but there are no public keys associated with the account for signing) -func (ma *MarkerAccount) SetPubKey(pubKey cryptotypes.PubKey) error { - return fmt.Errorf("not supported for marker accounts") -} - -// SetSequence implements authtypes.Account (but you can't set a sequence as you can't sign tx for this account) -func (ma *MarkerAccount) SetSequence(seq uint64) error { - return fmt.Errorf("not supported for marker accounts") -} - -// GetStatus returns the status of the marker account. -func (ma MarkerAccount) GetStatus() string { - return ma.Status.String() -} - -// SetStatus sets the status of the marker to the provided value. -func (ma *MarkerAccount) SetStatus(newStatus string) error { - status, err := MarkerStatusFromString(newStatus) - if err != nil { - return fmt.Errorf("error invalid marker status %s is not a known status type", newStatus) - } - if status == StatusActive { - // When activated the manager property is no longer valid so clear it - ma.Manager = sdk.AccAddress([]byte{}) - } - - ma.Status = status - return nil -} - -// GetMarkerType returns the type of the marker account. -func (ma MarkerAccount) GetMarkerType() string { - return ma.MarkerType -} - -// GetManager returns the address of the account that is responsible for the proposed marker. -func (ma MarkerAccount) GetManager() sdk.AccAddress { - return ma.Manager -} - -// SetManager sets the manager/owner address for proposed marker accounts -func (ma *MarkerAccount) SetManager(manager sdk.AccAddress) error { - if !manager.Empty() && ma.Status != StatusProposed { - return fmt.Errorf("manager address is only valid for proposed markers, use access grants instead") - } - ma.Manager = manager - return nil -} - -// SetSupply sets the total supply amount to track -func (ma *MarkerAccount) SetSupply(total sdk.Coin) error { - if total.Denom != ma.Denom { - return fmt.Errorf("supply coin denom must match marker denom") - } - ma.Supply = total.Amount - return nil -} - -// GetSupply implements authtypes.Account -func (ma MarkerAccount) GetSupply() sdk.Coin { - return sdk.NewCoin(ma.Denom, ma.Supply) -} - -// GrantAccess appends the access grant to the marker account. -func (ma *MarkerAccount) GrantAccess(access AccessGrant) error { - if err := access.Validate(); err != nil { - return fmt.Errorf(err.Error()) - } - // Find any existing permissions and append specified permissions - for _, ac := range ma.AccessControls { - if ac.Address.Equals(access.GetAddress()) { - if err := access.MergeAdd(*NewAccessGrant(ac.GetAddress(), ac.GetPermissions())); err != nil { - return err - } - } - } - // Revoke existing (no errors from this as we have validated above) - if err := ma.RevokeAccess(access.GetAddress()); err != nil { - return err - } - // Append the new record - ma.AccessControls = append(ma.AccessControls, *NewAccessGrant(access.GetAddress(), access.GetPermissions())) - return nil -} - -// RevokeAccess removes any AccessGrant for the given address on this marker. -func (ma *MarkerAccount) RevokeAccess(addr sdk.AccAddress) error { - if err := sdk.VerifyAddressFormat(addr); err != nil { - return fmt.Errorf("can not revoke access for invalid address") - } - - var accessList []AccessGrant - for _, ac := range ma.AccessControls { - if !ac.Address.Equals(addr) { - accessList = append(accessList, ac) - } - } - - ma.AccessControls = accessList - return nil -} - -// markerAccountPretty suppresses the public key value during json serialization -type markerAccountPretty struct { - Address sdk.AccAddress `json:"address" yaml:"address"` - Coins sdk.Coins `json:"coins" yaml:"coins"` - PubKey string `json:"public_key,omitempty" yaml:"public_key,omitempty"` - AccountNumber uint64 `json:"account_number" yaml:"account_number"` - Sequence uint64 `json:"sequence" yaml:"sequence"` - Manager sdk.AccAddress `json:"manager,omitempty" yaml:"manager,omitempty"` - AccessControls []AccessGrant `json:"permissions" yaml:"permissions"` - Status MarkerStatus `json:"status" yaml:"status"` - Denom string `json:"denom" yaml:"denom"` - Supply sdk.Int `json:"total_supply" yaml:"total_supply"` - MarkerType string `json:"marker_type" yaml:"marker_type"` -} - -func (ma MarkerAccount) String() string { - out, _ := ma.MarshalYAML() - return out.(string) -} - -// MarshalYAML returns the YAML representation of a MarkerAccount. -func (ma MarkerAccount) MarshalYAML() (interface{}, error) { - bs, err := yaml.Marshal(markerAccountPretty{ - Address: ma.Address, - Coins: ma.Coins, - PubKey: "", - AccountNumber: ma.AccountNumber, - Sequence: ma.Sequence, - Manager: ma.Manager, - AccessControls: ma.AccessControls, - Status: ma.Status, - Denom: ma.Denom, - Supply: ma.Supply, - MarkerType: ma.MarkerType, - }) - - if err != nil { - return nil, err - } - - return string(bs), nil -} - -// MarshalJSON returns the JSON representation of a MarkerAccount. -func (ma MarkerAccount) MarshalJSON() ([]byte, error) { - return json.Marshal(markerAccountPretty{ - Address: ma.Address, - Coins: ma.Coins, - PubKey: "", - AccountNumber: ma.AccountNumber, - Sequence: ma.Sequence, - Manager: ma.Manager, - AccessControls: ma.AccessControls, - Status: ma.Status, - Denom: ma.Denom, - Supply: ma.Supply, - MarkerType: ma.MarkerType, - }) -} - -// UnmarshalJSON un-marshals raw JSON bytes into a MarkerAccount. -func (ma *MarkerAccount) UnmarshalJSON(bz []byte) error { - var alias markerAccountPretty - if err := json.Unmarshal(bz, &alias); err != nil { - return err - } - - ma.BaseAccount = authtypes.NewBaseAccount(alias.Address, alias.Coins, nil, alias.AccountNumber, alias.Sequence) - ma.Manager = alias.Manager - ma.AccessControls = alias.AccessControls - ma.Status = alias.Status - ma.Denom = alias.Denom - ma.Supply = alias.Supply - ma.MarkerType = alias.MarkerType - return nil -} - -// Equals returns true if this MarkerAccount is equal to other MarkerAccount in all properties -func (ma MarkerAccount) Equals(other MarkerAccount) bool { - grantsEqual := true - for _, g := range ma.AccessControls { - if !g.Equals(GrantsForAddress(g.Address, other.AccessControls...)) { - grantsEqual = false - } - } - return grantsEqual && - other.Address.Equals(ma.Address) && - other.Coins.IsEqual(ma.Coins) && - other.AccountNumber == ma.AccountNumber && - other.Sequence == ma.Sequence && - other.Manager.Equals(ma.Manager) && - other.Status.String() == ma.Status.String() && - other.Denom == ma.Denom && - other.Supply.Equal(ma.Supply) && - other.MarkerType == ma.MarkerType -} - -// NewAccessGrant creates a new AccessGrant object -func NewAccessGrant(address sdk.AccAddress, permissions []string) *AccessGrant { - return &AccessGrant{ - Permissions: permissions, - Address: address, - } -} - -// ValidateGrants checks a collection of grants and returns any errors encountered or nil -func ValidateGrants(grants ...AccessGrant) error { - for _, grant := range grants { - if err := grant.Validate(); err != nil { - return err - } - } - return nil -} - -// GrantsForAddress return -func GrantsForAddress(account sdk.AccAddress, grants ...AccessGrant) AccessGrant { - for _, grant := range grants { - if grant.Address.Equals(account) { - return grant - } - } - return AccessGrant{nil, account} -} - -// Validate performs checks to ensure this acccess grant is properly formed. -func (ag AccessGrant) Validate() error { - if ag.Address.Empty() { - return fmt.Errorf("address can not be empty") - } - return validateGranted(ag.Permissions...) -} - -// HasPermission returns true if the AccessGrant allows the given permission -func (ag AccessGrant) HasPermission(permission string) bool { - // Empty addresses can have no permissions. - if ag.Address.Empty() { - return false - } - for _, p := range ag.Permissions { - if p == permission { - return true - } - } - return false -} - -// AddPermission adds the given permission to this grant if not included -func (ag *AccessGrant) AddPermission(permission string) error { - if err := validateGranted(permission); err != nil { - return err - } - if !ag.HasPermission(permission) { - ag.Permissions = append(ag.Permissions, permission) - } - return nil -} - -// RemovePermission removes the given permission from this grant (if included) -func (ag *AccessGrant) RemovePermission(permission string) error { - if err := validateGranted(permission); err != nil { - return err - } - if ag.HasPermission(permission) { - var newPerms []string - for _, p := range ag.Permissions { - if p != permission { - newPerms = append(newPerms, p) - } - } - ag.Permissions = newPerms - } - return nil -} - -// MergeAdd looks for any missing permissions in the given grant and adds them to this instance. -func (ag *AccessGrant) MergeAdd(other AccessGrant) error { - if err := other.Validate(); err != nil { - return err - } - if !other.GetAddress().Equals(ag.Address) { - return fmt.Errorf("cannot merge in AccessGrant for different address") - } - for _, p := range other.GetPermissions() { - if !ag.HasPermission(p) { - ag.Permissions = append(ag.Permissions, p) - } - } - return nil -} - -// MergeRemove looks for permissions in this instance that exist in the given grant and removes them. -func (ag *AccessGrant) MergeRemove(other AccessGrant) error { - if err := other.Validate(); err != nil { - return err - } - if !other.GetAddress().Equals(ag.Address) { - return fmt.Errorf("cannot merge in AccessGrant for different address") - } - var newPerms []string - for _, p := range ag.Permissions { - if !other.HasPermission(p) { - newPerms = append(newPerms, p) - } - } - ag.Permissions = newPerms - return nil -} - -// GetAddress returns the address the AccessGrant is for -func (ag AccessGrant) GetAddress() sdk.AccAddress { - return ag.Address -} - -// GetPermissions returns the permissions granted to the address -func (ag AccessGrant) GetPermissions() []string { - return ag.Permissions -} - -// Equals returns true if both AccessGrants has the same address and list of permissions. -func (ag AccessGrant) Equals(other AccessGrant) bool { - // same address and same number of permissions... - areEqual := ag.Address.Equals(other.Address) && - len(ag.Permissions) == len(other.Permissions) - // and other has all the same permissiosn that we have... - for _, p := range ag.Permissions { - if !other.HasPermission(p) { - areEqual = false - } - } - return areEqual -} - -// performs basic permission validation -func validateGranted(permissions ...string) error { - for _, permission := range permissions { - for _, c := range permission { - // this check protects against injecting commas (or anything else unexpected) which could break our list processing - if c < 'a' || c > 'z' { - return fmt.Errorf("invalid permission only lowercase letters are supported: '%s'", permission) - } - } - - if strings.TrimSpace(permission) == "" { - return fmt.Errorf("access permission is empty") - } - if !strings.Contains(AllPermissions, permission) { - return fmt.Errorf("access permission [%s] is not a valid permission", permission) - } - } - return nil -} - -// MarkerStatus defines the status type of the marker record -type MarkerStatus byte - -// Marker state types -const ( - // Invalid/uninitialized - StatusUndefined MarkerStatus = 0x00 - - // Initial configuration period, updates allowed, token supply not created. - StatusProposed MarkerStatus = 0x01 - - // Configuration finalized, ready for supply creation - StatusFinalized MarkerStatus = 0x02 - - // Supply is created, rules are in force. - StatusActive MarkerStatus = 0x03 - - // Marker has been cancelled, pending destroy - StatusCancelled MarkerStatus = 0x04 - - // Marker supply has all been recalled, marker is considered destroyed and no further actions allowed. - StatusDestroyed MarkerStatus = 0x05 -) - -// MustGetMarkerStatus turns the string into a MarkerStatus typed value ... panics if invalid. -func MustGetMarkerStatus(str string) MarkerStatus { - s, err := MarkerStatusFromString(str) - if err != nil { - panic(err) - } - return s -} - -// MarkerStatusFromString returns a MarkerStatus from a string. It returns an error -// if the string is invalid. -func MarkerStatusFromString(str string) (MarkerStatus, error) { - switch strings.ToLower(str) { - case "undefined": - return StatusUndefined, nil - case "proposed": - return StatusProposed, nil - case "finalized": - return StatusFinalized, nil - case "active": - return StatusActive, nil - case "cancelled": - return StatusCancelled, nil - case "destroyed": - return StatusDestroyed, nil - - default: - return MarkerStatus(0xff), fmt.Errorf("'%s' is not a valid marker status", str) - } -} - -// ValidMarkerStatus returns true if the marker status is valid and false otherwise. -func ValidMarkerStatus(markerStatus MarkerStatus) bool { - if markerStatus == StatusProposed || - markerStatus == StatusFinalized || - markerStatus == StatusActive || - markerStatus == StatusCancelled || - markerStatus == StatusDestroyed { - return true - } - return false -} - -// Marshal needed for protobuf compatibility. -func (rt MarkerStatus) Marshal() ([]byte, error) { - return []byte{byte(rt)}, nil -} - -// Unmarshal needed for protobuf compatibility. -func (rt *MarkerStatus) Unmarshal(data []byte) error { - *rt = MarkerStatus(data[0]) - return nil -} - -// MarshalJSON using string. -func (rt MarkerStatus) MarshalJSON() ([]byte, error) { - return json.Marshal(rt.String()) -} - -// UnmarshalJSON decodes from JSON string version of this status -func (rt *MarkerStatus) UnmarshalJSON(data []byte) error { - var s string - err := json.Unmarshal(data, &s) - if err != nil { - return err - } - - bz2, err := MarkerStatusFromString(s) - if err != nil { - return err - } - - *rt = bz2 - return nil -} - -// String implements the Stringer interface. -func (rt MarkerStatus) String() string { - switch rt { - case StatusUndefined: - return "undefined" - case StatusProposed: - return "proposed" - case StatusFinalized: - return "finalized" - case StatusActive: - return "active" - case StatusCancelled: - return "cancelled" - case StatusDestroyed: - return "destroyed" - - default: - return "" - } -} - -// Format implements the fmt.Formatter interface. -func (rt MarkerStatus) Format(s fmt.State, verb rune) { - switch verb { - case 's': - s.Write([]byte(rt.String())) - default: - s.Write([]byte(fmt.Sprintf("%v", byte(rt)))) - } -} - -// MarkerAddress returns the module account address for the given denomination -func MarkerAddress(denom string) (sdk.AccAddress, error) { - if err := sdk.ValidateDenom(denom); err != nil { - return nil, err - } - return sdk.AccAddress(crypto.AddressHash([]byte(denom))), nil -} - -func MustGetMarkerAddress(denom string) sdk.AccAddress { - addr, err := MarkerAddress(denom) - if err != nil { - panic(err) - } - return addr -} - -func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - cdc.RegisterInterface((*AccessGrantI)(nil), nil) - cdc.RegisterInterface((*MarkerAccountI)(nil), nil) - cdc.RegisterConcrete(&MarkerAccount{}, "provenance/marker/Account", nil) - cdc.RegisterConcrete(&AccessGrant{}, "provenance/marker/AcccessGrant", nil) -} diff --git a/x/marker/legacy/v040/migrate.go b/x/marker/legacy/v040/migrate.go deleted file mode 100644 index b3863a7469..0000000000 --- a/x/marker/legacy/v040/migrate.go +++ /dev/null @@ -1,53 +0,0 @@ -package v040 - -import ( - "strings" - - "github.com/cosmos/cosmos-sdk/x/auth/types" - - v039marker "github.com/provenance-io/provenance/x/marker/legacy/v039" - v040marker "github.com/provenance-io/provenance/x/marker/types" -) - -// Migrate accepts exported x/marker genesis state from v0.39 and migrates it -// to v0.40 x/marker genesis state. The migration includes: -// -// - Convert addresses from bytes to bech32 strings. -// - Re-encode in v0.40 GenesisState. -func Migrate(oldGenState v039marker.GenesisState) *v040marker.GenesisState { - var markerAccounts = make([]v040marker.MarkerAccount, 0, len(oldGenState.Markers)) - for _, mark := range oldGenState.Markers { - markerAccounts = append(markerAccounts, v040marker.MarkerAccount{ - BaseAccount: &types.BaseAccount{ - Address: mark.Address.String(), - AccountNumber: mark.AccountNumber, - Sequence: mark.Sequence, - }, - Manager: mark.Manager.String(), - Status: v040marker.MustGetMarkerStatus(mark.GetStatus()), - Denom: mark.Denom, - Supply: mark.GetSupply().Amount, - AccessControl: migrateAccess(mark.AccessControls), - // v039 only supported COIN type (ignore previous values as untyped field held trash) - MarkerType: v040marker.MarkerType_Coin, - }) - } - return &v040marker.GenesisState{ - Params: v040marker.DefaultParams(), - Markers: markerAccounts, - } -} - -func migrateAccess(old []v039marker.AccessGrant) (new []v040marker.AccessGrant) { - new = make([]v040marker.AccessGrant, len(old)) - for i, a := range old { - perms := strings.Join(a.Permissions, ",") - perms = strings.ToLower(perms) - perms = strings.ReplaceAll(perms, "grant", "admin") - new[i] = v040marker.AccessGrant{ - Address: a.Address.String(), - Permissions: v040marker.AccessListByNames(perms), - } - } - return -} diff --git a/x/marker/legacy/v040/migrate_test.go b/x/marker/legacy/v040/migrate_test.go deleted file mode 100644 index 929c4f1915..0000000000 --- a/x/marker/legacy/v040/migrate_test.go +++ /dev/null @@ -1,96 +0,0 @@ -package v040_test - -import ( - "encoding/json" - "fmt" - "testing" - - "github.com/stretchr/testify/require" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/simapp" - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/legacy/v039" - - v039 "github.com/provenance-io/provenance/x/marker/legacy/v039" - v040 "github.com/provenance-io/provenance/x/marker/legacy/v040" -) - -func TestMigrate(t *testing.T) { - encodingConfig := simapp.MakeTestEncodingConfig() - clientCtx := client.Context{}. - WithInterfaceRegistry(encodingConfig.InterfaceRegistry). - WithTxConfig(encodingConfig.TxConfig). - WithLegacyAmino(encodingConfig.Amino). - WithJSONCodec(encodingConfig.Marshaler) - - addr1, err := sdk.AccAddressFromBech32("cosmos16xyempempp92x9hyzz9wrgf94r6j9h5f06pxxv") - require.NoError(t, err) - - gs := v039.GenesisState{ - Markers: []v039.MarkerAccount{ - { - BaseAccount: &authtypes.BaseAccount{ - Address: addr1, - Coins: sdk.NewCoins(sdk.NewCoin("test", sdk.OneInt())), - AccountNumber: 5, - Sequence: 4, - }, - Manager: addr1, - Status: v039.MustGetMarkerStatus("active"), - Denom: "hotdog", - Supply: sdk.OneInt(), - MarkerType: "COIN", - AccessControls: []v039.AccessGrant{{Address: addr1, Permissions: []string{"mint", "burn", "grant"}}}, - }, - }, - } - - migrated := v040.Migrate(gs) - expected := fmt.Sprintf(`{ - "markers": [ - { - "access_control": [ - { - "address": "%s", - "permissions": [ - "ACCESS_MINT", - "ACCESS_BURN", - "ACCESS_ADMIN" - ] - } - ], - "allow_governance_control": false, - "base_account": { - "account_number": "5", - "address": "%s", - "pub_key": null, - "sequence": "4" - }, - "denom": "hotdog", - "manager": "%s", - "marker_type": "MARKER_TYPE_COIN", - "status": "MARKER_STATUS_ACTIVE", - "supply": "1", - "supply_fixed": false - } - ], - "params": { - "enable_governance": true, - "max_total_supply": "100000000000", - "unrestricted_denom_regex": "[a-zA-Z][a-zA-Z0-9\\-\\.]{2,64}" - } -}`, addr1.String(), addr1.String(), addr1.String()) - - bz, err := clientCtx.JSONCodec.MarshalJSON(migrated) - require.NoError(t, err) - - // Indent the JSON bz correctly. - var jsonObj map[string]interface{} - err = json.Unmarshal(bz, &jsonObj) - require.NoError(t, err) - indentedBz, err := json.MarshalIndent(jsonObj, "", " ") - require.NoError(t, err) - - require.Equal(t, expected, string(indentedBz)) -} diff --git a/x/marker/legacy/v040/types.go b/x/marker/legacy/v040/types.go deleted file mode 100644 index 013e11ce40..0000000000 --- a/x/marker/legacy/v040/types.go +++ /dev/null @@ -1,5 +0,0 @@ -package v040 - -const ( - ModuleName = "marker" -) diff --git a/x/metadata/legacy/v039/codec.go b/x/metadata/legacy/v039/codec.go deleted file mode 100644 index f6cd959a91..0000000000 --- a/x/metadata/legacy/v039/codec.go +++ /dev/null @@ -1,46 +0,0 @@ -package v039 - -import ( - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/msgservice" -) - -const ( - ModuleName = "metadata" - SpecModuleName = "spec" -) - -// RegisterLegacyAminoCodec registers the necessary x/distribution interfaces and concrete types -// on the provided LegacyAmino codec. These types are used for Amino JSON serialization. -func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - cdc.RegisterConcrete(&MsgChangeOwnershipRequest{}, "provenance-blockchain/legacy/MsgChangeOwnershipRequest", nil) - cdc.RegisterConcrete(&MsgMemorializeContractRequest{}, "provenance-blockchain/legacy/MemorializeContractRequest", nil) -} - -func RegisterInterfaces(registry types.InterfaceRegistry) { - registry.RegisterImplementations( - (*sdk.Msg)(nil), - &MsgChangeOwnershipRequest{}, - &MsgMemorializeContractRequest{}, - ) - - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) -} - -var ( - amino = codec.NewLegacyAmino() - - // ModuleCdc references the v039 x/metadata module codec. Note, the codec - // should ONLY be used for legacy amino json encoding of legacy requests. - - ModuleCdc = codec.NewAminoCodec(amino) -) - -func init() { - RegisterLegacyAminoCodec(amino) - cryptocodec.RegisterCrypto(amino) - amino.Seal() -} diff --git a/x/metadata/legacy/v039/contract.pb.go b/x/metadata/legacy/v039/contract.pb.go deleted file mode 100644 index b9078b9cf0..0000000000 --- a/x/metadata/legacy/v039/contract.pb.go +++ /dev/null @@ -1,2486 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: provenance/metadata/v0/contract.proto - -package v039 - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "google.golang.org/protobuf/types/known/timestamppb" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// 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 ExecutionResultType int32 - -const ( - ExecutionResultType_RESULT_TYPE_UNKNOWN ExecutionResultType = 0 - ExecutionResultType_RESULT_TYPE_PASS ExecutionResultType = 1 - // Couldn't process the condition/consideration due to missing facts being generated by other considerations. - ExecutionResultType_RESULT_TYPE_SKIP ExecutionResultType = 2 - ExecutionResultType_RESULT_TYPE_FAIL ExecutionResultType = 3 -) - -var ExecutionResultType_name = map[int32]string{ - 0: "RESULT_TYPE_UNKNOWN", - 1: "RESULT_TYPE_PASS", - 2: "RESULT_TYPE_SKIP", - 3: "RESULT_TYPE_FAIL", -} - -var ExecutionResultType_value = map[string]int32{ - "RESULT_TYPE_UNKNOWN": 0, - "RESULT_TYPE_PASS": 1, - "RESULT_TYPE_SKIP": 2, - "RESULT_TYPE_FAIL": 3, -} - -func (x ExecutionResultType) String() string { - return proto.EnumName(ExecutionResultType_name, int32(x)) -} - -func (ExecutionResultType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_429189f5158833e0, []int{0} -} - -type Recital struct { - SignerRole PartyType `protobuf:"varint,1,opt,name=signer_role,json=signerRole,proto3,enum=types.PartyType" json:"signer_role,omitempty"` - Signer *SigningAndEncryptionPublicKeys `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` - Address []byte `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` -} - -func (m *Recital) Reset() { *m = Recital{} } -func (m *Recital) String() string { return proto.CompactTextString(m) } -func (*Recital) ProtoMessage() {} -func (*Recital) Descriptor() ([]byte, []int) { - return fileDescriptor_429189f5158833e0, []int{0} -} -func (m *Recital) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Recital) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Recital.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 *Recital) XXX_Merge(src proto.Message) { - xxx_messageInfo_Recital.Merge(m, src) -} -func (m *Recital) XXX_Size() int { - return m.Size() -} -func (m *Recital) XXX_DiscardUnknown() { - xxx_messageInfo_Recital.DiscardUnknown(m) -} - -var xxx_messageInfo_Recital proto.InternalMessageInfo - -func (m *Recital) GetSignerRole() PartyType { - if m != nil { - return m.SignerRole - } - return PartyType_PARTY_TYPE_UNKNOWN -} - -func (m *Recital) GetSigner() *SigningAndEncryptionPublicKeys { - if m != nil { - return m.Signer - } - return nil -} - -func (m *Recital) GetAddress() []byte { - if m != nil { - return m.Address - } - return nil -} - -type Recitals struct { - Parties []*Recital `protobuf:"bytes,1,rep,name=parties,proto3" json:"parties,omitempty"` -} - -func (m *Recitals) Reset() { *m = Recitals{} } -func (m *Recitals) String() string { return proto.CompactTextString(m) } -func (*Recitals) ProtoMessage() {} -func (*Recitals) Descriptor() ([]byte, []int) { - return fileDescriptor_429189f5158833e0, []int{1} -} -func (m *Recitals) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Recitals) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Recitals.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 *Recitals) XXX_Merge(src proto.Message) { - xxx_messageInfo_Recitals.Merge(m, src) -} -func (m *Recitals) XXX_Size() int { - return m.Size() -} -func (m *Recitals) XXX_DiscardUnknown() { - xxx_messageInfo_Recitals.DiscardUnknown(m) -} - -var xxx_messageInfo_Recitals proto.InternalMessageInfo - -func (m *Recitals) GetParties() []*Recital { - if m != nil { - return m.Parties - } - return nil -} - -type Contract struct { - Definition *DefinitionSpec `protobuf:"bytes,1,opt,name=definition,proto3" json:"definition,omitempty"` - // Points to the proto for the contractSpec - Spec *Fact `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"` - // Invoker of this contract - Invoker *SigningAndEncryptionPublicKeys `protobuf:"bytes,3,opt,name=invoker,proto3" json:"invoker,omitempty"` - // Constructor arguments. - // These are always the output of a previously recorded consideration. - Inputs []*Fact `protobuf:"bytes,4,rep,name=inputs,proto3" json:"inputs,omitempty"` - Conditions []*Condition `protobuf:"bytes,5,rep,name=conditions,proto3" json:"conditions,omitempty"` - Considerations []*Consideration `protobuf:"bytes,6,rep,name=considerations,proto3" json:"considerations,omitempty"` - Recitals []*Recital `protobuf:"bytes,7,rep,name=recitals,proto3" json:"recitals,omitempty"` - TimesExecuted int32 `protobuf:"varint,8,opt,name=times_executed,json=timesExecuted,proto3" json:"times_executed,omitempty"` - // This is only set once when the contract is initially executed - StartTime time.Time `protobuf:"bytes,9,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time" yaml:"start_time"` -} - -func (m *Contract) Reset() { *m = Contract{} } -func (m *Contract) String() string { return proto.CompactTextString(m) } -func (*Contract) ProtoMessage() {} -func (*Contract) Descriptor() ([]byte, []int) { - return fileDescriptor_429189f5158833e0, []int{2} -} -func (m *Contract) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Contract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Contract.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 *Contract) XXX_Merge(src proto.Message) { - xxx_messageInfo_Contract.Merge(m, src) -} -func (m *Contract) XXX_Size() int { - return m.Size() -} -func (m *Contract) XXX_DiscardUnknown() { - xxx_messageInfo_Contract.DiscardUnknown(m) -} - -var xxx_messageInfo_Contract proto.InternalMessageInfo - -func (m *Contract) GetDefinition() *DefinitionSpec { - if m != nil { - return m.Definition - } - return nil -} - -func (m *Contract) GetSpec() *Fact { - if m != nil { - return m.Spec - } - return nil -} - -func (m *Contract) GetInvoker() *SigningAndEncryptionPublicKeys { - if m != nil { - return m.Invoker - } - return nil -} - -func (m *Contract) GetInputs() []*Fact { - if m != nil { - return m.Inputs - } - return nil -} - -func (m *Contract) GetConditions() []*Condition { - if m != nil { - return m.Conditions - } - return nil -} - -func (m *Contract) GetConsiderations() []*Consideration { - if m != nil { - return m.Considerations - } - return nil -} - -func (m *Contract) GetRecitals() []*Recital { - if m != nil { - return m.Recitals - } - return nil -} - -func (m *Contract) GetTimesExecuted() int32 { - if m != nil { - return m.TimesExecuted - } - return 0 -} - -func (m *Contract) GetStartTime() time.Time { - if m != nil { - return m.StartTime - } - return time.Time{} -} - -type Condition struct { - ConditionName string `protobuf:"bytes,1,opt,name=condition_name,json=conditionName,proto3" json:"condition_name,omitempty"` - Result *ExecutionResult `protobuf:"bytes,2,opt,name=result,proto3" json:"result,omitempty"` -} - -func (m *Condition) Reset() { *m = Condition{} } -func (m *Condition) String() string { return proto.CompactTextString(m) } -func (*Condition) ProtoMessage() {} -func (*Condition) Descriptor() ([]byte, []int) { - return fileDescriptor_429189f5158833e0, []int{3} -} -func (m *Condition) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Condition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Condition.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 *Condition) XXX_Merge(src proto.Message) { - xxx_messageInfo_Condition.Merge(m, src) -} -func (m *Condition) XXX_Size() int { - return m.Size() -} -func (m *Condition) XXX_DiscardUnknown() { - xxx_messageInfo_Condition.DiscardUnknown(m) -} - -var xxx_messageInfo_Condition proto.InternalMessageInfo - -func (m *Condition) GetConditionName() string { - if m != nil { - return m.ConditionName - } - return "" -} - -func (m *Condition) GetResult() *ExecutionResult { - if m != nil { - return m.Result - } - return nil -} - -type Consideration struct { - ConsiderationName string `protobuf:"bytes,1,opt,name=consideration_name,json=considerationName,proto3" json:"consideration_name,omitempty"` - // Data pushed to a consideration that will ultimately match the output_spec of the consideration - Inputs []*ProposedFact `protobuf:"bytes,2,rep,name=inputs,proto3" json:"inputs,omitempty"` - Result *ExecutionResult `protobuf:"bytes,3,opt,name=result,proto3" json:"result,omitempty"` -} - -func (m *Consideration) Reset() { *m = Consideration{} } -func (m *Consideration) String() string { return proto.CompactTextString(m) } -func (*Consideration) ProtoMessage() {} -func (*Consideration) Descriptor() ([]byte, []int) { - return fileDescriptor_429189f5158833e0, []int{4} -} -func (m *Consideration) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Consideration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Consideration.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 *Consideration) XXX_Merge(src proto.Message) { - xxx_messageInfo_Consideration.Merge(m, src) -} -func (m *Consideration) XXX_Size() int { - return m.Size() -} -func (m *Consideration) XXX_DiscardUnknown() { - xxx_messageInfo_Consideration.DiscardUnknown(m) -} - -var xxx_messageInfo_Consideration proto.InternalMessageInfo - -func (m *Consideration) GetConsiderationName() string { - if m != nil { - return m.ConsiderationName - } - return "" -} - -func (m *Consideration) GetInputs() []*ProposedFact { - if m != nil { - return m.Inputs - } - return nil -} - -func (m *Consideration) GetResult() *ExecutionResult { - if m != nil { - return m.Result - } - return nil -} - -// Input to a consideration defined at runtime, and emitted as a proposed fact for inclusion on the blockchain. -type ProposedFact struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` - Classname string `protobuf:"bytes,3,opt,name=classname,proto3" json:"classname,omitempty"` - Ancestor *ProvenanceReference `protobuf:"bytes,4,opt,name=ancestor,proto3" json:"ancestor,omitempty"` -} - -func (m *ProposedFact) Reset() { *m = ProposedFact{} } -func (m *ProposedFact) String() string { return proto.CompactTextString(m) } -func (*ProposedFact) ProtoMessage() {} -func (*ProposedFact) Descriptor() ([]byte, []int) { - return fileDescriptor_429189f5158833e0, []int{5} -} -func (m *ProposedFact) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProposedFact) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProposedFact.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 *ProposedFact) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProposedFact.Merge(m, src) -} -func (m *ProposedFact) XXX_Size() int { - return m.Size() -} -func (m *ProposedFact) XXX_DiscardUnknown() { - xxx_messageInfo_ProposedFact.DiscardUnknown(m) -} - -var xxx_messageInfo_ProposedFact proto.InternalMessageInfo - -func (m *ProposedFact) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *ProposedFact) GetHash() string { - if m != nil { - return m.Hash - } - return "" -} - -func (m *ProposedFact) GetClassname() string { - if m != nil { - return m.Classname - } - return "" -} - -func (m *ProposedFact) GetAncestor() *ProvenanceReference { - if m != nil { - return m.Ancestor - } - return nil -} - -type ExecutionResult struct { - Output *ProposedFact `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"` - Result ExecutionResultType `protobuf:"varint,2,opt,name=result,proto3,enum=contract.ExecutionResultType" json:"result,omitempty"` - RecordedAt time.Time `protobuf:"bytes,3,opt,name=recorded_at,json=recordedAt,proto3,stdtime" json:"recorded_at" yaml:"recorded_at"` - ErrorMessage string `protobuf:"bytes,4,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` -} - -func (m *ExecutionResult) Reset() { *m = ExecutionResult{} } -func (m *ExecutionResult) String() string { return proto.CompactTextString(m) } -func (*ExecutionResult) ProtoMessage() {} -func (*ExecutionResult) Descriptor() ([]byte, []int) { - return fileDescriptor_429189f5158833e0, []int{6} -} -func (m *ExecutionResult) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ExecutionResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ExecutionResult.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 *ExecutionResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExecutionResult.Merge(m, src) -} -func (m *ExecutionResult) XXX_Size() int { - return m.Size() -} -func (m *ExecutionResult) XXX_DiscardUnknown() { - xxx_messageInfo_ExecutionResult.DiscardUnknown(m) -} - -var xxx_messageInfo_ExecutionResult proto.InternalMessageInfo - -func (m *ExecutionResult) GetOutput() *ProposedFact { - if m != nil { - return m.Output - } - return nil -} - -func (m *ExecutionResult) GetResult() ExecutionResultType { - if m != nil { - return m.Result - } - return ExecutionResultType_RESULT_TYPE_UNKNOWN -} - -func (m *ExecutionResult) GetRecordedAt() time.Time { - if m != nil { - return m.RecordedAt - } - return time.Time{} -} - -func (m *ExecutionResult) GetErrorMessage() string { - if m != nil { - return m.ErrorMessage - } - return "" -} - -func init() { - proto.RegisterEnum("contract.ExecutionResultType", ExecutionResultType_name, ExecutionResultType_value) - proto.RegisterType((*Recital)(nil), "contract.Recital") - proto.RegisterType((*Recitals)(nil), "contract.Recitals") - proto.RegisterType((*Contract)(nil), "contract.Contract") - proto.RegisterType((*Condition)(nil), "contract.Condition") - proto.RegisterType((*Consideration)(nil), "contract.Consideration") - proto.RegisterType((*ProposedFact)(nil), "contract.ProposedFact") - proto.RegisterType((*ExecutionResult)(nil), "contract.ExecutionResult") -} - -func init() { - proto.RegisterFile("provenance/metadata/v0/contract.proto", fileDescriptor_429189f5158833e0) -} - -var fileDescriptor_429189f5158833e0 = []byte{ - // 862 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x4d, 0x6f, 0xdb, 0x46, - 0x10, 0x15, 0x23, 0x47, 0x1f, 0x23, 0xdb, 0x95, 0xd7, 0x46, 0xc3, 0x18, 0x8d, 0xa4, 0x2a, 0x30, - 0x20, 0xb4, 0x30, 0xe5, 0xc8, 0xfd, 0x40, 0x03, 0x14, 0x81, 0x93, 0x3a, 0x40, 0xe0, 0xd4, 0x15, - 0x56, 0x0e, 0xfa, 0x75, 0x10, 0xd6, 0xe4, 0x98, 0x26, 0x4a, 0x71, 0xd9, 0xdd, 0x95, 0x10, 0xfd, - 0x87, 0x1e, 0x72, 0xe9, 0x0f, 0xe8, 0xbf, 0xc9, 0x31, 0xc7, 0x9e, 0xd2, 0xc2, 0x3e, 0xf7, 0xd2, - 0x63, 0x4f, 0x05, 0x97, 0x4b, 0x52, 0x32, 0xaa, 0x22, 0xb7, 0xdd, 0x37, 0x6f, 0xb8, 0x6f, 0xde, - 0x0c, 0x77, 0x61, 0x2f, 0x16, 0x7c, 0x86, 0x11, 0x8b, 0x5c, 0xec, 0x4f, 0x50, 0x31, 0x8f, 0x29, - 0xd6, 0x9f, 0x1d, 0xf4, 0x5d, 0x1e, 0x29, 0xc1, 0x5c, 0xe5, 0xc4, 0x82, 0x2b, 0x4e, 0x6a, 0xd9, - 0x7e, 0x77, 0xc7, 0xe7, 0x3e, 0xd7, 0x60, 0x3f, 0x59, 0xa5, 0xf1, 0xdd, 0x0f, 0x57, 0x7c, 0x46, - 0xc6, 0xe8, 0x1a, 0x4a, 0x77, 0x05, 0x45, 0xcd, 0x63, 0x94, 0x86, 0xd3, 0xf6, 0x39, 0xf7, 0x43, - 0xec, 0xeb, 0xdd, 0xf9, 0xf4, 0xa2, 0xaf, 0x82, 0x09, 0x4a, 0xc5, 0x26, 0x71, 0x4a, 0xe8, 0xfe, - 0x6a, 0x41, 0x95, 0xa2, 0x1b, 0x28, 0x16, 0x92, 0x07, 0xd0, 0x90, 0x81, 0x1f, 0xa1, 0x18, 0x0b, - 0x1e, 0xa2, 0x6d, 0x75, 0xac, 0xde, 0xe6, 0xa0, 0xe9, 0xa4, 0xdf, 0x1b, 0x32, 0xa1, 0xe6, 0x67, - 0xf3, 0x18, 0x29, 0xa4, 0x24, 0xca, 0x43, 0x24, 0x5f, 0x42, 0x25, 0xdd, 0xd9, 0xb7, 0x3a, 0x56, - 0xaf, 0x31, 0xd8, 0x33, 0xec, 0x51, 0xe0, 0x47, 0x41, 0xe4, 0x1f, 0x45, 0xde, 0x71, 0xe4, 0x8a, - 0x79, 0xac, 0x02, 0x1e, 0x0d, 0xa7, 0xe7, 0x61, 0xe0, 0x9e, 0xe0, 0x5c, 0x52, 0x93, 0x44, 0x6c, - 0xa8, 0x32, 0xcf, 0x13, 0x28, 0xa5, 0x5d, 0xee, 0x58, 0xbd, 0x75, 0x9a, 0x6d, 0xbb, 0x9f, 0x43, - 0xcd, 0xc8, 0x92, 0xe4, 0x63, 0xa8, 0xc6, 0x4c, 0xa8, 0x00, 0xa5, 0x6d, 0x75, 0xca, 0xbd, 0xc6, - 0x60, 0xcb, 0xc9, 0xdd, 0x34, 0x24, 0x9a, 0x31, 0xba, 0x7f, 0x95, 0xa1, 0xf6, 0xc4, 0x44, 0xc9, - 0x27, 0x00, 0x1e, 0x5e, 0x04, 0x51, 0x90, 0x9c, 0xaf, 0x0b, 0x6a, 0x0c, 0x76, 0x1c, 0xed, 0xe1, - 0x57, 0x39, 0x3e, 0x8a, 0xd1, 0xa5, 0x0b, 0x3c, 0xd2, 0x86, 0xb5, 0x84, 0x62, 0x4a, 0x6a, 0x98, - 0x92, 0x9e, 0x32, 0x57, 0x51, 0x1d, 0x20, 0x8f, 0xa0, 0x1a, 0x44, 0x33, 0xfe, 0x13, 0x0a, 0x2d, - 0xfb, 0x9d, 0xcb, 0xce, 0xb2, 0xc8, 0x7d, 0xa8, 0x04, 0x51, 0x3c, 0x55, 0xd2, 0x5e, 0xd3, 0x05, - 0x2d, 0x9d, 0x61, 0x42, 0xe4, 0x10, 0xc0, 0xe5, 0x91, 0xa7, 0x35, 0x49, 0xfb, 0xb6, 0x26, 0x6e, - 0x17, 0x95, 0x3f, 0xc9, 0x62, 0x74, 0x81, 0x46, 0x1e, 0xc1, 0xa6, 0xcb, 0x23, 0x19, 0x78, 0x28, - 0x58, 0x9a, 0x58, 0xd1, 0x89, 0x77, 0x96, 0x12, 0x8b, 0x38, 0xbd, 0x41, 0x27, 0xfb, 0x50, 0x13, - 0xc6, 0x78, 0xbb, 0xba, 0xca, 0xed, 0x9c, 0x42, 0xf6, 0x60, 0x53, 0x8f, 0xd4, 0x18, 0x5f, 0xa2, - 0x3b, 0x55, 0xe8, 0xd9, 0xb5, 0x8e, 0xd5, 0xbb, 0x4d, 0x37, 0x34, 0x7a, 0x6c, 0x40, 0xf2, 0x1d, - 0x80, 0x54, 0x4c, 0xa8, 0x71, 0x02, 0xdb, 0x75, 0x6d, 0xda, 0xae, 0x93, 0x0e, 0xa7, 0x93, 0x0d, - 0xa7, 0x73, 0x96, 0x0d, 0xe7, 0xe3, 0x7b, 0xaf, 0xdf, 0xb6, 0x4b, 0x7f, 0xbf, 0x6d, 0x6f, 0xcd, - 0xd9, 0x24, 0x7c, 0xd8, 0x2d, 0x72, 0xbb, 0xaf, 0xfe, 0x68, 0x5b, 0xb4, 0xae, 0x81, 0x84, 0xde, - 0x45, 0xa8, 0xe7, 0x4e, 0x24, 0x6a, 0x72, 0x2f, 0xc6, 0x11, 0x9b, 0xa4, 0x43, 0x5c, 0xa7, 0x1b, - 0x39, 0x7a, 0xca, 0x26, 0x48, 0x1e, 0x40, 0x45, 0xa0, 0x9c, 0x86, 0xca, 0xb4, 0xf8, 0x6e, 0x51, - 0x61, 0xaa, 0x38, 0x31, 0x46, 0x13, 0xa8, 0x21, 0x76, 0x7f, 0xb3, 0x60, 0x63, 0xc9, 0x38, 0xb2, - 0x0f, 0x64, 0xc9, 0xba, 0xc5, 0xf3, 0xb6, 0x96, 0x22, 0xfa, 0x4c, 0x27, 0x6f, 0xf9, 0x2d, 0xed, - 0xea, 0xfb, 0xc5, 0x99, 0x43, 0xc1, 0x63, 0x2e, 0xd1, 0x5b, 0xea, 0x7e, 0xa1, 0xb1, 0xfc, 0xae, - 0x1a, 0x7f, 0xb1, 0x60, 0x7d, 0xf1, 0x5b, 0x84, 0xc0, 0xda, 0x82, 0x28, 0xbd, 0x4e, 0xb0, 0x4b, - 0x26, 0x2f, 0x75, 0xe5, 0x75, 0xaa, 0xd7, 0xe4, 0x03, 0xa8, 0xbb, 0x21, 0x93, 0x52, 0x93, 0xcb, - 0x3a, 0x50, 0x00, 0xe4, 0x33, 0xa8, 0x25, 0x77, 0x8c, 0x54, 0x5c, 0xd8, 0x6b, 0xa6, 0x73, 0xe6, - 0x4e, 0xc8, 0x2f, 0x20, 0x8a, 0x17, 0x28, 0x30, 0x59, 0xe4, 0xdc, 0xee, 0x3f, 0x16, 0xbc, 0x77, - 0x43, 0x6a, 0xe2, 0x02, 0x9f, 0xaa, 0x78, 0xaa, 0xcc, 0xcf, 0xb8, 0xd2, 0x85, 0x94, 0x45, 0x3e, - 0x5d, 0xea, 0xd4, 0xe6, 0xe0, 0xde, 0x4a, 0x17, 0xf4, 0xd5, 0x64, 0xc8, 0xe4, 0x47, 0x68, 0x08, - 0x74, 0xb9, 0xf0, 0xd0, 0x1b, 0xb3, 0xcc, 0xc1, 0xff, 0x9b, 0xb7, 0x96, 0x99, 0x37, 0x92, 0xce, - 0xdb, 0x42, 0x72, 0x3a, 0x70, 0x90, 0x21, 0x47, 0x8a, 0xdc, 0x87, 0x0d, 0x14, 0x82, 0x8b, 0xf1, - 0x04, 0xa5, 0x64, 0x3e, 0x6a, 0x53, 0xea, 0x74, 0x5d, 0x83, 0x5f, 0xa7, 0xd8, 0x47, 0x31, 0x6c, - 0xff, 0x87, 0x40, 0x72, 0x07, 0xb6, 0xe9, 0xf1, 0xe8, 0xc5, 0xf3, 0xb3, 0xf1, 0xd9, 0xf7, 0xc3, - 0xe3, 0xf1, 0x8b, 0xd3, 0x93, 0xd3, 0x6f, 0xbe, 0x3d, 0x6d, 0x96, 0xc8, 0x0e, 0x34, 0x17, 0x03, - 0xc3, 0xa3, 0xd1, 0xa8, 0x69, 0xdd, 0x44, 0x47, 0x27, 0xcf, 0x86, 0xcd, 0x5b, 0x37, 0xd1, 0xa7, - 0x47, 0xcf, 0x9e, 0x37, 0xcb, 0x8f, 0x7f, 0x7e, 0x7d, 0xd5, 0xb2, 0xde, 0x5c, 0xb5, 0xac, 0x3f, - 0xaf, 0x5a, 0xd6, 0xab, 0xeb, 0x56, 0xe9, 0xcd, 0x75, 0xab, 0xf4, 0xfb, 0x75, 0xab, 0x04, 0x77, - 0x03, 0xfd, 0xaa, 0x98, 0x56, 0x39, 0xd9, 0x5b, 0xe1, 0xcc, 0x0e, 0x86, 0xd6, 0x0f, 0x0f, 0xfd, - 0x40, 0x5d, 0x4e, 0xcf, 0x1d, 0x97, 0x4f, 0xfa, 0x05, 0x69, 0x3f, 0xe0, 0x0b, 0xbb, 0xfe, 0xcb, - 0xe2, 0x81, 0x09, 0xd1, 0x67, 0xee, 0xbc, 0x3f, 0x3b, 0x38, 0xfc, 0xe2, 0xbc, 0xa2, 0x9d, 0x3c, - 0xfc, 0x37, 0x00, 0x00, 0xff, 0xff, 0xaf, 0x1e, 0x14, 0xce, 0xf4, 0x06, 0x00, 0x00, -} - -func (m *Recital) 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 *Recital) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Recital) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintContract(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0x1a - } - if m.Signer != nil { - { - size, err := m.Signer.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintContract(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.SignerRole != 0 { - i = encodeVarintContract(dAtA, i, uint64(m.SignerRole)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Recitals) 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 *Recitals) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Recitals) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Parties) > 0 { - for iNdEx := len(m.Parties) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Parties[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintContract(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *Contract) 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 *Contract) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Contract) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintContract(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x4a - if m.TimesExecuted != 0 { - i = encodeVarintContract(dAtA, i, uint64(m.TimesExecuted)) - i-- - dAtA[i] = 0x40 - } - if len(m.Recitals) > 0 { - for iNdEx := len(m.Recitals) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Recitals[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintContract(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - } - if len(m.Considerations) > 0 { - for iNdEx := len(m.Considerations) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Considerations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintContract(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } - if len(m.Conditions) > 0 { - for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Conditions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintContract(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.Inputs) > 0 { - for iNdEx := len(m.Inputs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Inputs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintContract(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.Invoker != nil { - { - size, err := m.Invoker.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintContract(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.Spec != nil { - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintContract(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Definition != nil { - { - size, err := m.Definition.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintContract(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Condition) 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 *Condition) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Condition) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Result != nil { - { - size, err := m.Result.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintContract(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.ConditionName) > 0 { - i -= len(m.ConditionName) - copy(dAtA[i:], m.ConditionName) - i = encodeVarintContract(dAtA, i, uint64(len(m.ConditionName))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Consideration) 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 *Consideration) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Consideration) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Result != nil { - { - size, err := m.Result.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintContract(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Inputs) > 0 { - for iNdEx := len(m.Inputs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Inputs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintContract(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.ConsiderationName) > 0 { - i -= len(m.ConsiderationName) - copy(dAtA[i:], m.ConsiderationName) - i = encodeVarintContract(dAtA, i, uint64(len(m.ConsiderationName))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ProposedFact) 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 *ProposedFact) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProposedFact) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Ancestor != nil { - { - size, err := m.Ancestor.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintContract(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if len(m.Classname) > 0 { - i -= len(m.Classname) - copy(dAtA[i:], m.Classname) - i = encodeVarintContract(dAtA, i, uint64(len(m.Classname))) - i-- - dAtA[i] = 0x1a - } - if len(m.Hash) > 0 { - i -= len(m.Hash) - copy(dAtA[i:], m.Hash) - i = encodeVarintContract(dAtA, i, uint64(len(m.Hash))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintContract(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ExecutionResult) 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 *ExecutionResult) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ExecutionResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ErrorMessage) > 0 { - i -= len(m.ErrorMessage) - copy(dAtA[i:], m.ErrorMessage) - i = encodeVarintContract(dAtA, i, uint64(len(m.ErrorMessage))) - i-- - dAtA[i] = 0x22 - } - n9, err9 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.RecordedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.RecordedAt):]) - if err9 != nil { - return 0, err9 - } - i -= n9 - i = encodeVarintContract(dAtA, i, uint64(n9)) - i-- - dAtA[i] = 0x1a - if m.Result != 0 { - i = encodeVarintContract(dAtA, i, uint64(m.Result)) - i-- - dAtA[i] = 0x10 - } - if m.Output != nil { - { - size, err := m.Output.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintContract(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintContract(dAtA []byte, offset int, v uint64) int { - offset -= sovContract(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Recital) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.SignerRole != 0 { - n += 1 + sovContract(uint64(m.SignerRole)) - } - if m.Signer != nil { - l = m.Signer.Size() - n += 1 + l + sovContract(uint64(l)) - } - l = len(m.Address) - if l > 0 { - n += 1 + l + sovContract(uint64(l)) - } - return n -} - -func (m *Recitals) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Parties) > 0 { - for _, e := range m.Parties { - l = e.Size() - n += 1 + l + sovContract(uint64(l)) - } - } - return n -} - -func (m *Contract) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Definition != nil { - l = m.Definition.Size() - n += 1 + l + sovContract(uint64(l)) - } - if m.Spec != nil { - l = m.Spec.Size() - n += 1 + l + sovContract(uint64(l)) - } - if m.Invoker != nil { - l = m.Invoker.Size() - n += 1 + l + sovContract(uint64(l)) - } - if len(m.Inputs) > 0 { - for _, e := range m.Inputs { - l = e.Size() - n += 1 + l + sovContract(uint64(l)) - } - } - if len(m.Conditions) > 0 { - for _, e := range m.Conditions { - l = e.Size() - n += 1 + l + sovContract(uint64(l)) - } - } - if len(m.Considerations) > 0 { - for _, e := range m.Considerations { - l = e.Size() - n += 1 + l + sovContract(uint64(l)) - } - } - if len(m.Recitals) > 0 { - for _, e := range m.Recitals { - l = e.Size() - n += 1 + l + sovContract(uint64(l)) - } - } - if m.TimesExecuted != 0 { - n += 1 + sovContract(uint64(m.TimesExecuted)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime) - n += 1 + l + sovContract(uint64(l)) - return n -} - -func (m *Condition) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ConditionName) - if l > 0 { - n += 1 + l + sovContract(uint64(l)) - } - if m.Result != nil { - l = m.Result.Size() - n += 1 + l + sovContract(uint64(l)) - } - return n -} - -func (m *Consideration) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ConsiderationName) - if l > 0 { - n += 1 + l + sovContract(uint64(l)) - } - if len(m.Inputs) > 0 { - for _, e := range m.Inputs { - l = e.Size() - n += 1 + l + sovContract(uint64(l)) - } - } - if m.Result != nil { - l = m.Result.Size() - n += 1 + l + sovContract(uint64(l)) - } - return n -} - -func (m *ProposedFact) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovContract(uint64(l)) - } - l = len(m.Hash) - if l > 0 { - n += 1 + l + sovContract(uint64(l)) - } - l = len(m.Classname) - if l > 0 { - n += 1 + l + sovContract(uint64(l)) - } - if m.Ancestor != nil { - l = m.Ancestor.Size() - n += 1 + l + sovContract(uint64(l)) - } - return n -} - -func (m *ExecutionResult) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Output != nil { - l = m.Output.Size() - n += 1 + l + sovContract(uint64(l)) - } - if m.Result != 0 { - n += 1 + sovContract(uint64(m.Result)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.RecordedAt) - n += 1 + l + sovContract(uint64(l)) - l = len(m.ErrorMessage) - if l > 0 { - n += 1 + l + sovContract(uint64(l)) - } - return n -} - -func sovContract(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozContract(x uint64) (n int) { - return sovContract(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Recital) 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 ErrIntOverflowContract - } - 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: Recital: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Recital: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SignerRole", wireType) - } - m.SignerRole = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SignerRole |= PartyType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContract - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Signer == nil { - m.Signer = &SigningAndEncryptionPublicKeys{} - } - if err := m.Signer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthContract - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = append(m.Address[:0], dAtA[iNdEx:postIndex]...) - if m.Address == nil { - m.Address = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipContract(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthContract - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Recitals) 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 ErrIntOverflowContract - } - 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: Recitals: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Recitals: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Parties", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContract - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Parties = append(m.Parties, &Recital{}) - if err := m.Parties[len(m.Parties)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipContract(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthContract - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Contract) 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 ErrIntOverflowContract - } - 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: Contract: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Contract: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Definition", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContract - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Definition == nil { - m.Definition = &DefinitionSpec{} - } - if err := m.Definition.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContract - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Spec == nil { - m.Spec = &Fact{} - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Invoker", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContract - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Invoker == nil { - m.Invoker = &SigningAndEncryptionPublicKeys{} - } - if err := m.Invoker.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Inputs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContract - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Inputs = append(m.Inputs, &Fact{}) - if err := m.Inputs[len(m.Inputs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContract - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Conditions = append(m.Conditions, &Condition{}) - if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Considerations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContract - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Considerations = append(m.Considerations, &Consideration{}) - if err := m.Considerations[len(m.Considerations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Recitals", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContract - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Recitals = append(m.Recitals, &Recital{}) - if err := m.Recitals[len(m.Recitals)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TimesExecuted", wireType) - } - m.TimesExecuted = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TimesExecuted |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContract - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.StartTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipContract(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthContract - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Condition) 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 ErrIntOverflowContract - } - 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: Condition: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Condition: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConditionName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - 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 ErrInvalidLengthContract - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConditionName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContract - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Result == nil { - m.Result = &ExecutionResult{} - } - if err := m.Result.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipContract(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthContract - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Consideration) 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 ErrIntOverflowContract - } - 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: Consideration: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Consideration: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsiderationName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - 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 ErrInvalidLengthContract - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConsiderationName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Inputs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContract - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Inputs = append(m.Inputs, &ProposedFact{}) - if err := m.Inputs[len(m.Inputs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContract - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Result == nil { - m.Result = &ExecutionResult{} - } - if err := m.Result.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipContract(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthContract - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProposedFact) 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 ErrIntOverflowContract - } - 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: ProposedFact: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProposedFact: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - 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 ErrInvalidLengthContract - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - 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 ErrInvalidLengthContract - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Hash = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Classname", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - 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 ErrInvalidLengthContract - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Classname = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ancestor", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContract - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Ancestor == nil { - m.Ancestor = &ProvenanceReference{} - } - if err := m.Ancestor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipContract(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthContract - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ExecutionResult) 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 ErrIntOverflowContract - } - 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: ExecutionResult: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ExecutionResult: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Output", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContract - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Output == nil { - m.Output = &ProposedFact{} - } - if err := m.Output.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) - } - m.Result = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Result |= ExecutionResultType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RecordedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContract - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.RecordedAt, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ErrorMessage", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowContract - } - 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 ErrInvalidLengthContract - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthContract - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ErrorMessage = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipContract(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthContract - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipContract(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, ErrIntOverflowContract - } - 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, ErrIntOverflowContract - } - 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, ErrIntOverflowContract - } - 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, ErrInvalidLengthContract - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupContract - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthContract - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthContract = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowContract = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupContract = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/metadata/legacy/v039/crypto.go b/x/metadata/legacy/v039/crypto.go deleted file mode 100644 index 3dd6eb8a48..0000000000 --- a/x/metadata/legacy/v039/crypto.go +++ /dev/null @@ -1,34 +0,0 @@ -package v039 - -import ( - "github.com/btcsuite/btcd/btcec" - sdk "github.com/cosmos/cosmos-sdk/types" - tmcrypt "github.com/tendermint/tendermint/crypto" - tmcurve "github.com/tendermint/tendermint/crypto/secp256k1" -) - -// RecoverPublicKey recovers a tendermint secp256k1 public key from a signtaure and message hash. -func RecoverPublicKey(sig, hash []byte) (tmcrypt.PubKey, sdk.AccAddress, error) { - // Recover public key - pubKey, _, err := btcec.RecoverCompact(btcec.S256(), sig, hash) - if err != nil { - return nil, nil, err - } - // Create tendermint public key type and return with address. - tmKey := tmcurve.PubKey{} // .PubKeySecp256k1{} - copy(tmKey[:], pubKey.SerializeCompressed()) - return tmKey, tmKey.Address().Bytes(), nil -} - -// ParsePublicKey parses a secp256k1 public key, calculates the account address, and returns both. -func ParsePublicKey(data []byte) (tmcrypt.PubKey, sdk.AccAddress, error) { - // Parse the secp256k1 public key. - pk, err := btcec.ParsePubKey(data, btcec.S256()) - if err != nil { - return nil, nil, err - } - // Create tendermint public key type and return with address. - tmKey := tmcurve.PubKey(pk.SerializeCompressed()) // PubKeySecp256k1{} - - return tmKey, tmKey.Address().Bytes(), nil -} diff --git a/x/metadata/legacy/v039/query.pb.go b/x/metadata/legacy/v039/query.pb.go deleted file mode 100644 index 3a5ee38299..0000000000 --- a/x/metadata/legacy/v039/query.pb.go +++ /dev/null @@ -1,589 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: provenance/metadata/v0/query.proto - -package v039 - -import ( - context "context" - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - 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 - -// ScopeRequest is used for requesting a scope by id -type ScopeRequest struct { - ScopeId string `protobuf:"bytes,1,opt,name=scope_id,json=scopeId,proto3" json:"scope_id,omitempty"` -} - -func (m *ScopeRequest) Reset() { *m = ScopeRequest{} } -func (m *ScopeRequest) String() string { return proto.CompactTextString(m) } -func (*ScopeRequest) ProtoMessage() {} -func (*ScopeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9cabc8b9c0b31b6f, []int{0} -} -func (m *ScopeRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ScopeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ScopeRequest.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 *ScopeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ScopeRequest.Merge(m, src) -} -func (m *ScopeRequest) XXX_Size() int { - return m.Size() -} -func (m *ScopeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ScopeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ScopeRequest proto.InternalMessageInfo - -func (m *ScopeRequest) GetScopeId() string { - if m != nil { - return m.ScopeId - } - return "" -} - -// ScopeResponse is the response to a scope request. -type ScopeResponse struct { - Scope Scope `protobuf:"bytes,1,opt,name=scope,proto3" json:"scope"` -} - -func (m *ScopeResponse) Reset() { *m = ScopeResponse{} } -func (m *ScopeResponse) String() string { return proto.CompactTextString(m) } -func (*ScopeResponse) ProtoMessage() {} -func (*ScopeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9cabc8b9c0b31b6f, []int{1} -} -func (m *ScopeResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ScopeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ScopeResponse.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 *ScopeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ScopeResponse.Merge(m, src) -} -func (m *ScopeResponse) XXX_Size() int { - return m.Size() -} -func (m *ScopeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ScopeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ScopeResponse proto.InternalMessageInfo - -func (m *ScopeResponse) GetScope() Scope { - if m != nil { - return m.Scope - } - return Scope{} -} - -func init() { - proto.RegisterType((*ScopeRequest)(nil), "query.ScopeRequest") - proto.RegisterType((*ScopeResponse)(nil), "query.ScopeResponse") -} - -func init() { - proto.RegisterFile("provenance/metadata/v0/query.proto", fileDescriptor_9cabc8b9c0b31b6f) -} - -var fileDescriptor_9cabc8b9c0b31b6f = []byte{ - // 311 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2a, 0x28, 0xca, 0x2f, - 0x4b, 0xcd, 0x4b, 0xcc, 0x4b, 0x4e, 0xd5, 0xcf, 0x4d, 0x2d, 0x49, 0x4c, 0x49, 0x2c, 0x49, 0xd4, - 0x2f, 0x33, 0xd0, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, - 0x05, 0x73, 0xa4, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x22, 0xfa, 0x20, 0x16, 0x44, 0x52, 0x4a, - 0x26, 0x3d, 0x3f, 0x3f, 0x3d, 0x27, 0x55, 0x3f, 0xb1, 0x20, 0x53, 0x3f, 0x31, 0x2f, 0x2f, 0xbf, - 0x24, 0xb1, 0x24, 0x33, 0x3f, 0xaf, 0x18, 0x2a, 0x8b, 0xcb, 0xf8, 0xe2, 0xe4, 0xfc, 0x82, 0x54, - 0x88, 0x1a, 0x25, 0x4d, 0x2e, 0x9e, 0x60, 0x10, 0x37, 0x28, 0xb5, 0xb0, 0x34, 0xb5, 0xb8, 0x44, - 0x48, 0x92, 0x8b, 0x03, 0x2c, 0x1d, 0x9f, 0x99, 0x22, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x19, 0xc4, - 0x0e, 0xe6, 0x7b, 0xa6, 0x28, 0x59, 0x72, 0xf1, 0x42, 0x95, 0x16, 0x17, 0xe4, 0xe7, 0x15, 0xa7, - 0x0a, 0x69, 0x70, 0xb1, 0x82, 0xe5, 0xc0, 0x0a, 0xb9, 0x8d, 0x78, 0xf4, 0x20, 0x06, 0x83, 0x15, - 0x39, 0xb1, 0x9c, 0xb8, 0x27, 0xcf, 0x10, 0x04, 0x51, 0x60, 0x94, 0xcb, 0xc5, 0x1a, 0x08, 0xf2, - 0x86, 0x50, 0x0a, 0x17, 0x2b, 0x58, 0x5a, 0x48, 0x58, 0x0f, 0xe2, 0x49, 0x64, 0xcb, 0xa5, 0x44, - 0x50, 0x05, 0x21, 0xd6, 0x28, 0x19, 0x34, 0x5d, 0x7e, 0x32, 0x99, 0x49, 0x4b, 0x48, 0x43, 0x1f, - 0x9f, 0x7f, 0xf4, 0xab, 0x61, 0xee, 0xae, 0x75, 0x2a, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, - 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, - 0x63, 0x39, 0x06, 0x2e, 0xc9, 0x4c, 0x70, 0xd0, 0x41, 0x4d, 0xd1, 0x83, 0x99, 0xa2, 0x57, 0x66, - 0x10, 0xc0, 0x18, 0x65, 0x95, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0x8b, 0x64, - 0x95, 0x6e, 0x66, 0x3e, 0xb2, 0xc5, 0x15, 0x08, 0xab, 0x73, 0x52, 0xd3, 0x13, 0x93, 0x2b, 0xf5, - 0xcb, 0x0c, 0x8c, 0x2d, 0x93, 0xd8, 0xc0, 0xc1, 0x69, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x7f, - 0x87, 0xa3, 0xc2, 0xd3, 0x01, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type QueryClient interface { - // Scope returns a specific scope by id - Scope(ctx context.Context, in *ScopeRequest, opts ...grpc.CallOption) (*ScopeResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Scope(ctx context.Context, in *ScopeRequest, opts ...grpc.CallOption) (*ScopeResponse, error) { - out := new(ScopeResponse) - err := c.cc.Invoke(ctx, "/query.Query/Scope", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // Scope returns a specific scope by id - Scope(context.Context, *ScopeRequest) (*ScopeResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) Scope(ctx context.Context, req *ScopeRequest) (*ScopeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Scope not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -func _Query_Scope_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ScopeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Scope(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/query.Query/Scope", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Scope(ctx, req.(*ScopeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "query.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Scope", - Handler: _Query_Scope_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "provenance/metadata/v0/query.proto", -} - -func (m *ScopeRequest) 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 *ScopeRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ScopeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ScopeId) > 0 { - i -= len(m.ScopeId) - copy(dAtA[i:], m.ScopeId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ScopeId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ScopeResponse) 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 *ScopeResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ScopeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Scope.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 encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *ScopeRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ScopeId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *ScopeResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Scope.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *ScopeRequest) 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: ScopeRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ScopeRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ScopeId", 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.ScopeId = string(dAtA[iNdEx:postIndex]) - 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 *ScopeResponse) 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: ScopeResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ScopeResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Scope", 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 err := m.Scope.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - 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 skipQuery(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, ErrIntOverflowQuery - } - 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, ErrIntOverflowQuery - } - 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, ErrIntOverflowQuery - } - 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, ErrInvalidLengthQuery - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupQuery - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/metadata/legacy/v039/query.pb.gw.go b/x/metadata/legacy/v039/query.pb.gw.go deleted file mode 100644 index 1db8fb3cb4..0000000000 --- a/x/metadata/legacy/v039/query.pb.gw.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: provenance/metadata/v0/query.proto - -/* -Package v039 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package v039 - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage - -func request_Query_Scope_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ScopeRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["scope_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "scope_id") - } - - protoReq.ScopeId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "scope_id", err) - } - - msg, err := client.Scope(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Scope_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ScopeRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["scope_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "scope_id") - } - - protoReq.ScopeId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "scope_id", err) - } - - msg, err := server.Scope(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Scope_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Scope_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Scope_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_Scope_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Scope_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Scope_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Scope_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"provenance", "metadata", "v0", "scope", "scope_id"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Scope_0 = runtime.ForwardResponseMessage -) diff --git a/x/metadata/legacy/v039/scope.pb.go b/x/metadata/legacy/v039/scope.pb.go deleted file mode 100644 index f51270a1e5..0000000000 --- a/x/metadata/legacy/v039/scope.pb.go +++ /dev/null @@ -1,2338 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: provenance/metadata/v0/scope.proto - -package v039 - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - _ "google.golang.org/protobuf/types/descriptorpb" - 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 - -// RecordInputType indicates if an input is data on or off chain. -type RecordInputType int32 - -const ( - // invalid status - RecordInputType_RECORD_INPUT_TYPE_UNKNOWN RecordInputType = 0 - // input is proposed data for recording to the blockchain - RecordInputType_RECORD_INPUT_TYPE_PROPOSED RecordInputType = 1 - // input is a data element referencing an existing scope/record on chain - RecordInputType_RECORD_INPUT_TYPE_FACT RecordInputType = 2 -) - -var RecordInputType_name = map[int32]string{ - 0: "RECORD_INPUT_TYPE_UNKNOWN", - 1: "RECORD_INPUT_TYPE_PROPOSED", - 2: "RECORD_INPUT_TYPE_FACT", -} - -var RecordInputType_value = map[string]int32{ - "RECORD_INPUT_TYPE_UNKNOWN": 0, - "RECORD_INPUT_TYPE_PROPOSED": 1, - "RECORD_INPUT_TYPE_FACT": 2, -} - -func (x RecordInputType) String() string { - return proto.EnumName(RecordInputType_name, int32(x)) -} - -func (RecordInputType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_430f1e4495b31692, []int{0} -} - -// Event references in relation to scope -type Event struct { - GroupUuid *UUID `protobuf:"bytes,1,opt,name=group_uuid,json=groupUuid,proto3" json:"group_uuid,omitempty"` - ExecutionUuid *UUID `protobuf:"bytes,2,opt,name=execution_uuid,json=executionUuid,proto3" json:"execution_uuid,omitempty"` -} - -func (m *Event) Reset() { *m = Event{} } -func (m *Event) String() string { return proto.CompactTextString(m) } -func (*Event) ProtoMessage() {} -func (*Event) Descriptor() ([]byte, []int) { - return fileDescriptor_430f1e4495b31692, []int{0} -} -func (m *Event) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Event.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 *Event) XXX_Merge(src proto.Message) { - xxx_messageInfo_Event.Merge(m, src) -} -func (m *Event) XXX_Size() int { - return m.Size() -} -func (m *Event) XXX_DiscardUnknown() { - xxx_messageInfo_Event.DiscardUnknown(m) -} - -var xxx_messageInfo_Event proto.InternalMessageInfo - -func (m *Event) GetGroupUuid() *UUID { - if m != nil { - return m.GroupUuid - } - return nil -} - -func (m *Event) GetExecutionUuid() *UUID { - if m != nil { - return m.ExecutionUuid - } - return nil -} - -// A ContractScope is a context that binds multiple p8e working together to create a set of facts managed a defined -// set of affiliates. -type Scope struct { - // Unique ID for building up ProvenanceReferences - Uuid *UUID `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` - // Required parties on this scope. These are union with any contract specific recital requirements - Parties []*Recital `protobuf:"bytes,2,rep,name=parties,proto3" json:"parties,omitempty"` - // Each contract memorialized in this scope is stored in this list of contract_group. The list of groups is keyed - // as a hashmap based on the contract_spec_ref as a unique key. - RecordGroup []*RecordGroup `protobuf:"bytes,3,rep,name=record_group,json=recordGroup,proto3" json:"record_group,omitempty"` - // Last event that resulted in scope changes. - LastEvent *Event `protobuf:"bytes,4,opt,name=last_event,json=lastEvent,proto3" json:"last_event,omitempty"` -} - -func (m *Scope) Reset() { *m = Scope{} } -func (m *Scope) String() string { return proto.CompactTextString(m) } -func (*Scope) ProtoMessage() {} -func (*Scope) Descriptor() ([]byte, []int) { - return fileDescriptor_430f1e4495b31692, []int{1} -} -func (m *Scope) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Scope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Scope.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 *Scope) XXX_Merge(src proto.Message) { - xxx_messageInfo_Scope.Merge(m, src) -} -func (m *Scope) XXX_Size() int { - return m.Size() -} -func (m *Scope) XXX_DiscardUnknown() { - xxx_messageInfo_Scope.DiscardUnknown(m) -} - -var xxx_messageInfo_Scope proto.InternalMessageInfo - -func (m *Scope) GetUuid() *UUID { - if m != nil { - return m.Uuid - } - return nil -} - -func (m *Scope) GetParties() []*Recital { - if m != nil { - return m.Parties - } - return nil -} - -func (m *Scope) GetRecordGroup() []*RecordGroup { - if m != nil { - return m.RecordGroup - } - return nil -} - -func (m *Scope) GetLastEvent() *Event { - if m != nil { - return m.LastEvent - } - return nil -} - -// A collection wrapper around scopes -type ScopeCollection struct { - Scopes []*Scope `protobuf:"bytes,1,rep,name=scopes,proto3" json:"scopes,omitempty"` -} - -func (m *ScopeCollection) Reset() { *m = ScopeCollection{} } -func (m *ScopeCollection) String() string { return proto.CompactTextString(m) } -func (*ScopeCollection) ProtoMessage() {} -func (*ScopeCollection) Descriptor() ([]byte, []int) { - return fileDescriptor_430f1e4495b31692, []int{2} -} -func (m *ScopeCollection) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ScopeCollection) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ScopeCollection.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 *ScopeCollection) XXX_Merge(src proto.Message) { - xxx_messageInfo_ScopeCollection.Merge(m, src) -} -func (m *ScopeCollection) XXX_Size() int { - return m.Size() -} -func (m *ScopeCollection) XXX_DiscardUnknown() { - xxx_messageInfo_ScopeCollection.DiscardUnknown(m) -} - -var xxx_messageInfo_ScopeCollection proto.InternalMessageInfo - -func (m *ScopeCollection) GetScopes() []*Scope { - if m != nil { - return m.Scopes - } - return nil -} - -// An record group is created for each contract memorialized against a scope. This tracks who controls each record for -// future use. -type RecordGroup struct { - // contract.spec.data_location.hash -- the specific contract specification that was used to create this group. - Specification string `protobuf:"bytes,1,opt,name=specification,proto3" json:"specification,omitempty"` - // Unique ID for building up ProvenanceReferences. Set to the value on of group_uuid on the incoming contract ref. - GroupUuid *UUID `protobuf:"bytes,2,opt,name=group_uuid,json=groupUuid,proto3" json:"group_uuid,omitempty"` - // Identity that is memorializing this contract - Executor *SigningAndEncryptionPublicKeys `protobuf:"bytes,3,opt,name=executor,proto3" json:"executor,omitempty"` - // Set of identities that signed this contract - Parties []*Recital `protobuf:"bytes,4,rep,name=parties,proto3" json:"parties,omitempty"` - // Accumulated records (of fact) resulting from Considerations - Records []*Record `protobuf:"bytes,5,rep,name=records,proto3" json:"records,omitempty"` - // name of the class associated with this record group specification - Classname string `protobuf:"bytes,6,opt,name=classname,proto3" json:"classname,omitempty"` - // Created by, updated by, timestamps, version number, and related info. - Audit *AuditFields `protobuf:"bytes,99,opt,name=audit,proto3" json:"audit,omitempty"` -} - -func (m *RecordGroup) Reset() { *m = RecordGroup{} } -func (m *RecordGroup) String() string { return proto.CompactTextString(m) } -func (*RecordGroup) ProtoMessage() {} -func (*RecordGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_430f1e4495b31692, []int{3} -} -func (m *RecordGroup) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RecordGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RecordGroup.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 *RecordGroup) XXX_Merge(src proto.Message) { - xxx_messageInfo_RecordGroup.Merge(m, src) -} -func (m *RecordGroup) XXX_Size() int { - return m.Size() -} -func (m *RecordGroup) XXX_DiscardUnknown() { - xxx_messageInfo_RecordGroup.DiscardUnknown(m) -} - -var xxx_messageInfo_RecordGroup proto.InternalMessageInfo - -func (m *RecordGroup) GetSpecification() string { - if m != nil { - return m.Specification - } - return "" -} - -func (m *RecordGroup) GetGroupUuid() *UUID { - if m != nil { - return m.GroupUuid - } - return nil -} - -func (m *RecordGroup) GetExecutor() *SigningAndEncryptionPublicKeys { - if m != nil { - return m.Executor - } - return nil -} - -func (m *RecordGroup) GetParties() []*Recital { - if m != nil { - return m.Parties - } - return nil -} - -func (m *RecordGroup) GetRecords() []*Record { - if m != nil { - return m.Records - } - return nil -} - -func (m *RecordGroup) GetClassname() string { - if m != nil { - return m.Classname - } - return "" -} - -func (m *RecordGroup) GetAudit() *AuditFields { - if m != nil { - return m.Audit - } - return nil -} - -// A record (of fact) is attached to an group or each consideration output from a contract. -type Record struct { - // ConsiderationSpec.func_name <--> ConsiderationProto.consideration_name (method on the classname below that - // generated this) - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // ConsiderationSpec.outputSpec.spec.resourceLocation.ref.hash (this is the hash of the consideration which generated - // the record, see also result_hash) - Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` - // ContractSpec.definition.resourceLocation.classname (class that contains the method 'name' as given above) - Classname string `protobuf:"bytes,3,opt,name=classname,proto3" json:"classname,omitempty"` - // ConsiderationProto.inputs for reference with ConsiderationSpec.input_spec for type - Inputs []*RecordInput `protobuf:"bytes,4,rep,name=inputs,proto3" json:"inputs,omitempty"` - // ConsiderationProto.result.result (indicates SKIP [not allowed], PASS, or FAIL result) - Result ExecutionResultType `protobuf:"varint,5,opt,name=result,proto3,enum=contract.ExecutionResultType" json:"result,omitempty"` - // ConsiderationProto.result.output.name - ResultName string `protobuf:"bytes,6,opt,name=result_name,json=resultName,proto3" json:"result_name,omitempty"` - // ConsiderationProto.result.output.hash (the hash of the data output from the consideration) - ResultHash string `protobuf:"bytes,7,opt,name=result_hash,json=resultHash,proto3" json:"result_hash,omitempty"` -} - -func (m *Record) Reset() { *m = Record{} } -func (m *Record) String() string { return proto.CompactTextString(m) } -func (*Record) ProtoMessage() {} -func (*Record) Descriptor() ([]byte, []int) { - return fileDescriptor_430f1e4495b31692, []int{4} -} -func (m *Record) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Record) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Record.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 *Record) XXX_Merge(src proto.Message) { - xxx_messageInfo_Record.Merge(m, src) -} -func (m *Record) XXX_Size() int { - return m.Size() -} -func (m *Record) XXX_DiscardUnknown() { - xxx_messageInfo_Record.DiscardUnknown(m) -} - -var xxx_messageInfo_Record proto.InternalMessageInfo - -func (m *Record) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Record) GetHash() string { - if m != nil { - return m.Hash - } - return "" -} - -func (m *Record) GetClassname() string { - if m != nil { - return m.Classname - } - return "" -} - -func (m *Record) GetInputs() []*RecordInput { - if m != nil { - return m.Inputs - } - return nil -} - -func (m *Record) GetResult() ExecutionResultType { - if m != nil { - return m.Result - } - return ExecutionResultType_RESULT_TYPE_UNKNOWN -} - -func (m *Record) GetResultName() string { - if m != nil { - return m.ResultName - } - return "" -} - -func (m *Record) GetResultHash() string { - if m != nil { - return m.ResultHash - } - return "" -} - -// Tracks the inputs used with a Consideration to establish the output record. -// FACT references must have come from the input fact list. -// For proposed we will only have the hash -type RecordInput struct { - // Name value included to link back to the definition spec. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // For proposed facts we only have the hash ... for facts this hash maps to something in the input list. - Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` - // from proposed fact structure to unmarshal - Classname string `protobuf:"bytes,3,opt,name=classname,proto3" json:"classname,omitempty"` - // Indicates if this input was a recorded fact on chain or just a given hashed input - Type RecordInputType `protobuf:"varint,4,opt,name=type,proto3,enum=scope.RecordInputType" json:"type,omitempty"` -} - -func (m *RecordInput) Reset() { *m = RecordInput{} } -func (m *RecordInput) String() string { return proto.CompactTextString(m) } -func (*RecordInput) ProtoMessage() {} -func (*RecordInput) Descriptor() ([]byte, []int) { - return fileDescriptor_430f1e4495b31692, []int{5} -} -func (m *RecordInput) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RecordInput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RecordInput.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 *RecordInput) XXX_Merge(src proto.Message) { - xxx_messageInfo_RecordInput.Merge(m, src) -} -func (m *RecordInput) XXX_Size() int { - return m.Size() -} -func (m *RecordInput) XXX_DiscardUnknown() { - xxx_messageInfo_RecordInput.DiscardUnknown(m) -} - -var xxx_messageInfo_RecordInput proto.InternalMessageInfo - -func (m *RecordInput) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *RecordInput) GetHash() string { - if m != nil { - return m.Hash - } - return "" -} - -func (m *RecordInput) GetClassname() string { - if m != nil { - return m.Classname - } - return "" -} - -func (m *RecordInput) GetType() RecordInputType { - if m != nil { - return m.Type - } - return RecordInputType_RECORD_INPUT_TYPE_UNKNOWN -} - -func init() { - proto.RegisterEnum("scope.RecordInputType", RecordInputType_name, RecordInputType_value) - proto.RegisterType((*Event)(nil), "scope.Event") - proto.RegisterType((*Scope)(nil), "scope.Scope") - proto.RegisterType((*ScopeCollection)(nil), "scope.ScopeCollection") - proto.RegisterType((*RecordGroup)(nil), "scope.RecordGroup") - proto.RegisterType((*Record)(nil), "scope.Record") - proto.RegisterType((*RecordInput)(nil), "scope.RecordInput") -} - -func init() { - proto.RegisterFile("provenance/metadata/v0/scope.proto", fileDescriptor_430f1e4495b31692) -} - -var fileDescriptor_430f1e4495b31692 = []byte{ - // 705 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0xcf, 0x4e, 0xdb, 0x4a, - 0x14, 0xc6, 0xe3, 0xfc, 0xe3, 0xe6, 0x84, 0x7f, 0x77, 0x16, 0xc8, 0x44, 0x97, 0x10, 0x45, 0xa0, - 0x1b, 0x81, 0xae, 0x8d, 0x82, 0xd0, 0x55, 0xbb, 0x4b, 0x21, 0xb4, 0x08, 0x29, 0x89, 0x86, 0x44, - 0x55, 0xbb, 0x89, 0x9c, 0xf1, 0xe0, 0x8c, 0x64, 0x3c, 0xae, 0x3d, 0x8e, 0xc8, 0xaa, 0xaf, 0xd0, - 0xd7, 0xe9, 0xae, 0xcb, 0x2e, 0x59, 0x76, 0x59, 0xc1, 0x23, 0xf4, 0x05, 0x2a, 0x1f, 0x27, 0x24, - 0x21, 0xa2, 0xdd, 0x74, 0x37, 0x33, 0xdf, 0x6f, 0xce, 0x9c, 0xef, 0x9b, 0xd1, 0x40, 0xd5, 0x0f, - 0xe4, 0x88, 0x7b, 0x96, 0xc7, 0xb8, 0x79, 0xc3, 0x95, 0x65, 0x5b, 0xca, 0x32, 0x47, 0x47, 0x66, - 0xc8, 0xa4, 0xcf, 0x0d, 0x3f, 0x90, 0x4a, 0x92, 0x1c, 0x4e, 0x4a, 0xfb, 0xcf, 0xa0, 0x4c, 0x7a, - 0x2a, 0xb0, 0x98, 0x4a, 0xe8, 0xd2, 0x73, 0x15, 0xd5, 0xd8, 0xe7, 0xe1, 0x84, 0xa9, 0x38, 0x52, - 0x3a, 0x2e, 0x37, 0x71, 0x36, 0x88, 0xae, 0x4d, 0x9b, 0x87, 0x2c, 0x10, 0xbe, 0x92, 0x41, 0x42, - 0x54, 0x1d, 0xc8, 0x35, 0x47, 0xdc, 0x53, 0xe4, 0x00, 0xc0, 0x09, 0x64, 0xe4, 0xf7, 0xa3, 0x48, - 0xd8, 0xba, 0x56, 0xd1, 0x6a, 0xc5, 0x7a, 0xd1, 0x48, 0x8a, 0xf5, 0x7a, 0x17, 0x67, 0xb4, 0x80, - 0x72, 0x2f, 0x12, 0x36, 0xa9, 0xc3, 0x3a, 0xbf, 0xe5, 0x2c, 0x52, 0x42, 0x7a, 0x09, 0x9f, 0x5e, - 0xe6, 0xd7, 0x1e, 0x91, 0x78, 0x4f, 0xf5, 0xb3, 0x06, 0xb9, 0xab, 0xd8, 0x1f, 0xd9, 0x85, 0xec, - 0x73, 0x67, 0xa0, 0x40, 0x0e, 0x61, 0xc5, 0xb7, 0x02, 0x25, 0x78, 0xa8, 0xa7, 0x2b, 0x99, 0x5a, - 0xb1, 0xfe, 0xb7, 0xf1, 0xe8, 0x9d, 0x72, 0x26, 0x94, 0xe5, 0xd2, 0x29, 0x41, 0x4e, 0x60, 0x35, - 0xe0, 0x4c, 0x06, 0x76, 0x1f, 0xfb, 0xd3, 0x33, 0xb8, 0x83, 0x18, 0x49, 0xb0, 0x14, 0xa5, 0xd7, - 0xb1, 0x42, 0x8b, 0xc1, 0x6c, 0x42, 0x0e, 0x01, 0x5c, 0x2b, 0x54, 0x7d, 0x1e, 0x9b, 0xd7, 0xb3, - 0xd8, 0xca, 0xea, 0x64, 0x13, 0x06, 0x42, 0x0b, 0xb1, 0x8e, 0xc3, 0xea, 0xff, 0xb0, 0x81, 0xad, - 0x9f, 0x4a, 0xd7, 0xe5, 0x2c, 0xb6, 0x44, 0xf6, 0x20, 0x8f, 0x70, 0xa8, 0x6b, 0x78, 0xe0, 0x74, - 0x2f, 0x72, 0x74, 0xa2, 0x55, 0xbf, 0xa4, 0xa1, 0x38, 0xd7, 0x02, 0xd9, 0x83, 0xb5, 0xd0, 0xe7, - 0x4c, 0x5c, 0x0b, 0x66, 0xc5, 0x65, 0x30, 0x83, 0x02, 0x5d, 0x5c, 0x7c, 0x72, 0x15, 0xe9, 0x5f, - 0x5e, 0x45, 0x03, 0xfe, 0x4a, 0x72, 0x96, 0x81, 0x9e, 0x41, 0x72, 0x7f, 0x42, 0x5e, 0x09, 0xc7, - 0x13, 0x9e, 0xd3, 0xf0, 0xec, 0xa6, 0xc7, 0x82, 0xb1, 0x1f, 0x97, 0xee, 0x44, 0x03, 0x57, 0xb0, - 0x4b, 0x3e, 0x0e, 0xe9, 0xe3, 0xb6, 0xf9, 0xb8, 0xb3, 0xbf, 0x8d, 0xfb, 0x5f, 0x58, 0x49, 0x62, - 0x0c, 0xf5, 0x1c, 0xc2, 0x6b, 0x0b, 0x49, 0xd3, 0xa9, 0x4a, 0xfe, 0x81, 0x02, 0x73, 0xad, 0x30, - 0xf4, 0xac, 0x1b, 0xae, 0xe7, 0xd1, 0xe6, 0x6c, 0x81, 0xd4, 0x20, 0x67, 0x45, 0xb6, 0x50, 0x3a, - 0xc3, 0x9e, 0xc9, 0xa4, 0xe7, 0x46, 0xbc, 0x76, 0x2e, 0xb8, 0x6b, 0x87, 0x34, 0x01, 0xaa, 0x3f, - 0x34, 0xc8, 0x27, 0xb5, 0x09, 0x81, 0x2c, 0x56, 0x4b, 0x42, 0xc3, 0x71, 0xbc, 0x36, 0xb4, 0xc2, - 0x21, 0xa6, 0x54, 0xa0, 0x38, 0x5e, 0x3c, 0x3a, 0xf3, 0xf4, 0xe8, 0x03, 0xc8, 0x0b, 0xcf, 0x8f, - 0xd4, 0xd4, 0xed, 0xe2, 0x53, 0xb9, 0x88, 0x25, 0x3a, 0x21, 0xc8, 0x09, 0xe4, 0x03, 0x1e, 0x46, - 0xae, 0xd2, 0x73, 0x15, 0xad, 0xb6, 0x5e, 0xdf, 0x99, 0x25, 0xd3, 0x9c, 0xbe, 0x6e, 0x8a, 0x40, - 0x77, 0x1c, 0x5f, 0x7b, 0x02, 0x93, 0x5d, 0x28, 0x26, 0xa3, 0xfe, 0x9c, 0x7b, 0x48, 0x96, 0x5a, - 0x71, 0x0f, 0x33, 0x00, 0x9b, 0x5f, 0x99, 0x07, 0xde, 0x58, 0xe1, 0xb0, 0xfa, 0x71, 0xfa, 0x6e, - 0xb0, 0x9f, 0x3f, 0xe6, 0x3c, 0x1b, 0xc7, 0x8c, 0xaf, 0x7d, 0xbd, 0xbe, 0xb5, 0xec, 0x1b, 0x4d, - 0x20, 0x73, 0xe0, 0xc2, 0xc6, 0x13, 0x81, 0xec, 0xc0, 0x36, 0x6d, 0x9e, 0xb6, 0xe9, 0x59, 0xff, - 0xa2, 0xd5, 0xe9, 0x75, 0xfb, 0xdd, 0x77, 0x9d, 0x66, 0xbf, 0xd7, 0xba, 0x6c, 0xb5, 0xdf, 0xb6, - 0x36, 0x53, 0xa4, 0x0c, 0xa5, 0x65, 0xb9, 0x43, 0xdb, 0x9d, 0xf6, 0x55, 0xf3, 0x6c, 0x53, 0x23, - 0x25, 0xd8, 0x5a, 0xd6, 0xcf, 0x1b, 0xa7, 0xdd, 0xcd, 0xf4, 0xab, 0x0f, 0x5f, 0xef, 0xcb, 0xda, - 0xdd, 0x7d, 0x59, 0xfb, 0x7e, 0x5f, 0xd6, 0x3e, 0x3d, 0x94, 0x53, 0x77, 0x0f, 0xe5, 0xd4, 0xb7, - 0x87, 0x72, 0x0a, 0xb6, 0x85, 0x34, 0x66, 0x1f, 0x9d, 0x31, 0xfd, 0xe8, 0x8c, 0xd1, 0x51, 0x47, - 0x7b, 0xff, 0xd2, 0x11, 0x6a, 0x18, 0x0d, 0x0c, 0x26, 0x6f, 0xcc, 0x19, 0xf4, 0x9f, 0x90, 0x73, - 0x33, 0xf3, 0x76, 0xf6, 0x3b, 0xba, 0xdc, 0xb1, 0xd8, 0xd8, 0x1c, 0x1d, 0x1d, 0xbf, 0x18, 0xe4, - 0xf1, 0xff, 0x3b, 0xfe, 0x19, 0x00, 0x00, 0xff, 0xff, 0x22, 0xdf, 0xac, 0x60, 0x99, 0x05, 0x00, - 0x00, -} - -func (m *Event) 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 *Event) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ExecutionUuid != nil { - { - size, err := m.ExecutionUuid.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintScope(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.GroupUuid != nil { - { - size, err := m.GroupUuid.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintScope(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Scope) 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 *Scope) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Scope) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LastEvent != nil { - { - size, err := m.LastEvent.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintScope(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if len(m.RecordGroup) > 0 { - for iNdEx := len(m.RecordGroup) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.RecordGroup[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintScope(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Parties) > 0 { - for iNdEx := len(m.Parties) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Parties[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintScope(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Uuid != nil { - { - size, err := m.Uuid.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintScope(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ScopeCollection) 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 *ScopeCollection) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ScopeCollection) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Scopes) > 0 { - for iNdEx := len(m.Scopes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Scopes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintScope(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *RecordGroup) 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 *RecordGroup) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RecordGroup) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Audit != nil { - { - size, err := m.Audit.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintScope(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x6 - i-- - dAtA[i] = 0x9a - } - if len(m.Classname) > 0 { - i -= len(m.Classname) - copy(dAtA[i:], m.Classname) - i = encodeVarintScope(dAtA, i, uint64(len(m.Classname))) - i-- - dAtA[i] = 0x32 - } - if len(m.Records) > 0 { - for iNdEx := len(m.Records) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Records[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintScope(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.Parties) > 0 { - for iNdEx := len(m.Parties) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Parties[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintScope(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.Executor != nil { - { - size, err := m.Executor.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintScope(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.GroupUuid != nil { - { - size, err := m.GroupUuid.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintScope(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Specification) > 0 { - i -= len(m.Specification) - copy(dAtA[i:], m.Specification) - i = encodeVarintScope(dAtA, i, uint64(len(m.Specification))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Record) 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 *Record) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Record) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ResultHash) > 0 { - i -= len(m.ResultHash) - copy(dAtA[i:], m.ResultHash) - i = encodeVarintScope(dAtA, i, uint64(len(m.ResultHash))) - i-- - dAtA[i] = 0x3a - } - if len(m.ResultName) > 0 { - i -= len(m.ResultName) - copy(dAtA[i:], m.ResultName) - i = encodeVarintScope(dAtA, i, uint64(len(m.ResultName))) - i-- - dAtA[i] = 0x32 - } - if m.Result != 0 { - i = encodeVarintScope(dAtA, i, uint64(m.Result)) - i-- - dAtA[i] = 0x28 - } - if len(m.Inputs) > 0 { - for iNdEx := len(m.Inputs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Inputs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintScope(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.Classname) > 0 { - i -= len(m.Classname) - copy(dAtA[i:], m.Classname) - i = encodeVarintScope(dAtA, i, uint64(len(m.Classname))) - i-- - dAtA[i] = 0x1a - } - if len(m.Hash) > 0 { - i -= len(m.Hash) - copy(dAtA[i:], m.Hash) - i = encodeVarintScope(dAtA, i, uint64(len(m.Hash))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintScope(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RecordInput) 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 *RecordInput) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RecordInput) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Type != 0 { - i = encodeVarintScope(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x20 - } - if len(m.Classname) > 0 { - i -= len(m.Classname) - copy(dAtA[i:], m.Classname) - i = encodeVarintScope(dAtA, i, uint64(len(m.Classname))) - i-- - dAtA[i] = 0x1a - } - if len(m.Hash) > 0 { - i -= len(m.Hash) - copy(dAtA[i:], m.Hash) - i = encodeVarintScope(dAtA, i, uint64(len(m.Hash))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintScope(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintScope(dAtA []byte, offset int, v uint64) int { - offset -= sovScope(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Event) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.GroupUuid != nil { - l = m.GroupUuid.Size() - n += 1 + l + sovScope(uint64(l)) - } - if m.ExecutionUuid != nil { - l = m.ExecutionUuid.Size() - n += 1 + l + sovScope(uint64(l)) - } - return n -} - -func (m *Scope) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Uuid != nil { - l = m.Uuid.Size() - n += 1 + l + sovScope(uint64(l)) - } - if len(m.Parties) > 0 { - for _, e := range m.Parties { - l = e.Size() - n += 1 + l + sovScope(uint64(l)) - } - } - if len(m.RecordGroup) > 0 { - for _, e := range m.RecordGroup { - l = e.Size() - n += 1 + l + sovScope(uint64(l)) - } - } - if m.LastEvent != nil { - l = m.LastEvent.Size() - n += 1 + l + sovScope(uint64(l)) - } - return n -} - -func (m *ScopeCollection) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Scopes) > 0 { - for _, e := range m.Scopes { - l = e.Size() - n += 1 + l + sovScope(uint64(l)) - } - } - return n -} - -func (m *RecordGroup) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Specification) - if l > 0 { - n += 1 + l + sovScope(uint64(l)) - } - if m.GroupUuid != nil { - l = m.GroupUuid.Size() - n += 1 + l + sovScope(uint64(l)) - } - if m.Executor != nil { - l = m.Executor.Size() - n += 1 + l + sovScope(uint64(l)) - } - if len(m.Parties) > 0 { - for _, e := range m.Parties { - l = e.Size() - n += 1 + l + sovScope(uint64(l)) - } - } - if len(m.Records) > 0 { - for _, e := range m.Records { - l = e.Size() - n += 1 + l + sovScope(uint64(l)) - } - } - l = len(m.Classname) - if l > 0 { - n += 1 + l + sovScope(uint64(l)) - } - if m.Audit != nil { - l = m.Audit.Size() - n += 2 + l + sovScope(uint64(l)) - } - return n -} - -func (m *Record) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovScope(uint64(l)) - } - l = len(m.Hash) - if l > 0 { - n += 1 + l + sovScope(uint64(l)) - } - l = len(m.Classname) - if l > 0 { - n += 1 + l + sovScope(uint64(l)) - } - if len(m.Inputs) > 0 { - for _, e := range m.Inputs { - l = e.Size() - n += 1 + l + sovScope(uint64(l)) - } - } - if m.Result != 0 { - n += 1 + sovScope(uint64(m.Result)) - } - l = len(m.ResultName) - if l > 0 { - n += 1 + l + sovScope(uint64(l)) - } - l = len(m.ResultHash) - if l > 0 { - n += 1 + l + sovScope(uint64(l)) - } - return n -} - -func (m *RecordInput) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovScope(uint64(l)) - } - l = len(m.Hash) - if l > 0 { - n += 1 + l + sovScope(uint64(l)) - } - l = len(m.Classname) - if l > 0 { - n += 1 + l + sovScope(uint64(l)) - } - if m.Type != 0 { - n += 1 + sovScope(uint64(m.Type)) - } - return n -} - -func sovScope(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozScope(x uint64) (n int) { - return sovScope(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Event) 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 ErrIntOverflowScope - } - 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: Event: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Event: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GroupUuid", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScope - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScope - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthScope - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.GroupUuid == nil { - m.GroupUuid = &UUID{} - } - if err := m.GroupUuid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutionUuid", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScope - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScope - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthScope - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutionUuid == nil { - m.ExecutionUuid = &UUID{} - } - if err := m.ExecutionUuid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipScope(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthScope - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Scope) 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 ErrIntOverflowScope - } - 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: Scope: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Scope: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Uuid", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScope - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScope - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthScope - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Uuid == nil { - m.Uuid = &UUID{} - } - if err := m.Uuid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Parties", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScope - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScope - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthScope - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Parties = append(m.Parties, &Recital{}) - if err := m.Parties[len(m.Parties)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RecordGroup", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScope - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScope - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthScope - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RecordGroup = append(m.RecordGroup, &RecordGroup{}) - if err := m.RecordGroup[len(m.RecordGroup)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastEvent", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScope - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScope - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthScope - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.LastEvent == nil { - m.LastEvent = &Event{} - } - if err := m.LastEvent.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipScope(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthScope - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ScopeCollection) 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 ErrIntOverflowScope - } - 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: ScopeCollection: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ScopeCollection: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Scopes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScope - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScope - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthScope - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Scopes = append(m.Scopes, &Scope{}) - if err := m.Scopes[len(m.Scopes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipScope(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthScope - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RecordGroup) 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 ErrIntOverflowScope - } - 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: RecordGroup: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RecordGroup: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Specification", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScope - } - 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 ErrInvalidLengthScope - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthScope - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Specification = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GroupUuid", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScope - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScope - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthScope - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.GroupUuid == nil { - m.GroupUuid = &UUID{} - } - if err := m.GroupUuid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Executor", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScope - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScope - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthScope - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Executor == nil { - m.Executor = &SigningAndEncryptionPublicKeys{} - } - if err := m.Executor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Parties", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScope - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScope - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthScope - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Parties = append(m.Parties, &Recital{}) - if err := m.Parties[len(m.Parties)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Records", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScope - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScope - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthScope - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Records = append(m.Records, &Record{}) - if err := m.Records[len(m.Records)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Classname", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScope - } - 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 ErrInvalidLengthScope - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthScope - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Classname = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 99: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Audit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScope - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScope - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthScope - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Audit == nil { - m.Audit = &AuditFields{} - } - if err := m.Audit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipScope(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthScope - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Record) 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 ErrIntOverflowScope - } - 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: Record: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Record: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScope - } - 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 ErrInvalidLengthScope - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthScope - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScope - } - 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 ErrInvalidLengthScope - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthScope - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Hash = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Classname", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScope - } - 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 ErrInvalidLengthScope - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthScope - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Classname = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Inputs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScope - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScope - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthScope - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Inputs = append(m.Inputs, &RecordInput{}) - if err := m.Inputs[len(m.Inputs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) - } - m.Result = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScope - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Result |= ExecutionResultType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResultName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScope - } - 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 ErrInvalidLengthScope - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthScope - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ResultName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResultHash", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScope - } - 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 ErrInvalidLengthScope - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthScope - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ResultHash = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipScope(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthScope - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RecordInput) 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 ErrIntOverflowScope - } - 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: RecordInput: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RecordInput: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScope - } - 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 ErrInvalidLengthScope - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthScope - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScope - } - 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 ErrInvalidLengthScope - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthScope - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Hash = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Classname", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScope - } - 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 ErrInvalidLengthScope - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthScope - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Classname = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScope - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= RecordInputType(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipScope(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthScope - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipScope(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, ErrIntOverflowScope - } - 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, ErrIntOverflowScope - } - 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, ErrIntOverflowScope - } - 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, ErrInvalidLengthScope - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupScope - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthScope - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthScope = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowScope = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupScope = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/metadata/legacy/v039/spec.pb.go b/x/metadata/legacy/v039/spec.pb.go deleted file mode 100644 index 4128e48aad..0000000000 --- a/x/metadata/legacy/v039/spec.pb.go +++ /dev/null @@ -1,1795 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: provenance/metadata/v0/spec.proto - -package v039 - -import ( - fmt "fmt" - 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 DefinitionSpecType int32 - -const ( - DefinitionSpecType_DEFINITION_SPEC_TYPE_UNKNOWN DefinitionSpecType = 0 - DefinitionSpecType_DEFINITION_SPEC_TYPE_PROPOSED DefinitionSpecType = 1 - DefinitionSpecType_DEFINITION_SPEC_TYPE_FACT DefinitionSpecType = 2 - DefinitionSpecType_DEFINITION_SPEC_TYPE_FACT_LIST DefinitionSpecType = 3 -) - -var DefinitionSpecType_name = map[int32]string{ - 0: "DEFINITION_SPEC_TYPE_UNKNOWN", - 1: "DEFINITION_SPEC_TYPE_PROPOSED", - 2: "DEFINITION_SPEC_TYPE_FACT", - 3: "DEFINITION_SPEC_TYPE_FACT_LIST", -} - -var DefinitionSpecType_value = map[string]int32{ - "DEFINITION_SPEC_TYPE_UNKNOWN": 0, - "DEFINITION_SPEC_TYPE_PROPOSED": 1, - "DEFINITION_SPEC_TYPE_FACT": 2, - "DEFINITION_SPEC_TYPE_FACT_LIST": 3, -} - -func (x DefinitionSpecType) String() string { - return proto.EnumName(DefinitionSpecType_name, int32(x)) -} - -func (DefinitionSpecType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_60d9243ecc628e4f, []int{0} -} - -type DefinitionSpec struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - ResourceLocation *Location `protobuf:"bytes,2,opt,name=resource_location,json=resourceLocation,proto3" json:"resource_location,omitempty"` - Signature *Signature `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` - Type DefinitionSpecType `protobuf:"varint,4,opt,name=type,proto3,enum=spec.DefinitionSpecType" json:"type,omitempty"` -} - -func (m *DefinitionSpec) Reset() { *m = DefinitionSpec{} } -func (m *DefinitionSpec) String() string { return proto.CompactTextString(m) } -func (*DefinitionSpec) ProtoMessage() {} -func (*DefinitionSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_60d9243ecc628e4f, []int{0} -} -func (m *DefinitionSpec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DefinitionSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DefinitionSpec.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 *DefinitionSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_DefinitionSpec.Merge(m, src) -} -func (m *DefinitionSpec) XXX_Size() int { - return m.Size() -} -func (m *DefinitionSpec) XXX_DiscardUnknown() { - xxx_messageInfo_DefinitionSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_DefinitionSpec proto.InternalMessageInfo - -func (m *DefinitionSpec) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *DefinitionSpec) GetResourceLocation() *Location { - if m != nil { - return m.ResourceLocation - } - return nil -} - -func (m *DefinitionSpec) GetSignature() *Signature { - if m != nil { - return m.Signature - } - return nil -} - -func (m *DefinitionSpec) GetType() DefinitionSpecType { - if m != nil { - return m.Type - } - return DefinitionSpecType_DEFINITION_SPEC_TYPE_UNKNOWN -} - -type ContractSpec struct { - Definition *DefinitionSpec `protobuf:"bytes,1,opt,name=definition,proto3" json:"definition,omitempty"` - InputSpecs []*DefinitionSpec `protobuf:"bytes,2,rep,name=input_specs,json=inputSpecs,proto3" json:"input_specs,omitempty"` - PartiesInvolved []PartyType `protobuf:"varint,3,rep,packed,name=parties_involved,json=partiesInvolved,proto3,enum=types.PartyType" json:"parties_involved,omitempty"` - ConditionSpecs []*ConditionSpec `protobuf:"bytes,4,rep,name=condition_specs,json=conditionSpecs,proto3" json:"condition_specs,omitempty"` - ConsiderationSpecs []*ConsiderationSpec `protobuf:"bytes,5,rep,name=consideration_specs,json=considerationSpecs,proto3" json:"consideration_specs,omitempty"` -} - -func (m *ContractSpec) Reset() { *m = ContractSpec{} } -func (m *ContractSpec) String() string { return proto.CompactTextString(m) } -func (*ContractSpec) ProtoMessage() {} -func (*ContractSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_60d9243ecc628e4f, []int{1} -} -func (m *ContractSpec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ContractSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ContractSpec.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 *ContractSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_ContractSpec.Merge(m, src) -} -func (m *ContractSpec) XXX_Size() int { - return m.Size() -} -func (m *ContractSpec) XXX_DiscardUnknown() { - xxx_messageInfo_ContractSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_ContractSpec proto.InternalMessageInfo - -func (m *ContractSpec) GetDefinition() *DefinitionSpec { - if m != nil { - return m.Definition - } - return nil -} - -func (m *ContractSpec) GetInputSpecs() []*DefinitionSpec { - if m != nil { - return m.InputSpecs - } - return nil -} - -func (m *ContractSpec) GetPartiesInvolved() []PartyType { - if m != nil { - return m.PartiesInvolved - } - return nil -} - -func (m *ContractSpec) GetConditionSpecs() []*ConditionSpec { - if m != nil { - return m.ConditionSpecs - } - return nil -} - -func (m *ContractSpec) GetConsiderationSpecs() []*ConsiderationSpec { - if m != nil { - return m.ConsiderationSpecs - } - return nil -} - -type ConditionSpec struct { - FuncName string `protobuf:"bytes,1,opt,name=func_name,json=funcName,proto3" json:"func_name,omitempty"` - InputSpecs []*DefinitionSpec `protobuf:"bytes,2,rep,name=input_specs,json=inputSpecs,proto3" json:"input_specs,omitempty"` - OutputSpec *OutputSpec `protobuf:"bytes,3,opt,name=output_spec,json=outputSpec,proto3" json:"output_spec,omitempty"` -} - -func (m *ConditionSpec) Reset() { *m = ConditionSpec{} } -func (m *ConditionSpec) String() string { return proto.CompactTextString(m) } -func (*ConditionSpec) ProtoMessage() {} -func (*ConditionSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_60d9243ecc628e4f, []int{2} -} -func (m *ConditionSpec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ConditionSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ConditionSpec.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 *ConditionSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConditionSpec.Merge(m, src) -} -func (m *ConditionSpec) XXX_Size() int { - return m.Size() -} -func (m *ConditionSpec) XXX_DiscardUnknown() { - xxx_messageInfo_ConditionSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_ConditionSpec proto.InternalMessageInfo - -func (m *ConditionSpec) GetFuncName() string { - if m != nil { - return m.FuncName - } - return "" -} - -func (m *ConditionSpec) GetInputSpecs() []*DefinitionSpec { - if m != nil { - return m.InputSpecs - } - return nil -} - -func (m *ConditionSpec) GetOutputSpec() *OutputSpec { - if m != nil { - return m.OutputSpec - } - return nil -} - -type ConsiderationSpec struct { - FuncName string `protobuf:"bytes,1,opt,name=func_name,json=funcName,proto3" json:"func_name,omitempty"` - // Invoking party - ResponsibleParty PartyType `protobuf:"varint,2,opt,name=responsible_party,json=responsibleParty,proto3,enum=types.PartyType" json:"responsible_party,omitempty"` - InputSpecs []*DefinitionSpec `protobuf:"bytes,3,rep,name=input_specs,json=inputSpecs,proto3" json:"input_specs,omitempty"` - OutputSpec *OutputSpec `protobuf:"bytes,4,opt,name=output_spec,json=outputSpec,proto3" json:"output_spec,omitempty"` -} - -func (m *ConsiderationSpec) Reset() { *m = ConsiderationSpec{} } -func (m *ConsiderationSpec) String() string { return proto.CompactTextString(m) } -func (*ConsiderationSpec) ProtoMessage() {} -func (*ConsiderationSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_60d9243ecc628e4f, []int{3} -} -func (m *ConsiderationSpec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ConsiderationSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ConsiderationSpec.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 *ConsiderationSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConsiderationSpec.Merge(m, src) -} -func (m *ConsiderationSpec) XXX_Size() int { - return m.Size() -} -func (m *ConsiderationSpec) XXX_DiscardUnknown() { - xxx_messageInfo_ConsiderationSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_ConsiderationSpec proto.InternalMessageInfo - -func (m *ConsiderationSpec) GetFuncName() string { - if m != nil { - return m.FuncName - } - return "" -} - -func (m *ConsiderationSpec) GetResponsibleParty() PartyType { - if m != nil { - return m.ResponsibleParty - } - return PartyType_PARTY_TYPE_UNKNOWN -} - -func (m *ConsiderationSpec) GetInputSpecs() []*DefinitionSpec { - if m != nil { - return m.InputSpecs - } - return nil -} - -func (m *ConsiderationSpec) GetOutputSpec() *OutputSpec { - if m != nil { - return m.OutputSpec - } - return nil -} - -type OutputSpec struct { - Spec *DefinitionSpec `protobuf:"bytes,1,opt,name=spec,proto3" json:"spec,omitempty"` -} - -func (m *OutputSpec) Reset() { *m = OutputSpec{} } -func (m *OutputSpec) String() string { return proto.CompactTextString(m) } -func (*OutputSpec) ProtoMessage() {} -func (*OutputSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_60d9243ecc628e4f, []int{4} -} -func (m *OutputSpec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *OutputSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_OutputSpec.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 *OutputSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_OutputSpec.Merge(m, src) -} -func (m *OutputSpec) XXX_Size() int { - return m.Size() -} -func (m *OutputSpec) XXX_DiscardUnknown() { - xxx_messageInfo_OutputSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_OutputSpec proto.InternalMessageInfo - -func (m *OutputSpec) GetSpec() *DefinitionSpec { - if m != nil { - return m.Spec - } - return nil -} - -func init() { - proto.RegisterEnum("spec.DefinitionSpecType", DefinitionSpecType_name, DefinitionSpecType_value) - proto.RegisterType((*DefinitionSpec)(nil), "spec.DefinitionSpec") - proto.RegisterType((*ContractSpec)(nil), "spec.ContractSpec") - proto.RegisterType((*ConditionSpec)(nil), "spec.ConditionSpec") - proto.RegisterType((*ConsiderationSpec)(nil), "spec.ConsiderationSpec") - proto.RegisterType((*OutputSpec)(nil), "spec.OutputSpec") -} - -func init() { proto.RegisterFile("provenance/metadata/v0/spec.proto", fileDescriptor_60d9243ecc628e4f) } - -var fileDescriptor_60d9243ecc628e4f = []byte{ - // 600 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xc1, 0x6e, 0xd3, 0x4c, - 0x10, 0xc7, 0xb3, 0x49, 0xbe, 0x4f, 0x74, 0x02, 0xa9, 0xbb, 0x45, 0xc2, 0x05, 0x6a, 0xa5, 0x39, - 0x45, 0x08, 0xec, 0xd2, 0x02, 0x12, 0x50, 0x0e, 0x90, 0xa6, 0x22, 0xa2, 0x72, 0x2c, 0x27, 0x08, - 0xc1, 0xc5, 0xda, 0x6e, 0xb6, 0xc5, 0x52, 0xba, 0x6b, 0xec, 0xb5, 0x45, 0xde, 0x82, 0x13, 0x27, - 0x1e, 0xa6, 0x47, 0x8e, 0x3d, 0xc2, 0x0d, 0xb5, 0x2f, 0x82, 0xbc, 0x89, 0x63, 0xb7, 0x4d, 0x2b, - 0xd4, 0xdb, 0x78, 0xe6, 0x37, 0x33, 0xfb, 0x5f, 0xcf, 0x0e, 0xac, 0x05, 0xa1, 0x48, 0x18, 0x27, - 0x9c, 0x32, 0xeb, 0x90, 0x49, 0x32, 0x24, 0x92, 0x58, 0xc9, 0xba, 0x15, 0x05, 0x8c, 0x9a, 0x41, - 0x28, 0xa4, 0xc0, 0xd5, 0xd4, 0xbe, 0xdb, 0xbc, 0x04, 0x94, 0xe3, 0x80, 0x45, 0x13, 0xb2, 0x79, - 0x84, 0xa0, 0xbe, 0xcd, 0xf6, 0x7d, 0xee, 0x4b, 0x5f, 0xf0, 0x7e, 0xc0, 0x28, 0xc6, 0x50, 0xe5, - 0xe4, 0x90, 0xe9, 0xa8, 0x81, 0x5a, 0x0b, 0xae, 0xb2, 0xf1, 0x16, 0x2c, 0x85, 0x2c, 0x12, 0x71, - 0x48, 0x99, 0x37, 0x12, 0x94, 0xa4, 0xb0, 0x5e, 0x6e, 0xa0, 0x56, 0x6d, 0x63, 0xd1, 0x9c, 0xd4, - 0xdb, 0x9d, 0xba, 0x5d, 0x2d, 0x23, 0x33, 0x0f, 0x36, 0x61, 0x21, 0xf2, 0x0f, 0x38, 0x91, 0x71, - 0xc8, 0xf4, 0x8a, 0xca, 0xd2, 0xa6, 0x59, 0xfd, 0xcc, 0xef, 0xe6, 0x08, 0x7e, 0x08, 0xd5, 0x34, - 0xaa, 0x57, 0x1b, 0xa8, 0x55, 0xdf, 0xd0, 0x4d, 0xa5, 0xec, 0xec, 0x29, 0x07, 0xe3, 0x80, 0xb9, - 0x8a, 0x6a, 0x1e, 0x95, 0xe1, 0x66, 0x5b, 0x70, 0x19, 0x12, 0x2a, 0x95, 0x80, 0x27, 0x00, 0xc3, - 0x19, 0xac, 0x64, 0xd4, 0x36, 0x6e, 0xcf, 0x2b, 0xe2, 0x16, 0x38, 0xfc, 0x14, 0x6a, 0x3e, 0x0f, - 0x62, 0xe9, 0xa5, 0x60, 0xa4, 0x97, 0x1b, 0x95, 0xcb, 0xd3, 0x14, 0x98, 0x9a, 0x11, 0x7e, 0x09, - 0x5a, 0x40, 0x42, 0xe9, 0xb3, 0xc8, 0xf3, 0x79, 0x22, 0x46, 0x09, 0x1b, 0xea, 0x95, 0x46, 0xa5, - 0x55, 0x9f, 0x49, 0x74, 0x48, 0x28, 0xc7, 0xea, 0xbc, 0x8b, 0x53, 0xb2, 0x3b, 0x05, 0xf1, 0x16, - 0x2c, 0x52, 0xc1, 0x87, 0xaa, 0xf2, 0xb4, 0x6f, 0x55, 0xf5, 0x5d, 0x9e, 0xf4, 0x6d, 0x67, 0x41, - 0xd5, 0xb6, 0x4e, 0x8b, 0x9f, 0x11, 0x7e, 0x0b, 0xcb, 0x54, 0xf0, 0xc8, 0x1f, 0xb2, 0x90, 0x14, - 0x2a, 0xfc, 0xa7, 0x2a, 0xdc, 0x99, 0x55, 0xc8, 0x01, 0x55, 0x05, 0xd3, 0xf3, 0xae, 0xa8, 0xf9, - 0x1d, 0xc1, 0xad, 0x33, 0xbd, 0xf0, 0x3d, 0x58, 0xd8, 0x8f, 0x39, 0xf5, 0x0a, 0x93, 0x70, 0x23, - 0x75, 0xd8, 0xe9, 0x34, 0x5c, 0xf3, 0xaa, 0x1e, 0x43, 0x4d, 0xc4, 0x32, 0xcb, 0x9b, 0x0d, 0x82, - 0x4a, 0xeb, 0xa9, 0xc0, 0x24, 0x45, 0xcc, 0xec, 0xe6, 0x6f, 0x04, 0x4b, 0x17, 0x24, 0x5c, 0x7d, - 0xb8, 0x57, 0x6a, 0x54, 0x83, 0x34, 0x69, 0x6f, 0xc4, 0xbc, 0xf4, 0xca, 0xc7, 0x6a, 0x54, 0xe7, - 0xfd, 0x11, 0xad, 0x80, 0x2a, 0xef, 0x79, 0x6d, 0x95, 0xeb, 0x69, 0xab, 0xfe, 0x83, 0xb6, 0x67, - 0x00, 0x79, 0x04, 0xb7, 0x40, 0x3d, 0xda, 0x2b, 0xc7, 0x55, 0x11, 0x0f, 0x7e, 0x20, 0xc0, 0x17, - 0x1f, 0x03, 0x6e, 0xc0, 0xfd, 0xed, 0xce, 0x4e, 0xd7, 0xee, 0x0e, 0xba, 0x3d, 0xdb, 0xeb, 0x3b, - 0x9d, 0xb6, 0x37, 0xf8, 0xe8, 0x74, 0xbc, 0xf7, 0xf6, 0x3b, 0xbb, 0xf7, 0xc1, 0xd6, 0x4a, 0x78, - 0x0d, 0x56, 0xe7, 0x12, 0x8e, 0xdb, 0x73, 0x7a, 0xfd, 0xce, 0xb6, 0x86, 0xf0, 0x2a, 0xac, 0xcc, - 0x45, 0x76, 0x5e, 0xb7, 0x07, 0x5a, 0x19, 0x37, 0xc1, 0xb8, 0x34, 0xec, 0xed, 0x76, 0xfb, 0x03, - 0xad, 0xf2, 0xe6, 0xcb, 0xcf, 0x13, 0x03, 0x1d, 0x9f, 0x18, 0xe8, 0xcf, 0x89, 0x81, 0xbe, 0x9d, - 0x1a, 0xa5, 0xe3, 0x53, 0xa3, 0xf4, 0xeb, 0xd4, 0x28, 0xc1, 0x8a, 0x2f, 0xcc, 0x7c, 0x25, 0x99, - 0xd9, 0x4a, 0x32, 0x93, 0x75, 0x07, 0x7d, 0x7a, 0x71, 0xe0, 0xcb, 0xcf, 0xf1, 0x9e, 0x49, 0xc5, - 0xa1, 0x95, 0x43, 0x8f, 0x7c, 0x51, 0xf8, 0xb2, 0xbe, 0xe6, 0x7b, 0x6c, 0xc4, 0x0e, 0x08, 0x1d, - 0x5b, 0xc9, 0xfa, 0xe6, 0xf3, 0xbd, 0xff, 0xd5, 0x2e, 0xdb, 0xfc, 0x1b, 0x00, 0x00, 0xff, 0xff, - 0xd7, 0x26, 0x3c, 0x66, 0x1a, 0x05, 0x00, 0x00, -} - -func (m *DefinitionSpec) 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 *DefinitionSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DefinitionSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Type != 0 { - i = encodeVarintSpec(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x20 - } - if m.Signature != nil { - { - size, err := m.Signature.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.ResourceLocation != nil { - { - size, err := m.ResourceLocation.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintSpec(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ContractSpec) 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 *ContractSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ContractSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ConsiderationSpecs) > 0 { - for iNdEx := len(m.ConsiderationSpecs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ConsiderationSpecs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.ConditionSpecs) > 0 { - for iNdEx := len(m.ConditionSpecs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ConditionSpecs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.PartiesInvolved) > 0 { - dAtA4 := make([]byte, len(m.PartiesInvolved)*10) - var j3 int - for _, num := range m.PartiesInvolved { - for num >= 1<<7 { - dAtA4[j3] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j3++ - } - dAtA4[j3] = uint8(num) - j3++ - } - i -= j3 - copy(dAtA[i:], dAtA4[:j3]) - i = encodeVarintSpec(dAtA, i, uint64(j3)) - i-- - dAtA[i] = 0x1a - } - if len(m.InputSpecs) > 0 { - for iNdEx := len(m.InputSpecs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.InputSpecs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Definition != nil { - { - size, err := m.Definition.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ConditionSpec) 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 *ConditionSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ConditionSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.OutputSpec != nil { - { - size, err := m.OutputSpec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.InputSpecs) > 0 { - for iNdEx := len(m.InputSpecs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.InputSpecs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.FuncName) > 0 { - i -= len(m.FuncName) - copy(dAtA[i:], m.FuncName) - i = encodeVarintSpec(dAtA, i, uint64(len(m.FuncName))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ConsiderationSpec) 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 *ConsiderationSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ConsiderationSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.OutputSpec != nil { - { - size, err := m.OutputSpec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if len(m.InputSpecs) > 0 { - for iNdEx := len(m.InputSpecs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.InputSpecs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.ResponsibleParty != 0 { - i = encodeVarintSpec(dAtA, i, uint64(m.ResponsibleParty)) - i-- - dAtA[i] = 0x10 - } - if len(m.FuncName) > 0 { - i -= len(m.FuncName) - copy(dAtA[i:], m.FuncName) - i = encodeVarintSpec(dAtA, i, uint64(len(m.FuncName))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *OutputSpec) 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 *OutputSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *OutputSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Spec != nil { - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintSpec(dAtA []byte, offset int, v uint64) int { - offset -= sovSpec(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *DefinitionSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovSpec(uint64(l)) - } - if m.ResourceLocation != nil { - l = m.ResourceLocation.Size() - n += 1 + l + sovSpec(uint64(l)) - } - if m.Signature != nil { - l = m.Signature.Size() - n += 1 + l + sovSpec(uint64(l)) - } - if m.Type != 0 { - n += 1 + sovSpec(uint64(m.Type)) - } - return n -} - -func (m *ContractSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Definition != nil { - l = m.Definition.Size() - n += 1 + l + sovSpec(uint64(l)) - } - if len(m.InputSpecs) > 0 { - for _, e := range m.InputSpecs { - l = e.Size() - n += 1 + l + sovSpec(uint64(l)) - } - } - if len(m.PartiesInvolved) > 0 { - l = 0 - for _, e := range m.PartiesInvolved { - l += sovSpec(uint64(e)) - } - n += 1 + sovSpec(uint64(l)) + l - } - if len(m.ConditionSpecs) > 0 { - for _, e := range m.ConditionSpecs { - l = e.Size() - n += 1 + l + sovSpec(uint64(l)) - } - } - if len(m.ConsiderationSpecs) > 0 { - for _, e := range m.ConsiderationSpecs { - l = e.Size() - n += 1 + l + sovSpec(uint64(l)) - } - } - return n -} - -func (m *ConditionSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.FuncName) - if l > 0 { - n += 1 + l + sovSpec(uint64(l)) - } - if len(m.InputSpecs) > 0 { - for _, e := range m.InputSpecs { - l = e.Size() - n += 1 + l + sovSpec(uint64(l)) - } - } - if m.OutputSpec != nil { - l = m.OutputSpec.Size() - n += 1 + l + sovSpec(uint64(l)) - } - return n -} - -func (m *ConsiderationSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.FuncName) - if l > 0 { - n += 1 + l + sovSpec(uint64(l)) - } - if m.ResponsibleParty != 0 { - n += 1 + sovSpec(uint64(m.ResponsibleParty)) - } - if len(m.InputSpecs) > 0 { - for _, e := range m.InputSpecs { - l = e.Size() - n += 1 + l + sovSpec(uint64(l)) - } - } - if m.OutputSpec != nil { - l = m.OutputSpec.Size() - n += 1 + l + sovSpec(uint64(l)) - } - return n -} - -func (m *OutputSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Spec != nil { - l = m.Spec.Size() - n += 1 + l + sovSpec(uint64(l)) - } - return n -} - -func sovSpec(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozSpec(x uint64) (n int) { - return sovSpec(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *DefinitionSpec) 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 ErrIntOverflowSpec - } - 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: DefinitionSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DefinitionSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - 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 ErrInvalidLengthSpec - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceLocation", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ResourceLocation == nil { - m.ResourceLocation = &Location{} - } - if err := m.ResourceLocation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Signature == nil { - m.Signature = &Signature{} - } - if err := m.Signature.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= DefinitionSpecType(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSpec(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpec - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ContractSpec) 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 ErrIntOverflowSpec - } - 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: ContractSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ContractSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Definition", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Definition == nil { - m.Definition = &DefinitionSpec{} - } - if err := m.Definition.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InputSpecs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.InputSpecs = append(m.InputSpecs, &DefinitionSpec{}) - if err := m.InputSpecs[len(m.InputSpecs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType == 0 { - var v PartyType - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= PartyType(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.PartiesInvolved = append(m.PartiesInvolved, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthSpec - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthSpec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - if elementCount != 0 && len(m.PartiesInvolved) == 0 { - m.PartiesInvolved = make([]PartyType, 0, elementCount) - } - for iNdEx < postIndex { - var v PartyType - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= PartyType(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.PartiesInvolved = append(m.PartiesInvolved, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field PartiesInvolved", wireType) - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConditionSpecs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConditionSpecs = append(m.ConditionSpecs, &ConditionSpec{}) - if err := m.ConditionSpecs[len(m.ConditionSpecs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsiderationSpecs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConsiderationSpecs = append(m.ConsiderationSpecs, &ConsiderationSpec{}) - if err := m.ConsiderationSpecs[len(m.ConsiderationSpecs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSpec(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpec - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ConditionSpec) 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 ErrIntOverflowSpec - } - 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: ConditionSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConditionSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FuncName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - 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 ErrInvalidLengthSpec - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FuncName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InputSpecs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.InputSpecs = append(m.InputSpecs, &DefinitionSpec{}) - if err := m.InputSpecs[len(m.InputSpecs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OutputSpec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.OutputSpec == nil { - m.OutputSpec = &OutputSpec{} - } - if err := m.OutputSpec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSpec(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpec - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ConsiderationSpec) 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 ErrIntOverflowSpec - } - 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: ConsiderationSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConsiderationSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FuncName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - 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 ErrInvalidLengthSpec - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSpec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FuncName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ResponsibleParty", wireType) - } - m.ResponsibleParty = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ResponsibleParty |= PartyType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InputSpecs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.InputSpecs = append(m.InputSpecs, &DefinitionSpec{}) - if err := m.InputSpecs[len(m.InputSpecs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OutputSpec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.OutputSpec == nil { - m.OutputSpec = &OutputSpec{} - } - if err := m.OutputSpec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSpec(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpec - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *OutputSpec) 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 ErrIntOverflowSpec - } - 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: OutputSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: OutputSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Spec == nil { - m.Spec = &DefinitionSpec{} - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSpec(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpec - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipSpec(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, ErrIntOverflowSpec - } - 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, ErrIntOverflowSpec - } - 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, ErrIntOverflowSpec - } - 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, ErrInvalidLengthSpec - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupSpec - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthSpec - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthSpec = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSpec = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupSpec = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/metadata/legacy/v039/tx.pb.go b/x/metadata/legacy/v039/tx.pb.go deleted file mode 100644 index 0a5cb41aa0..0000000000 --- a/x/metadata/legacy/v039/tx.pb.go +++ /dev/null @@ -1,1508 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: provenance/metadata/v0/tx.proto - -package v039 - -import ( - context "context" - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - 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 - -// MsgMemorializeContractRequest is a request from a P8e execution environment to record results of a contract -type MsgMemorializeContractRequest struct { - // The scope of the object being modified on blockchain. - ScopeId string `protobuf:"bytes,1,opt,name=scope_id,json=scopeId,proto3" json:"scope_id,omitempty"` - // The uuid of the contract execution. - GroupId string `protobuf:"bytes,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - // Unique identifier for determining contract/group execution instance - ExecutionId string `protobuf:"bytes,3,opt,name=execution_id,json=executionId,proto3" json:"execution_id,omitempty"` - // The executed contract. - Contract Contract `protobuf:"bytes,4,opt,name=contract,proto3" json:"contract"` - // The contract signatures - Signatures SignatureSet `protobuf:"bytes,5,opt,name=signatures,proto3" json:"signatures"` - // ID of the scope snapshot reference for executing - ScopeRefID string `protobuf:"bytes,6,opt,name=ScopeRefID,proto3" json:"ScopeRefID,omitempty"` - // The address of the notary (ie the broadcaster of this message). - Notary string `protobuf:"bytes,7,opt,name=notary,proto3" json:"notary,omitempty"` -} - -func (m *MsgMemorializeContractRequest) Reset() { *m = MsgMemorializeContractRequest{} } -func (m *MsgMemorializeContractRequest) String() string { return proto.CompactTextString(m) } -func (*MsgMemorializeContractRequest) ProtoMessage() {} -func (*MsgMemorializeContractRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_67a0f042cc97a288, []int{0} -} -func (m *MsgMemorializeContractRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgMemorializeContractRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgMemorializeContractRequest.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 *MsgMemorializeContractRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgMemorializeContractRequest.Merge(m, src) -} -func (m *MsgMemorializeContractRequest) XXX_Size() int { - return m.Size() -} -func (m *MsgMemorializeContractRequest) XXX_DiscardUnknown() { - xxx_messageInfo_MsgMemorializeContractRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgMemorializeContractRequest proto.InternalMessageInfo - -func (m *MsgMemorializeContractRequest) GetScopeId() string { - if m != nil { - return m.ScopeId - } - return "" -} - -func (m *MsgMemorializeContractRequest) GetGroupId() string { - if m != nil { - return m.GroupId - } - return "" -} - -func (m *MsgMemorializeContractRequest) GetExecutionId() string { - if m != nil { - return m.ExecutionId - } - return "" -} - -func (m *MsgMemorializeContractRequest) GetContract() Contract { - if m != nil { - return m.Contract - } - return Contract{} -} - -func (m *MsgMemorializeContractRequest) GetSignatures() SignatureSet { - if m != nil { - return m.Signatures - } - return SignatureSet{} -} - -func (m *MsgMemorializeContractRequest) GetScopeRefID() string { - if m != nil { - return m.ScopeRefID - } - return "" -} - -func (m *MsgMemorializeContractRequest) GetNotary() string { - if m != nil { - return m.Notary - } - return "" -} - -// MemorializeContractResponse from a contract execution memorialization request -type MemorializeContractResponse struct { -} - -func (m *MemorializeContractResponse) Reset() { *m = MemorializeContractResponse{} } -func (m *MemorializeContractResponse) String() string { return proto.CompactTextString(m) } -func (*MemorializeContractResponse) ProtoMessage() {} -func (*MemorializeContractResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_67a0f042cc97a288, []int{1} -} -func (m *MemorializeContractResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MemorializeContractResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MemorializeContractResponse.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 *MemorializeContractResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MemorializeContractResponse.Merge(m, src) -} -func (m *MemorializeContractResponse) XXX_Size() int { - return m.Size() -} -func (m *MemorializeContractResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MemorializeContractResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MemorializeContractResponse proto.InternalMessageInfo - -// MsgChangeOwnershipRequest records the result of a change ownership p8e contract execution -type MsgChangeOwnershipRequest struct { - // The scope of the object being modified on blockchain. - ScopeId string `protobuf:"bytes,1,opt,name=scope_id,json=scopeId,proto3" json:"scope_id,omitempty"` - // The uuid of the contract execution. - GroupId string `protobuf:"bytes,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - // Unique identifier for determining contract/group execution instance - ExecutionId string `protobuf:"bytes,3,opt,name=execution_id,json=executionId,proto3" json:"execution_id,omitempty"` - // The recitals to use for the scope parties - Recitals Recitals `protobuf:"bytes,4,opt,name=recitals,proto3" json:"recitals"` - // The executed contract. - Contract Contract `protobuf:"bytes,5,opt,name=contract,proto3" json:"contract"` - // The contract signatures - Signatures SignatureSet `protobuf:"bytes,6,opt,name=signatures,proto3" json:"signatures"` - // The address of the notary (ie the broadcaster of this message). - Notary string `protobuf:"bytes,7,opt,name=notary,proto3" json:"notary,omitempty"` -} - -func (m *MsgChangeOwnershipRequest) Reset() { *m = MsgChangeOwnershipRequest{} } -func (m *MsgChangeOwnershipRequest) String() string { return proto.CompactTextString(m) } -func (*MsgChangeOwnershipRequest) ProtoMessage() {} -func (*MsgChangeOwnershipRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_67a0f042cc97a288, []int{2} -} -func (m *MsgChangeOwnershipRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgChangeOwnershipRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgChangeOwnershipRequest.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 *MsgChangeOwnershipRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgChangeOwnershipRequest.Merge(m, src) -} -func (m *MsgChangeOwnershipRequest) XXX_Size() int { - return m.Size() -} -func (m *MsgChangeOwnershipRequest) XXX_DiscardUnknown() { - xxx_messageInfo_MsgChangeOwnershipRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgChangeOwnershipRequest proto.InternalMessageInfo - -func (m *MsgChangeOwnershipRequest) GetScopeId() string { - if m != nil { - return m.ScopeId - } - return "" -} - -func (m *MsgChangeOwnershipRequest) GetGroupId() string { - if m != nil { - return m.GroupId - } - return "" -} - -func (m *MsgChangeOwnershipRequest) GetExecutionId() string { - if m != nil { - return m.ExecutionId - } - return "" -} - -func (m *MsgChangeOwnershipRequest) GetRecitals() Recitals { - if m != nil { - return m.Recitals - } - return Recitals{} -} - -func (m *MsgChangeOwnershipRequest) GetContract() Contract { - if m != nil { - return m.Contract - } - return Contract{} -} - -func (m *MsgChangeOwnershipRequest) GetSignatures() SignatureSet { - if m != nil { - return m.Signatures - } - return SignatureSet{} -} - -func (m *MsgChangeOwnershipRequest) GetNotary() string { - if m != nil { - return m.Notary - } - return "" -} - -// ChangeOwnershipResponse from a contract execution ownership change request -type ChangeOwnershipResponse struct { -} - -func (m *ChangeOwnershipResponse) Reset() { *m = ChangeOwnershipResponse{} } -func (m *ChangeOwnershipResponse) String() string { return proto.CompactTextString(m) } -func (*ChangeOwnershipResponse) ProtoMessage() {} -func (*ChangeOwnershipResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_67a0f042cc97a288, []int{3} -} -func (m *ChangeOwnershipResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ChangeOwnershipResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ChangeOwnershipResponse.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 *ChangeOwnershipResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChangeOwnershipResponse.Merge(m, src) -} -func (m *ChangeOwnershipResponse) XXX_Size() int { - return m.Size() -} -func (m *ChangeOwnershipResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ChangeOwnershipResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ChangeOwnershipResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgMemorializeContractRequest)(nil), "tx.MsgMemorializeContractRequest") - proto.RegisterType((*MemorializeContractResponse)(nil), "tx.MemorializeContractResponse") - proto.RegisterType((*MsgChangeOwnershipRequest)(nil), "tx.MsgChangeOwnershipRequest") - proto.RegisterType((*ChangeOwnershipResponse)(nil), "tx.ChangeOwnershipResponse") -} - -func init() { proto.RegisterFile("provenance/metadata/v0/tx.proto", fileDescriptor_67a0f042cc97a288) } - -var fileDescriptor_67a0f042cc97a288 = []byte{ - // 477 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x93, 0xc1, 0x6e, 0xd3, 0x30, - 0x18, 0xc7, 0x9b, 0x6e, 0xeb, 0x86, 0x87, 0x84, 0xe4, 0x21, 0x48, 0x3b, 0x35, 0xdd, 0x2a, 0x21, - 0xed, 0x42, 0x52, 0x6d, 0x5c, 0xc6, 0x71, 0xe3, 0xd2, 0x43, 0x04, 0x4a, 0x4f, 0x70, 0x41, 0x5e, - 0xf2, 0xe1, 0x5a, 0x6a, 0xed, 0xcc, 0x76, 0x42, 0xca, 0x53, 0xf0, 0x0a, 0x3c, 0x01, 0x07, 0x5e, - 0x62, 0xc7, 0x1d, 0x39, 0x21, 0xd4, 0xbe, 0x08, 0x8a, 0x93, 0x74, 0x85, 0x36, 0x48, 0x70, 0xd8, - 0x2d, 0x9f, 0xff, 0xff, 0xcf, 0xfe, 0xfc, 0x73, 0xfe, 0xa8, 0x17, 0x4b, 0x91, 0x02, 0x27, 0x3c, - 0x04, 0x6f, 0x0a, 0x9a, 0x44, 0x44, 0x13, 0x2f, 0x1d, 0x78, 0x3a, 0x73, 0x63, 0x29, 0xb4, 0xc0, - 0x4d, 0x9d, 0x75, 0x1e, 0x53, 0x41, 0x85, 0x29, 0xbd, 0xfc, 0xab, 0x50, 0x3a, 0xcf, 0x6a, 0x5a, - 0x43, 0xc1, 0xb5, 0x24, 0xa1, 0x2e, 0x6d, 0xfd, 0xba, 0x13, 0x66, 0x31, 0xa8, 0xc2, 0xd3, 0xff, - 0xd2, 0x44, 0x5d, 0x5f, 0x51, 0x1f, 0xa6, 0x42, 0x32, 0x32, 0x61, 0x9f, 0xe0, 0xb2, 0xdc, 0x24, - 0x80, 0xeb, 0x04, 0x94, 0xc6, 0x6d, 0xb4, 0xa7, 0x42, 0x11, 0xc3, 0x7b, 0x16, 0xd9, 0xd6, 0x91, - 0x75, 0xf2, 0x20, 0xd8, 0x35, 0xf5, 0x30, 0xca, 0x25, 0x2a, 0x45, 0x12, 0xe7, 0x52, 0xb3, 0x90, - 0x4c, 0x3d, 0x8c, 0xf0, 0x31, 0x7a, 0x08, 0x19, 0x84, 0x89, 0x66, 0x82, 0xe7, 0xf2, 0x96, 0x91, - 0xf7, 0x97, 0x6b, 0xc3, 0x08, 0xbf, 0x40, 0x7b, 0xd5, 0xc0, 0xf6, 0xf6, 0x91, 0x75, 0xb2, 0x7f, - 0x8a, 0xdd, 0xe5, 0x0d, 0xaa, 0x29, 0x2e, 0xb6, 0x6f, 0x7e, 0xf4, 0x1a, 0xc1, 0xd2, 0x89, 0xcf, - 0x11, 0x52, 0x8c, 0x72, 0xa2, 0x13, 0x09, 0xca, 0xde, 0x31, 0x7d, 0x07, 0x6e, 0x71, 0xa5, 0x51, - 0x25, 0x8c, 0xa0, 0x6a, 0x5c, 0x31, 0x63, 0x07, 0xa1, 0x51, 0x3e, 0x79, 0x00, 0x1f, 0x86, 0xaf, - 0xec, 0x96, 0x99, 0x68, 0x65, 0x05, 0x3f, 0x41, 0x2d, 0x2e, 0x34, 0x91, 0x33, 0x7b, 0xd7, 0x68, - 0x65, 0xd5, 0xef, 0xa2, 0xc3, 0x8d, 0x7c, 0x54, 0x2c, 0xb8, 0x82, 0xfe, 0xb7, 0x26, 0x6a, 0xfb, - 0x8a, 0x5e, 0x8e, 0x09, 0xa7, 0xf0, 0xfa, 0x23, 0x07, 0xa9, 0xc6, 0x2c, 0xbe, 0x0f, 0x7c, 0x12, - 0x42, 0xa6, 0xc9, 0x44, 0xad, 0xe3, 0x0b, 0x4a, 0xa5, 0xc2, 0x57, 0x39, 0x7f, 0x83, 0xbe, 0xf3, - 0x9f, 0xd0, 0x5b, 0xff, 0x02, 0xbd, 0x0e, 0x6a, 0x1b, 0x3d, 0x5d, 0x23, 0x56, 0x00, 0x3d, 0xfd, - 0x6a, 0xa1, 0x2d, 0x5f, 0x51, 0xfc, 0x16, 0x1d, 0x6c, 0xe0, 0x8e, 0x8f, 0x5d, 0x9d, 0xb9, 0x7f, - 0xfd, 0x67, 0x3b, 0x3d, 0x63, 0xa9, 0x7f, 0x33, 0xec, 0xa3, 0x47, 0x7f, 0x9c, 0x8e, 0xbb, 0xe5, - 0xb6, 0x9b, 0xdf, 0xb1, 0x73, 0x98, 0xcb, 0x35, 0x13, 0x5f, 0x5c, 0xdf, 0xcc, 0x1d, 0xeb, 0x76, - 0xee, 0x58, 0x3f, 0xe7, 0x8e, 0xf5, 0x79, 0xe1, 0x34, 0x6e, 0x17, 0x4e, 0xe3, 0xfb, 0xc2, 0x69, - 0xa0, 0x36, 0x33, 0xa1, 0x2d, 0x63, 0xe8, 0x56, 0x31, 0x74, 0xd3, 0xc1, 0x1b, 0xeb, 0xdd, 0x4b, - 0xca, 0xf4, 0x38, 0xb9, 0x72, 0x43, 0x31, 0xf5, 0xee, 0x4c, 0xcf, 0x99, 0x58, 0xa9, 0xbc, 0xec, - 0x2e, 0xbb, 0x13, 0xa0, 0x24, 0x9c, 0x79, 0xe9, 0xe0, 0xec, 0xfc, 0xaa, 0x65, 0xf2, 0x7b, 0xf6, - 0x2b, 0x00, 0x00, 0xff, 0xff, 0xce, 0xcd, 0x81, 0xdf, 0x47, 0x04, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// MsgClient is the client API for Msg service. -// -// 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 { - // MemorializeContract records the results of a P8e contract execution as a record group and set of records in a scope - MemorializeContract(ctx context.Context, in *MsgMemorializeContractRequest, opts ...grpc.CallOption) (*MemorializeContractResponse, error) - // ChangeOwnership allows P8e contracts to record a new set of owners on a scope - ChangeOwnership(ctx context.Context, in *MsgChangeOwnershipRequest, opts ...grpc.CallOption) (*ChangeOwnershipResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) MemorializeContract(ctx context.Context, in *MsgMemorializeContractRequest, opts ...grpc.CallOption) (*MemorializeContractResponse, error) { - out := new(MemorializeContractResponse) - err := c.cc.Invoke(ctx, "/tx.Msg/MemorializeContract", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) ChangeOwnership(ctx context.Context, in *MsgChangeOwnershipRequest, opts ...grpc.CallOption) (*ChangeOwnershipResponse, error) { - out := new(ChangeOwnershipResponse) - err := c.cc.Invoke(ctx, "/tx.Msg/ChangeOwnership", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // MemorializeContract records the results of a P8e contract execution as a record group and set of records in a scope - MemorializeContract(context.Context, *MsgMemorializeContractRequest) (*MemorializeContractResponse, error) - // ChangeOwnership allows P8e contracts to record a new set of owners on a scope - ChangeOwnership(context.Context, *MsgChangeOwnershipRequest) (*ChangeOwnershipResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) MemorializeContract(ctx context.Context, req *MsgMemorializeContractRequest) (*MemorializeContractResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MemorializeContract not implemented") -} -func (*UnimplementedMsgServer) ChangeOwnership(ctx context.Context, req *MsgChangeOwnershipRequest) (*ChangeOwnershipResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ChangeOwnership not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_MemorializeContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgMemorializeContractRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).MemorializeContract(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/tx.Msg/MemorializeContract", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).MemorializeContract(ctx, req.(*MsgMemorializeContractRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_ChangeOwnership_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgChangeOwnershipRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).ChangeOwnership(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/tx.Msg/ChangeOwnership", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ChangeOwnership(ctx, req.(*MsgChangeOwnershipRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "tx.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "MemorializeContract", - Handler: _Msg_MemorializeContract_Handler, - }, - { - MethodName: "ChangeOwnership", - Handler: _Msg_ChangeOwnership_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "provenance/metadata/v0/tx.proto", -} - -func (m *MsgMemorializeContractRequest) 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 *MsgMemorializeContractRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgMemorializeContractRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Notary) > 0 { - i -= len(m.Notary) - copy(dAtA[i:], m.Notary) - i = encodeVarintTx(dAtA, i, uint64(len(m.Notary))) - i-- - dAtA[i] = 0x3a - } - if len(m.ScopeRefID) > 0 { - i -= len(m.ScopeRefID) - copy(dAtA[i:], m.ScopeRefID) - i = encodeVarintTx(dAtA, i, uint64(len(m.ScopeRefID))) - i-- - dAtA[i] = 0x32 - } - { - size, err := m.Signatures.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - { - size, err := m.Contract.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if len(m.ExecutionId) > 0 { - i -= len(m.ExecutionId) - copy(dAtA[i:], m.ExecutionId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ExecutionId))) - i-- - dAtA[i] = 0x1a - } - if len(m.GroupId) > 0 { - i -= len(m.GroupId) - copy(dAtA[i:], m.GroupId) - i = encodeVarintTx(dAtA, i, uint64(len(m.GroupId))) - i-- - dAtA[i] = 0x12 - } - if len(m.ScopeId) > 0 { - i -= len(m.ScopeId) - copy(dAtA[i:], m.ScopeId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ScopeId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MemorializeContractResponse) 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 *MemorializeContractResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MemorializeContractResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgChangeOwnershipRequest) 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 *MsgChangeOwnershipRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgChangeOwnershipRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Notary) > 0 { - i -= len(m.Notary) - copy(dAtA[i:], m.Notary) - i = encodeVarintTx(dAtA, i, uint64(len(m.Notary))) - i-- - dAtA[i] = 0x3a - } - { - size, err := m.Signatures.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - { - size, err := m.Contract.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - { - size, err := m.Recitals.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if len(m.ExecutionId) > 0 { - i -= len(m.ExecutionId) - copy(dAtA[i:], m.ExecutionId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ExecutionId))) - i-- - dAtA[i] = 0x1a - } - if len(m.GroupId) > 0 { - i -= len(m.GroupId) - copy(dAtA[i:], m.GroupId) - i = encodeVarintTx(dAtA, i, uint64(len(m.GroupId))) - i-- - dAtA[i] = 0x12 - } - if len(m.ScopeId) > 0 { - i -= len(m.ScopeId) - copy(dAtA[i:], m.ScopeId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ScopeId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ChangeOwnershipResponse) 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 *ChangeOwnershipResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ChangeOwnershipResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MsgMemorializeContractRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ScopeId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.GroupId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ExecutionId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.Contract.Size() - n += 1 + l + sovTx(uint64(l)) - l = m.Signatures.Size() - n += 1 + l + sovTx(uint64(l)) - l = len(m.ScopeRefID) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Notary) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MemorializeContractResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgChangeOwnershipRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ScopeId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.GroupId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ExecutionId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.Recitals.Size() - n += 1 + l + sovTx(uint64(l)) - l = m.Contract.Size() - n += 1 + l + sovTx(uint64(l)) - l = m.Signatures.Size() - n += 1 + l + sovTx(uint64(l)) - l = len(m.Notary) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *ChangeOwnershipResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgMemorializeContractRequest) 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 ErrIntOverflowTx - } - 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: MsgMemorializeContractRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgMemorializeContractRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ScopeId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ScopeId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GroupId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.GroupId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutionId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ExecutionId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Contract", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Contract.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Signatures.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ScopeRefID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ScopeRefID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Notary", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Notary = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MemorializeContractResponse) 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 ErrIntOverflowTx - } - 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: MemorializeContractResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MemorializeContractResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgChangeOwnershipRequest) 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 ErrIntOverflowTx - } - 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: MsgChangeOwnershipRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgChangeOwnershipRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ScopeId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ScopeId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GroupId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.GroupId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutionId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ExecutionId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Recitals", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Recitals.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Contract", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Contract.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Signatures.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Notary", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Notary = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ChangeOwnershipResponse) 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 ErrIntOverflowTx - } - 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: ChangeOwnershipResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ChangeOwnershipResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTx(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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrInvalidLengthTx - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTx - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTx - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/metadata/legacy/v039/types.go b/x/metadata/legacy/v039/types.go deleted file mode 100644 index 24e26409b4..0000000000 --- a/x/metadata/legacy/v039/types.go +++ /dev/null @@ -1,47 +0,0 @@ -package v039 - -import ( - "fmt" - "strings" -) - -// GenesisState is the head state of all scopes with history. -type GenesisState struct { - ScopeRecords []Scope `json:"scope_records,omitempty"` - // NOTE: this comes from the v39 spec module that was merged in. The migrate step should copy this over - Specifications []ContractSpec `json:"specifications,omitempty"` -} - -// SpecGenesisState is a sequence of contract specs (from the deprecated spec module) -type SpecGenesisState struct { - ContractSpecRecords []ContractSpec `json:"contract_spec_records"` -} - -// Validate ensures the genesis state is valid. -func (state GenesisState) Validate() error { - for _, s := range state.ScopeRecords { - if err := ValidateScope(s); err != nil { - return err - } - } - return nil -} - -// ValidateScope ensures required scope fields are valid. -func ValidateScope(s Scope) error { - if s.Uuid == nil { - return fmt.Errorf("scope UUID cannot be nil") - } - if strings.TrimSpace(s.Uuid.Value) == "" { - return fmt.Errorf("scope UUID value cannot be empty") - } - if len(s.Parties) == 0 { - return fmt.Errorf("scope must have at least one party") - } - return nil -} - -// DefaultGenesisState returns a zero-value genesis state. -func DefaultGenesisState() GenesisState { - return GenesisState{} -} diff --git a/x/metadata/legacy/v039/types.pb.go b/x/metadata/legacy/v039/types.pb.go deleted file mode 100644 index 4e5d437e2c..0000000000 --- a/x/metadata/legacy/v039/types.pb.go +++ /dev/null @@ -1,3222 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: provenance/metadata/v0/types.proto - -package v039 - -import ( - fmt "fmt" - 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 PublicKeyType int32 - -const ( - PublicKeyType_ELLIPTIC PublicKeyType = 0 -) - -var PublicKeyType_name = map[int32]string{ - 0: "ELLIPTIC", -} - -var PublicKeyType_value = map[string]int32{ - "ELLIPTIC": 0, -} - -func (x PublicKeyType) String() string { - return proto.EnumName(PublicKeyType_name, int32(x)) -} - -func (PublicKeyType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_ac8a3eaef23a1ec9, []int{0} -} - -type PublicKeyCurve int32 - -const ( - PublicKeyCurve_SECP256K1 PublicKeyCurve = 0 - PublicKeyCurve_P256 PublicKeyCurve = 1 -) - -var PublicKeyCurve_name = map[int32]string{ - 0: "SECP256K1", - 1: "P256", -} - -var PublicKeyCurve_value = map[string]int32{ - "SECP256K1": 0, - "P256": 1, -} - -func (x PublicKeyCurve) String() string { - return proto.EnumName(PublicKeyCurve_name, int32(x)) -} - -func (PublicKeyCurve) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_ac8a3eaef23a1ec9, []int{1} -} - -type PartyType int32 - -const ( - PartyType_PARTY_TYPE_UNKNOWN PartyType = 0 - PartyType_PARTY_TYPE_ORIGINATOR PartyType = 1 - PartyType_PARTY_TYPE_SERVICER PartyType = 2 - PartyType_PARTY_TYPE_INVESTOR PartyType = 3 - PartyType_PARTY_TYPE_CUSTODIAN PartyType = 4 - PartyType_PARTY_TYPE_OWNER PartyType = 5 - PartyType_PARTY_TYPE_AFFILIATE PartyType = 6 - PartyType_PARTY_TYPE_OMNIBUS PartyType = 7 - PartyType_PARTY_TYPE_PROVENANCE PartyType = 8 - PartyType_PARTY_TYPE_MARKER PartyType = 9 -) - -var PartyType_name = map[int32]string{ - 0: "PARTY_TYPE_UNKNOWN", - 1: "PARTY_TYPE_ORIGINATOR", - 2: "PARTY_TYPE_SERVICER", - 3: "PARTY_TYPE_INVESTOR", - 4: "PARTY_TYPE_CUSTODIAN", - 5: "PARTY_TYPE_OWNER", - 6: "PARTY_TYPE_AFFILIATE", - 7: "PARTY_TYPE_OMNIBUS", - 8: "PARTY_TYPE_PROVENANCE", - 9: "PARTY_TYPE_MARKER", -} - -var PartyType_value = map[string]int32{ - "PARTY_TYPE_UNKNOWN": 0, - "PARTY_TYPE_ORIGINATOR": 1, - "PARTY_TYPE_SERVICER": 2, - "PARTY_TYPE_INVESTOR": 3, - "PARTY_TYPE_CUSTODIAN": 4, - "PARTY_TYPE_OWNER": 5, - "PARTY_TYPE_AFFILIATE": 6, - "PARTY_TYPE_OMNIBUS": 7, - "PARTY_TYPE_PROVENANCE": 8, - "PARTY_TYPE_MARKER": 9, -} - -func (x PartyType) String() string { - return proto.EnumName(PartyType_name, int32(x)) -} - -func (PartyType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_ac8a3eaef23a1ec9, []int{2} -} - -// Wrapper for an ISO8601 date string. EX: "2020-05-22" -type Date struct { - Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *Date) Reset() { *m = Date{} } -func (m *Date) String() string { return proto.CompactTextString(m) } -func (*Date) ProtoMessage() {} -func (*Date) Descriptor() ([]byte, []int) { - return fileDescriptor_ac8a3eaef23a1ec9, []int{0} -} -func (m *Date) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Date) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Date.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 *Date) XXX_Merge(src proto.Message) { - xxx_messageInfo_Date.Merge(m, src) -} -func (m *Date) XXX_Size() int { - return m.Size() -} -func (m *Date) XXX_DiscardUnknown() { - xxx_messageInfo_Date.DiscardUnknown(m) -} - -var xxx_messageInfo_Date proto.InternalMessageInfo - -func (m *Date) GetValue() string { - if m != nil { - return m.Value - } - return "" -} - -// Wrapper type for a standard uuid. -type UUID struct { - Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *UUID) Reset() { *m = UUID{} } -func (m *UUID) String() string { return proto.CompactTextString(m) } -func (*UUID) ProtoMessage() {} -func (*UUID) Descriptor() ([]byte, []int) { - return fileDescriptor_ac8a3eaef23a1ec9, []int{1} -} -func (m *UUID) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UUID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UUID.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 *UUID) XXX_Merge(src proto.Message) { - xxx_messageInfo_UUID.Merge(m, src) -} -func (m *UUID) XXX_Size() int { - return m.Size() -} -func (m *UUID) XXX_DiscardUnknown() { - xxx_messageInfo_UUID.DiscardUnknown(m) -} - -var xxx_messageInfo_UUID proto.InternalMessageInfo - -func (m *UUID) GetValue() string { - if m != nil { - return m.Value - } - return "" -} - -// Wrap a boolean result type. -type BooleanResult struct { - Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *BooleanResult) Reset() { *m = BooleanResult{} } -func (m *BooleanResult) String() string { return proto.CompactTextString(m) } -func (*BooleanResult) ProtoMessage() {} -func (*BooleanResult) Descriptor() ([]byte, []int) { - return fileDescriptor_ac8a3eaef23a1ec9, []int{2} -} -func (m *BooleanResult) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BooleanResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BooleanResult.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 *BooleanResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_BooleanResult.Merge(m, src) -} -func (m *BooleanResult) XXX_Size() int { - return m.Size() -} -func (m *BooleanResult) XXX_DiscardUnknown() { - xxx_messageInfo_BooleanResult.DiscardUnknown(m) -} - -var xxx_messageInfo_BooleanResult proto.InternalMessageInfo - -func (m *BooleanResult) GetValue() bool { - if m != nil { - return m.Value - } - return false -} - -// Wrap a location. -type Location struct { - Ref *ProvenanceReference `protobuf:"bytes,1,opt,name=ref,proto3" json:"ref,omitempty"` - Classname string `protobuf:"bytes,2,opt,name=classname,proto3" json:"classname,omitempty"` -} - -func (m *Location) Reset() { *m = Location{} } -func (m *Location) String() string { return proto.CompactTextString(m) } -func (*Location) ProtoMessage() {} -func (*Location) Descriptor() ([]byte, []int) { - return fileDescriptor_ac8a3eaef23a1ec9, []int{3} -} -func (m *Location) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Location) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Location.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 *Location) XXX_Merge(src proto.Message) { - xxx_messageInfo_Location.Merge(m, src) -} -func (m *Location) XXX_Size() int { - return m.Size() -} -func (m *Location) XXX_DiscardUnknown() { - xxx_messageInfo_Location.DiscardUnknown(m) -} - -var xxx_messageInfo_Location proto.InternalMessageInfo - -func (m *Location) GetRef() *ProvenanceReference { - if m != nil { - return m.Ref - } - return nil -} - -func (m *Location) GetClassname() string { - if m != nil { - return m.Classname - } - return "" -} - -// Wrap a factual data element. -type Fact struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - DataLocation *Location `protobuf:"bytes,2,opt,name=data_location,json=dataLocation,proto3" json:"data_location,omitempty"` -} - -func (m *Fact) Reset() { *m = Fact{} } -func (m *Fact) String() string { return proto.CompactTextString(m) } -func (*Fact) ProtoMessage() {} -func (*Fact) Descriptor() ([]byte, []int) { - return fileDescriptor_ac8a3eaef23a1ec9, []int{4} -} -func (m *Fact) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Fact) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Fact.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 *Fact) XXX_Merge(src proto.Message) { - xxx_messageInfo_Fact.Merge(m, src) -} -func (m *Fact) XXX_Size() int { - return m.Size() -} -func (m *Fact) XXX_DiscardUnknown() { - xxx_messageInfo_Fact.DiscardUnknown(m) -} - -var xxx_messageInfo_Fact proto.InternalMessageInfo - -func (m *Fact) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Fact) GetDataLocation() *Location { - if m != nil { - return m.DataLocation - } - return nil -} - -type ProvenanceReference struct { - // [Req] [Scope.uuid] - // Scope ID - ScopeUuid *UUID `protobuf:"bytes,1,opt,name=scope_uuid,json=scopeUuid,proto3" json:"scope_uuid,omitempty"` - // [Opt] [RecordGroup.group_uuid] - // require record to be within a specific group - GroupUuid *UUID `protobuf:"bytes,2,opt,name=group_uuid,json=groupUuid,proto3" json:"group_uuid,omitempty"` - // [Opt] [Record.result_hash] - // specify a specific record inside a scope (and group) by result-hash - Hash string `protobuf:"bytes,3,opt,name=hash,proto3" json:"hash,omitempty"` - // [Opt] [Record.result_name] - // specify a result-name of a record within a scope - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` -} - -func (m *ProvenanceReference) Reset() { *m = ProvenanceReference{} } -func (m *ProvenanceReference) String() string { return proto.CompactTextString(m) } -func (*ProvenanceReference) ProtoMessage() {} -func (*ProvenanceReference) Descriptor() ([]byte, []int) { - return fileDescriptor_ac8a3eaef23a1ec9, []int{5} -} -func (m *ProvenanceReference) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProvenanceReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProvenanceReference.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 *ProvenanceReference) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProvenanceReference.Merge(m, src) -} -func (m *ProvenanceReference) XXX_Size() int { - return m.Size() -} -func (m *ProvenanceReference) XXX_DiscardUnknown() { - xxx_messageInfo_ProvenanceReference.DiscardUnknown(m) -} - -var xxx_messageInfo_ProvenanceReference proto.InternalMessageInfo - -func (m *ProvenanceReference) GetScopeUuid() *UUID { - if m != nil { - return m.ScopeUuid - } - return nil -} - -func (m *ProvenanceReference) GetGroupUuid() *UUID { - if m != nil { - return m.GroupUuid - } - return nil -} - -func (m *ProvenanceReference) GetHash() string { - if m != nil { - return m.Hash - } - return "" -} - -func (m *ProvenanceReference) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -// Wrapper around a standard signature. -type Signature struct { - // Signature Detail - Algo string `protobuf:"bytes,1,opt,name=algo,proto3" json:"algo,omitempty"` - Provider string `protobuf:"bytes,2,opt,name=provider,proto3" json:"provider,omitempty"` - Signature string `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` - // Identity of signer - Signer *SigningAndEncryptionPublicKeys `protobuf:"bytes,4,opt,name=signer,proto3" json:"signer,omitempty"` -} - -func (m *Signature) Reset() { *m = Signature{} } -func (m *Signature) String() string { return proto.CompactTextString(m) } -func (*Signature) ProtoMessage() {} -func (*Signature) Descriptor() ([]byte, []int) { - return fileDescriptor_ac8a3eaef23a1ec9, []int{6} -} -func (m *Signature) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Signature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Signature.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 *Signature) XXX_Merge(src proto.Message) { - xxx_messageInfo_Signature.Merge(m, src) -} -func (m *Signature) XXX_Size() int { - return m.Size() -} -func (m *Signature) XXX_DiscardUnknown() { - xxx_messageInfo_Signature.DiscardUnknown(m) -} - -var xxx_messageInfo_Signature proto.InternalMessageInfo - -func (m *Signature) GetAlgo() string { - if m != nil { - return m.Algo - } - return "" -} - -func (m *Signature) GetProvider() string { - if m != nil { - return m.Provider - } - return "" -} - -func (m *Signature) GetSignature() string { - if m != nil { - return m.Signature - } - return "" -} - -func (m *Signature) GetSigner() *SigningAndEncryptionPublicKeys { - if m != nil { - return m.Signer - } - return nil -} - -// A collection of signatures -type SignatureSet struct { - Signatures []*Signature `protobuf:"bytes,1,rep,name=signatures,proto3" json:"signatures,omitempty"` -} - -func (m *SignatureSet) Reset() { *m = SignatureSet{} } -func (m *SignatureSet) String() string { return proto.CompactTextString(m) } -func (*SignatureSet) ProtoMessage() {} -func (*SignatureSet) Descriptor() ([]byte, []int) { - return fileDescriptor_ac8a3eaef23a1ec9, []int{7} -} -func (m *SignatureSet) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SignatureSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SignatureSet.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 *SignatureSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignatureSet.Merge(m, src) -} -func (m *SignatureSet) XXX_Size() int { - return m.Size() -} -func (m *SignatureSet) XXX_DiscardUnknown() { - xxx_messageInfo_SignatureSet.DiscardUnknown(m) -} - -var xxx_messageInfo_SignatureSet proto.InternalMessageInfo - -func (m *SignatureSet) GetSignatures() []*Signature { - if m != nil { - return m.Signatures - } - return nil -} - -type PublicKey struct { - PublicKeyBytes []byte `protobuf:"bytes,1,opt,name=public_key_bytes,json=publicKeyBytes,proto3" json:"public_key_bytes,omitempty"` - Type PublicKeyType `protobuf:"varint,2,opt,name=type,proto3,enum=types.PublicKeyType" json:"type,omitempty"` - Curve PublicKeyCurve `protobuf:"varint,3,opt,name=curve,proto3,enum=types.PublicKeyCurve" json:"curve,omitempty"` -} - -func (m *PublicKey) Reset() { *m = PublicKey{} } -func (m *PublicKey) String() string { return proto.CompactTextString(m) } -func (*PublicKey) ProtoMessage() {} -func (*PublicKey) Descriptor() ([]byte, []int) { - return fileDescriptor_ac8a3eaef23a1ec9, []int{8} -} -func (m *PublicKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PublicKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PublicKey.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 *PublicKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_PublicKey.Merge(m, src) -} -func (m *PublicKey) XXX_Size() int { - return m.Size() -} -func (m *PublicKey) XXX_DiscardUnknown() { - xxx_messageInfo_PublicKey.DiscardUnknown(m) -} - -var xxx_messageInfo_PublicKey proto.InternalMessageInfo - -func (m *PublicKey) GetPublicKeyBytes() []byte { - if m != nil { - return m.PublicKeyBytes - } - return nil -} - -func (m *PublicKey) GetType() PublicKeyType { - if m != nil { - return m.Type - } - return PublicKeyType_ELLIPTIC -} - -func (m *PublicKey) GetCurve() PublicKeyCurve { - if m != nil { - return m.Curve - } - return PublicKeyCurve_SECP256K1 -} - -type SigningAndEncryptionPublicKeys struct { - SigningPublicKey *PublicKey `protobuf:"bytes,1,opt,name=signing_public_key,json=signingPublicKey,proto3" json:"signing_public_key,omitempty"` - EncryptionPublicKey *PublicKey `protobuf:"bytes,2,opt,name=encryption_public_key,json=encryptionPublicKey,proto3" json:"encryption_public_key,omitempty"` -} - -func (m *SigningAndEncryptionPublicKeys) Reset() { *m = SigningAndEncryptionPublicKeys{} } -func (m *SigningAndEncryptionPublicKeys) String() string { return proto.CompactTextString(m) } -func (*SigningAndEncryptionPublicKeys) ProtoMessage() {} -func (*SigningAndEncryptionPublicKeys) Descriptor() ([]byte, []int) { - return fileDescriptor_ac8a3eaef23a1ec9, []int{9} -} -func (m *SigningAndEncryptionPublicKeys) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SigningAndEncryptionPublicKeys) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SigningAndEncryptionPublicKeys.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 *SigningAndEncryptionPublicKeys) XXX_Merge(src proto.Message) { - xxx_messageInfo_SigningAndEncryptionPublicKeys.Merge(m, src) -} -func (m *SigningAndEncryptionPublicKeys) XXX_Size() int { - return m.Size() -} -func (m *SigningAndEncryptionPublicKeys) XXX_DiscardUnknown() { - xxx_messageInfo_SigningAndEncryptionPublicKeys.DiscardUnknown(m) -} - -var xxx_messageInfo_SigningAndEncryptionPublicKeys proto.InternalMessageInfo - -func (m *SigningAndEncryptionPublicKeys) GetSigningPublicKey() *PublicKey { - if m != nil { - return m.SigningPublicKey - } - return nil -} - -func (m *SigningAndEncryptionPublicKeys) GetEncryptionPublicKey() *PublicKey { - if m != nil { - return m.EncryptionPublicKey - } - return nil -} - -// Audit -type AuditFields struct { - CreatedDate *GogoTimeHack `protobuf:"bytes,1,opt,name=created_date,json=createdDate,proto3" json:"created_date,omitempty"` - CreatedBy string `protobuf:"bytes,2,opt,name=created_by,json=createdBy,proto3" json:"created_by,omitempty"` - UpdatedDate *GogoTimeHack `protobuf:"bytes,3,opt,name=updated_date,json=updatedDate,proto3" json:"updated_date,omitempty"` - UpdatedBy string `protobuf:"bytes,4,opt,name=updated_by,json=updatedBy,proto3" json:"updated_by,omitempty"` - Version int32 `protobuf:"varint,5,opt,name=version,proto3" json:"version,omitempty"` - Message string `protobuf:"bytes,6,opt,name=message,proto3" json:"message,omitempty"` -} - -func (m *AuditFields) Reset() { *m = AuditFields{} } -func (m *AuditFields) String() string { return proto.CompactTextString(m) } -func (*AuditFields) ProtoMessage() {} -func (*AuditFields) Descriptor() ([]byte, []int) { - return fileDescriptor_ac8a3eaef23a1ec9, []int{10} -} -func (m *AuditFields) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuditFields) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuditFields.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 *AuditFields) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuditFields.Merge(m, src) -} -func (m *AuditFields) XXX_Size() int { - return m.Size() -} -func (m *AuditFields) XXX_DiscardUnknown() { - xxx_messageInfo_AuditFields.DiscardUnknown(m) -} - -var xxx_messageInfo_AuditFields proto.InternalMessageInfo - -func (m *AuditFields) GetCreatedDate() *GogoTimeHack { - if m != nil { - return m.CreatedDate - } - return nil -} - -func (m *AuditFields) GetCreatedBy() string { - if m != nil { - return m.CreatedBy - } - return "" -} - -func (m *AuditFields) GetUpdatedDate() *GogoTimeHack { - if m != nil { - return m.UpdatedDate - } - return nil -} - -func (m *AuditFields) GetUpdatedBy() string { - if m != nil { - return m.UpdatedBy - } - return "" -} - -func (m *AuditFields) GetVersion() int32 { - if m != nil { - return m.Version - } - return 0 -} - -func (m *AuditFields) GetMessage() string { - if m != nil { - return m.Message - } - return "" -} - -// proto 3 timestamp structure (hack to get around gogo issues with invalid dates) -type GogoTimeHack struct { - Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"` - Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"` -} - -func (m *GogoTimeHack) Reset() { *m = GogoTimeHack{} } -func (m *GogoTimeHack) String() string { return proto.CompactTextString(m) } -func (*GogoTimeHack) ProtoMessage() {} -func (*GogoTimeHack) Descriptor() ([]byte, []int) { - return fileDescriptor_ac8a3eaef23a1ec9, []int{11} -} -func (m *GogoTimeHack) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GogoTimeHack) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GogoTimeHack.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 *GogoTimeHack) XXX_Merge(src proto.Message) { - xxx_messageInfo_GogoTimeHack.Merge(m, src) -} -func (m *GogoTimeHack) XXX_Size() int { - return m.Size() -} -func (m *GogoTimeHack) XXX_DiscardUnknown() { - xxx_messageInfo_GogoTimeHack.DiscardUnknown(m) -} - -var xxx_messageInfo_GogoTimeHack proto.InternalMessageInfo - -func (m *GogoTimeHack) GetSeconds() int64 { - if m != nil { - return m.Seconds - } - return 0 -} - -func (m *GogoTimeHack) GetNanos() int32 { - if m != nil { - return m.Nanos - } - return 0 -} - -func init() { - proto.RegisterEnum("types.PublicKeyType", PublicKeyType_name, PublicKeyType_value) - proto.RegisterEnum("types.PublicKeyCurve", PublicKeyCurve_name, PublicKeyCurve_value) - proto.RegisterEnum("types.PartyType", PartyType_name, PartyType_value) - proto.RegisterType((*Date)(nil), "types.Date") - proto.RegisterType((*UUID)(nil), "types.UUID") - proto.RegisterType((*BooleanResult)(nil), "types.BooleanResult") - proto.RegisterType((*Location)(nil), "types.Location") - proto.RegisterType((*Fact)(nil), "types.Fact") - proto.RegisterType((*ProvenanceReference)(nil), "types.ProvenanceReference") - proto.RegisterType((*Signature)(nil), "types.Signature") - proto.RegisterType((*SignatureSet)(nil), "types.SignatureSet") - proto.RegisterType((*PublicKey)(nil), "types.PublicKey") - proto.RegisterType((*SigningAndEncryptionPublicKeys)(nil), "types.SigningAndEncryptionPublicKeys") - proto.RegisterType((*AuditFields)(nil), "types.AuditFields") - proto.RegisterType((*GogoTimeHack)(nil), "types.GogoTimeHack") -} - -func init() { - proto.RegisterFile("provenance/metadata/v0/types.proto", fileDescriptor_ac8a3eaef23a1ec9) -} - -var fileDescriptor_ac8a3eaef23a1ec9 = []byte{ - // 911 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x55, 0xcd, 0x6e, 0xdb, 0x46, - 0x10, 0x16, 0xf5, 0xe3, 0x48, 0x23, 0xd9, 0x65, 0xd7, 0x76, 0xab, 0x04, 0x89, 0x60, 0x10, 0x08, - 0xa0, 0xba, 0xad, 0xe4, 0x2a, 0x6d, 0x80, 0x16, 0x68, 0x50, 0x4a, 0xa6, 0x53, 0xc2, 0x0e, 0x45, - 0xac, 0x24, 0x07, 0xe9, 0x45, 0x58, 0x91, 0x1b, 0x99, 0x08, 0x45, 0xb2, 0xfc, 0x11, 0xca, 0x7b, - 0x8f, 0x3d, 0xf4, 0x52, 0xa0, 0x4f, 0xd0, 0x67, 0xe9, 0x31, 0xc7, 0x1e, 0x0b, 0xfb, 0x01, 0xfa, - 0x0a, 0xc5, 0x2e, 0x49, 0x91, 0x56, 0x12, 0xdf, 0x76, 0xe6, 0xfb, 0xe6, 0x9b, 0x6f, 0x56, 0x43, - 0x2d, 0x48, 0x9e, 0xef, 0xae, 0xa9, 0x43, 0x1c, 0x83, 0xf6, 0x57, 0x34, 0x24, 0x26, 0x09, 0x49, - 0x7f, 0x7d, 0xd2, 0x0f, 0x63, 0x8f, 0x06, 0x3d, 0xcf, 0x77, 0x43, 0x17, 0xd5, 0x78, 0x20, 0x3d, - 0x84, 0xea, 0x29, 0x09, 0x29, 0x3a, 0x80, 0xda, 0x9a, 0xd8, 0x11, 0x6d, 0x0b, 0x47, 0x42, 0xb7, - 0x81, 0x93, 0x80, 0xa1, 0xb3, 0x99, 0x7a, 0xfa, 0x01, 0xf4, 0x31, 0xec, 0x0e, 0x5d, 0xd7, 0xa6, - 0xc4, 0xc1, 0x34, 0x88, 0xec, 0xf0, 0x36, 0xad, 0x9e, 0xd1, 0x2e, 0xa1, 0x7e, 0xe1, 0x1a, 0x24, - 0xb4, 0x5c, 0x07, 0x7d, 0x01, 0x15, 0x9f, 0xbe, 0xe6, 0x78, 0x73, 0xf0, 0xa0, 0x97, 0x18, 0xd2, - 0x37, 0x6e, 0x31, 0x7d, 0x4d, 0x7d, 0xca, 0x0e, 0x8c, 0x86, 0x1e, 0x42, 0xc3, 0xb0, 0x49, 0x10, - 0x38, 0x64, 0x45, 0xdb, 0x65, 0xde, 0x3a, 0x4f, 0x48, 0x3a, 0x54, 0xcf, 0x88, 0x11, 0x22, 0x04, - 0x55, 0x4e, 0x48, 0xbc, 0xf1, 0x33, 0xfa, 0x1a, 0x76, 0xd9, 0xd0, 0x73, 0x3b, 0x6d, 0xcc, 0xab, - 0x9b, 0x83, 0x8f, 0xd2, 0x8e, 0x99, 0x1f, 0xdc, 0x62, 0xac, 0x2c, 0x92, 0xfe, 0x10, 0x60, 0xff, - 0x3d, 0x66, 0xd0, 0x31, 0x40, 0x60, 0xb8, 0x1e, 0x9d, 0x47, 0x91, 0x65, 0xa6, 0xe6, 0x9b, 0xa9, - 0x14, 0xbb, 0x1f, 0xdc, 0xe0, 0xf0, 0x2c, 0xb2, 0x4c, 0xc6, 0x5d, 0xfa, 0x6e, 0xe4, 0x25, 0xdc, - 0xf2, 0x7b, 0xb8, 0x1c, 0xe6, 0x5c, 0x04, 0xd5, 0x2b, 0x12, 0x5c, 0xb5, 0x2b, 0x89, 0x73, 0x76, - 0xde, 0x4c, 0x53, 0xcd, 0xa7, 0x91, 0xfe, 0x14, 0xa0, 0x31, 0xb1, 0x96, 0x0e, 0x09, 0x23, 0x9f, - 0x32, 0x06, 0xb1, 0x97, 0x6e, 0x36, 0x2f, 0x3b, 0xa3, 0x07, 0x50, 0x67, 0xbf, 0xb9, 0x65, 0x52, - 0x3f, 0xbd, 0xa8, 0x4d, 0xcc, 0x6e, 0x31, 0xc8, 0x8a, 0xd3, 0x56, 0x79, 0x02, 0x7d, 0x0f, 0x3b, - 0x2c, 0xa0, 0x3e, 0xef, 0xd8, 0x1c, 0x3c, 0x4e, 0xbd, 0xb2, 0x7e, 0x96, 0xb3, 0x94, 0x1d, 0x53, - 0x71, 0x0c, 0x3f, 0xf6, 0xd8, 0x05, 0xe9, 0xd1, 0xc2, 0xb6, 0x8c, 0x73, 0x1a, 0x07, 0x38, 0x2d, - 0x92, 0x7e, 0x80, 0xd6, 0xc6, 0xd9, 0x84, 0x86, 0xe8, 0x04, 0x60, 0xa3, 0x1d, 0xb4, 0x85, 0xa3, - 0x4a, 0xb7, 0x39, 0x10, 0x0b, 0x92, 0x1c, 0xc0, 0x05, 0x8e, 0xf4, 0x9b, 0x00, 0x8d, 0x8d, 0x30, - 0xea, 0x82, 0xe8, 0xf1, 0x60, 0xfe, 0x86, 0xc6, 0xf3, 0x45, 0x1c, 0x72, 0x15, 0xa1, 0xdb, 0xc2, - 0x7b, 0x5e, 0x46, 0x1a, 0xb2, 0x2c, 0xea, 0x42, 0x95, 0xc9, 0xf2, 0x71, 0xf7, 0x06, 0x07, 0xd9, - 0x2e, 0x65, 0xa4, 0x69, 0xec, 0x51, 0xcc, 0x19, 0xe8, 0x73, 0xa8, 0x19, 0x91, 0xbf, 0x4e, 0x86, - 0xdf, 0x1b, 0x1c, 0x6e, 0x53, 0x47, 0x0c, 0xc4, 0x09, 0x47, 0xfa, 0x4b, 0x80, 0xce, 0xdd, 0xb3, - 0xa3, 0x67, 0x80, 0x82, 0x84, 0x31, 0xcf, 0xbd, 0xa6, 0x6b, 0x21, 0x6e, 0x8b, 0x63, 0x31, 0xe5, - 0xe6, 0x33, 0x9e, 0xc2, 0x21, 0xdd, 0xe8, 0x16, 0x25, 0xca, 0x1f, 0x90, 0xd8, 0xa7, 0xef, 0xda, - 0x90, 0xfe, 0x13, 0xa0, 0x29, 0x47, 0xa6, 0x15, 0x9e, 0x59, 0xd4, 0x36, 0x03, 0xf4, 0x14, 0x5a, - 0x86, 0x4f, 0x49, 0x48, 0xcd, 0xb9, 0x49, 0x42, 0x9a, 0xfa, 0xd9, 0x4f, 0xc5, 0x9e, 0xbb, 0x4b, - 0x77, 0x6a, 0xad, 0xe8, 0x8f, 0xc4, 0x78, 0x83, 0x9b, 0x29, 0x91, 0x7f, 0xf9, 0x8f, 0x00, 0xb2, - 0xba, 0x45, 0xbc, 0xf9, 0xca, 0x92, 0xcc, 0x30, 0x66, 0xb2, 0x91, 0x67, 0xe6, 0xb2, 0x95, 0x3b, - 0x64, 0x53, 0x62, 0x26, 0x9b, 0xd5, 0x2d, 0xe2, 0x74, 0x9b, 0x1b, 0x69, 0x66, 0x18, 0xa3, 0x36, - 0xdc, 0x5b, 0x53, 0x3f, 0x60, 0x9f, 0x66, 0xed, 0x48, 0xe8, 0xd6, 0x70, 0x16, 0x32, 0x64, 0x45, - 0x83, 0x80, 0x2c, 0x69, 0x7b, 0x87, 0x57, 0x65, 0xa1, 0xf4, 0x0c, 0x5a, 0xc5, 0x7e, 0x8c, 0x19, - 0x50, 0xc3, 0x75, 0xcc, 0x64, 0x45, 0x2a, 0x38, 0x0b, 0xd9, 0x1f, 0x91, 0x43, 0x1c, 0x37, 0xe0, - 0xe3, 0xd4, 0x70, 0x12, 0x1c, 0x3f, 0x82, 0xdd, 0x5b, 0xeb, 0x81, 0x5a, 0x50, 0x57, 0x2e, 0x2e, - 0x54, 0x7d, 0xaa, 0x8e, 0xc4, 0xd2, 0xf1, 0x67, 0xb0, 0x77, 0x7b, 0x25, 0xd0, 0x2e, 0x34, 0x26, - 0xca, 0x48, 0x1f, 0x7c, 0xf3, 0xf4, 0xfc, 0x2b, 0xb1, 0x84, 0xea, 0x50, 0x65, 0x67, 0x51, 0x38, - 0xfe, 0xb5, 0x0c, 0x0d, 0x9d, 0xf8, 0x61, 0x22, 0xf3, 0x09, 0x20, 0x5d, 0xc6, 0xd3, 0x57, 0xf3, - 0xe9, 0x2b, 0x5d, 0x99, 0xcf, 0xb4, 0x73, 0x6d, 0xfc, 0x52, 0x13, 0x4b, 0xe8, 0x3e, 0x1c, 0x16, - 0xf2, 0x63, 0xac, 0x3e, 0x57, 0x35, 0x79, 0x3a, 0xc6, 0xa2, 0x80, 0x3e, 0x85, 0xfd, 0x02, 0x34, - 0x51, 0xf0, 0xa5, 0x3a, 0x52, 0xb0, 0x58, 0xde, 0x02, 0x54, 0xed, 0x52, 0x99, 0xb0, 0x8a, 0x0a, - 0x6a, 0xc3, 0x41, 0x01, 0x18, 0xcd, 0x26, 0xd3, 0xf1, 0xa9, 0x2a, 0x6b, 0x62, 0x15, 0x1d, 0x80, - 0x58, 0x6c, 0xf3, 0x52, 0x53, 0xb0, 0x58, 0xdb, 0xe2, 0xcb, 0x67, 0x67, 0xea, 0x85, 0x2a, 0x4f, - 0x15, 0x71, 0x67, 0xcb, 0xee, 0xf8, 0x85, 0xa6, 0x0e, 0x67, 0x13, 0xf1, 0xde, 0x96, 0x5d, 0x1d, - 0x8f, 0x2f, 0x15, 0x4d, 0xd6, 0x46, 0x8a, 0x58, 0x47, 0x87, 0xf0, 0x71, 0x01, 0x7a, 0x21, 0xe3, - 0x73, 0x05, 0x8b, 0x8d, 0xe1, 0xcf, 0x7f, 0x5f, 0x77, 0x84, 0xb7, 0xd7, 0x1d, 0xe1, 0xdf, 0xeb, - 0x8e, 0xf0, 0xfb, 0x4d, 0xa7, 0xf4, 0xf6, 0xa6, 0x53, 0xfa, 0xe7, 0xa6, 0x53, 0x82, 0xfb, 0x96, - 0xdb, 0xcb, 0x1f, 0xa1, 0x5e, 0xf6, 0x08, 0xf5, 0xd6, 0x27, 0xba, 0xf0, 0xd3, 0x77, 0x4b, 0x2b, - 0xbc, 0x8a, 0x16, 0x3d, 0xc3, 0x5d, 0xf5, 0x73, 0xd2, 0x97, 0x96, 0x5b, 0x88, 0xfa, 0xbf, 0xe4, - 0x2f, 0x97, 0x4d, 0x97, 0xc4, 0x88, 0xfb, 0xeb, 0x93, 0x27, 0xdf, 0x2e, 0x76, 0xf8, 0xeb, 0xf5, - 0xe4, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xaa, 0x37, 0x01, 0x13, 0xe3, 0x06, 0x00, 0x00, -} - -func (m *Date) 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 *Date) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Date) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UUID) 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 *UUID) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UUID) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *BooleanResult) 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 *BooleanResult) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BooleanResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Value { - i-- - if m.Value { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Location) 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 *Location) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Location) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Classname) > 0 { - i -= len(m.Classname) - copy(dAtA[i:], m.Classname) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Classname))) - i-- - dAtA[i] = 0x12 - } - if m.Ref != nil { - { - size, err := m.Ref.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Fact) 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 *Fact) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Fact) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.DataLocation != nil { - { - size, err := m.DataLocation.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ProvenanceReference) 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 *ProvenanceReference) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProvenanceReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x22 - } - if len(m.Hash) > 0 { - i -= len(m.Hash) - copy(dAtA[i:], m.Hash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) - i-- - dAtA[i] = 0x1a - } - if m.GroupUuid != nil { - { - size, err := m.GroupUuid.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.ScopeUuid != nil { - { - size, err := m.ScopeUuid.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Signature) 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 *Signature) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Signature) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Signer != nil { - { - size, err := m.Signer.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if len(m.Signature) > 0 { - i -= len(m.Signature) - copy(dAtA[i:], m.Signature) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Signature))) - i-- - dAtA[i] = 0x1a - } - if len(m.Provider) > 0 { - i -= len(m.Provider) - copy(dAtA[i:], m.Provider) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Provider))) - i-- - dAtA[i] = 0x12 - } - if len(m.Algo) > 0 { - i -= len(m.Algo) - copy(dAtA[i:], m.Algo) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Algo))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SignatureSet) 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 *SignatureSet) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SignatureSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signatures) > 0 { - for iNdEx := len(m.Signatures) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Signatures[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *PublicKey) 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 *PublicKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PublicKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Curve != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Curve)) - i-- - dAtA[i] = 0x18 - } - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x10 - } - if len(m.PublicKeyBytes) > 0 { - i -= len(m.PublicKeyBytes) - copy(dAtA[i:], m.PublicKeyBytes) - i = encodeVarintTypes(dAtA, i, uint64(len(m.PublicKeyBytes))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SigningAndEncryptionPublicKeys) 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 *SigningAndEncryptionPublicKeys) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SigningAndEncryptionPublicKeys) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.EncryptionPublicKey != nil { - { - size, err := m.EncryptionPublicKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.SigningPublicKey != nil { - { - size, err := m.SigningPublicKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuditFields) 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 *AuditFields) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuditFields) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Message) > 0 { - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) - i-- - dAtA[i] = 0x32 - } - if m.Version != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Version)) - i-- - dAtA[i] = 0x28 - } - if len(m.UpdatedBy) > 0 { - i -= len(m.UpdatedBy) - copy(dAtA[i:], m.UpdatedBy) - i = encodeVarintTypes(dAtA, i, uint64(len(m.UpdatedBy))) - i-- - dAtA[i] = 0x22 - } - if m.UpdatedDate != nil { - { - size, err := m.UpdatedDate.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.CreatedBy) > 0 { - i -= len(m.CreatedBy) - copy(dAtA[i:], m.CreatedBy) - i = encodeVarintTypes(dAtA, i, uint64(len(m.CreatedBy))) - i-- - dAtA[i] = 0x12 - } - if m.CreatedDate != nil { - { - size, err := m.CreatedDate.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GogoTimeHack) 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 *GogoTimeHack) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GogoTimeHack) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Nanos != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Nanos)) - i-- - dAtA[i] = 0x10 - } - if m.Seconds != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Seconds)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Date) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Value) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *UUID) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Value) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *BooleanResult) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Value { - n += 2 - } - return n -} - -func (m *Location) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Ref != nil { - l = m.Ref.Size() - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Classname) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Fact) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.DataLocation != nil { - l = m.DataLocation.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *ProvenanceReference) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ScopeUuid != nil { - l = m.ScopeUuid.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.GroupUuid != nil { - l = m.GroupUuid.Size() - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Hash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Signature) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Algo) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Provider) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Signature) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Signer != nil { - l = m.Signer.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *SignatureSet) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Signatures) > 0 { - for _, e := range m.Signatures { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *PublicKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.PublicKeyBytes) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - if m.Curve != 0 { - n += 1 + sovTypes(uint64(m.Curve)) - } - return n -} - -func (m *SigningAndEncryptionPublicKeys) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.SigningPublicKey != nil { - l = m.SigningPublicKey.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.EncryptionPublicKey != nil { - l = m.EncryptionPublicKey.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *AuditFields) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CreatedDate != nil { - l = m.CreatedDate.Size() - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.CreatedBy) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.UpdatedDate != nil { - l = m.UpdatedDate.Size() - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.UpdatedBy) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Version != 0 { - n += 1 + sovTypes(uint64(m.Version)) - } - l = len(m.Message) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *GogoTimeHack) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Seconds != 0 { - n += 1 + sovTypes(uint64(m.Seconds)) - } - if m.Nanos != 0 { - n += 1 + sovTypes(uint64(m.Nanos)) - } - return n -} - -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Date) 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 ErrIntOverflowTypes - } - 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: Date: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Date: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UUID) 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 ErrIntOverflowTypes - } - 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: UUID: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UUID: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BooleanResult) 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 ErrIntOverflowTypes - } - 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: BooleanResult: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BooleanResult: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Value = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Location) 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 ErrIntOverflowTypes - } - 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: Location: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Location: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ref", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Ref == nil { - m.Ref = &ProvenanceReference{} - } - if err := m.Ref.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Classname", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Classname = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Fact) 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 ErrIntOverflowTypes - } - 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: Fact: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Fact: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DataLocation", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.DataLocation == nil { - m.DataLocation = &Location{} - } - if err := m.DataLocation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProvenanceReference) 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 ErrIntOverflowTypes - } - 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: ProvenanceReference: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProvenanceReference: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ScopeUuid", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ScopeUuid == nil { - m.ScopeUuid = &UUID{} - } - if err := m.ScopeUuid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GroupUuid", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.GroupUuid == nil { - m.GroupUuid = &UUID{} - } - if err := m.GroupUuid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Hash = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Signature) 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 ErrIntOverflowTypes - } - 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: Signature: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Signature: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Algo", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Algo = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Provider", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Provider = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signature = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Signer == nil { - m.Signer = &SigningAndEncryptionPublicKeys{} - } - if err := m.Signer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SignatureSet) 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 ErrIntOverflowTypes - } - 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: SignatureSet: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SignatureSet: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signatures = append(m.Signatures, &Signature{}) - if err := m.Signatures[len(m.Signatures)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PublicKey) 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 ErrIntOverflowTypes - } - 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: PublicKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PublicKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PublicKeyBytes", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PublicKeyBytes = append(m.PublicKeyBytes[:0], dAtA[iNdEx:postIndex]...) - if m.PublicKeyBytes == nil { - m.PublicKeyBytes = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= PublicKeyType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Curve", wireType) - } - m.Curve = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Curve |= PublicKeyCurve(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SigningAndEncryptionPublicKeys) 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 ErrIntOverflowTypes - } - 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: SigningAndEncryptionPublicKeys: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SigningAndEncryptionPublicKeys: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SigningPublicKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SigningPublicKey == nil { - m.SigningPublicKey = &PublicKey{} - } - if err := m.SigningPublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EncryptionPublicKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.EncryptionPublicKey == nil { - m.EncryptionPublicKey = &PublicKey{} - } - if err := m.EncryptionPublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuditFields) 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 ErrIntOverflowTypes - } - 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: AuditFields: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuditFields: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CreatedDate", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CreatedDate == nil { - m.CreatedDate = &GogoTimeHack{} - } - if err := m.CreatedDate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CreatedBy", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CreatedBy = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UpdatedDate", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.UpdatedDate == nil { - m.UpdatedDate = &GogoTimeHack{} - } - if err := m.UpdatedDate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UpdatedBy", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.UpdatedBy = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - m.Version = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Version |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Message = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GogoTimeHack) 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 ErrIntOverflowTypes - } - 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: GogoTimeHack: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GogoTimeHack: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Seconds", wireType) - } - m.Seconds = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Seconds |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Nanos", wireType) - } - m.Nanos = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Nanos |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTypes(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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/metadata/legacy/v040/migrate.go b/x/metadata/legacy/v040/migrate.go deleted file mode 100644 index 7d0c3bfdb2..0000000000 --- a/x/metadata/legacy/v040/migrate.go +++ /dev/null @@ -1,282 +0,0 @@ -package v040 - -import ( - "crypto/sha512" - "encoding/base64" - "fmt" - "time" - - v039metadata "github.com/provenance-io/provenance/x/metadata/legacy/v039" - v040metadata "github.com/provenance-io/provenance/x/metadata/types" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/gogo/protobuf/proto" - "github.com/google/uuid" -) - -// Migrate accepts exported x/metadata genesis state from v0.39 and migrates it -// to v0.40 x/metadata genesis state. The migration includes: -// -// - Convert addresses from bytes to bech32 strings. -// - Re-encode in v0.40 GenesisState. -func Migrate(oldGenState v039metadata.GenesisState) *v040metadata.GenesisState { - var scopes = make([]v040metadata.Scope, len(oldGenState.ScopeRecords)) - var sessions = make([]v040metadata.Session, 0) - var records = make([]v040metadata.Record, 0) - var contractSpecs = make([]v040metadata.ContractSpecification, 0) - var recordSpecs = make([]v040metadata.RecordSpecification, 0) - - for i := range oldGenState.ScopeRecords { - s, g, r := convertScope(&oldGenState.ScopeRecords[i]) - scopes[i] = *s - sessions = append(sessions, g...) - records = append(records, r...) - } - - for i := range oldGenState.Specifications { - c, r, e := convertContractSpec(&oldGenState.Specifications[i]) - if e != nil { - panic(e) - } - contractSpecs = append(contractSpecs, c) - recordSpecs = append(recordSpecs, r...) - } - - return &v040metadata.GenesisState{ - Params: v040metadata.DefaultGenesisState().Params, - OSLocatorParams: v040metadata.DefaultGenesisState().OSLocatorParams, - - Scopes: scopes, - Sessions: sessions, - Records: records, - ContractSpecifications: contractSpecs, - RecordSpecifications: recordSpecs, - } -} - -// convertScope takes a v039 consolidated scope structure and returns the v040 break down into components -func convertScope( - old *v039metadata.Scope, -) ( - newScope *v040metadata.Scope, - newSessions []v040metadata.Session, - newRecords []v040metadata.Record, -) { - oldScopeUUID := uuid.MustParse(old.Uuid.Value) - newScope = &v040metadata.Scope{ - ScopeId: v040metadata.ScopeMetadataAddress(oldScopeUUID), - SpecificationId: v040metadata.MetadataAddress{}, - Owners: convertParties(old.Parties), - DataAccess: partyAddresses(convertParties(old.Parties)), - } - newSessions, newRecords = convertGroups(oldScopeUUID, old.RecordGroup) - return -} - -// convertGroup uses the old scope uuid to create a collection of updated v040 RecordGroup instances that derived from -// the groups in the old format -func convertGroups(oldScopeUUID uuid.UUID, old []*v039metadata.RecordGroup) (newSession []v040metadata.Session, newRecords []v040metadata.Record) { - newSession = make([]v040metadata.Session, len(old)) - newRecords = make([]v040metadata.Record, 0) - for i, g := range old { - if g.Audit != nil { - newSession[i].Audit = &v040metadata.AuditFields{CreatedBy: g.Audit.CreatedBy} - if g.Audit.CreatedDate != nil { - newSession[i].Audit.CreatedDate = time.Unix(g.Audit.CreatedDate.Seconds, 0) - } - newSession[i].Audit.Message = g.Audit.Message - newSession[i].Audit.UpdatedBy = g.Audit.UpdatedBy - if g.Audit.UpdatedDate != nil { - newSession[i].Audit.UpdatedDate = time.Unix(g.Audit.UpdatedDate.Seconds, 0) - } - newSession[i].Audit.Version = uint32(g.Audit.Version) - } - newSession[i].SessionId = v040metadata.SessionMetadataAddress(oldScopeUUID, uuid.MustParse(g.GroupUuid.Value)) - newSession[i].Name = g.Classname - newSession[i].Parties = convertParties(g.Parties) - specAddr, err := v040metadata.ConvertHashToAddress(v040metadata.ContractSpecificationKeyPrefix, g.Specification) - if err != nil { - panic(err) - } - newSession[i].SpecificationId = specAddr - - newRecords = append(newRecords, convertRecords(newSession[i].SessionId, specAddr, g.Records)...) - } - return -} - -// convertRecords converts the v039 Records within a RecordGroup structure to the updated independent record assigning -// each using the groupID provided. -func convertRecords(sessionID v040metadata.MetadataAddress, cSpecAddr v040metadata.MetadataAddress, old []*v039metadata.Record) (new []v040metadata.Record) { - cSpecUUID, err := cSpecAddr.ContractSpecUUID() - if err != nil { - panic(err) - } - new = make([]v040metadata.Record, len(old)) - for i, r := range old { - new[i] = v040metadata.Record{ - Name: r.ResultName, - SessionId: sessionID, - Process: v040metadata.Process{ - Name: r.Classname, - Method: r.Name, - ProcessId: &v040metadata.Process_Hash{ - Hash: r.Hash, - }, - }, - Inputs: convertRecordInput(r.Inputs), - Outputs: []v040metadata.RecordOutput{ - { - Hash: r.ResultHash, - Status: v040metadata.ResultStatus(int32(r.Result)), - }, - }, - SpecificationId: v040metadata.RecordSpecMetadataAddress(cSpecUUID, r.ResultName), - } - } - return -} - -// convertRecordInput converts the v039 RecordInput structure to the v040 RecordInput by mapping the old enums directly -// to the new ones (codes are preserved) and settings the source using the hash option (address was not supported) -func convertRecordInput(old []*v039metadata.RecordInput) (new []v040metadata.RecordInput) { - new = make([]v040metadata.RecordInput, len(old)) - for i, input := range old { - new[i] = v040metadata.RecordInput{ - Name: input.Name, - TypeName: input.Classname, - Source: &v040metadata.RecordInput_Hash{ - Hash: input.Hash, - }, - Status: v040metadata.RecordInputStatus(int32(input.Type)), - } - } - return -} - -// partyAddresses returns an array of addresses from an array of parties -func partyAddresses(parties []v040metadata.Party) (addresses []string) { - for _, p := range parties { - if len(p.Address) > 0 { - addresses = append(addresses, p.Address) - } - } - return -} - -// convertParties converts the v039 Recital structure into a v040 Party by calculating the address (as required) and -// copying over the existing party role value into the new structure -func convertParties(old []*v039metadata.Recital) (new []v040metadata.Party) { - new = make([]v040metadata.Party, len(old)) - for i, r := range old { - if len(r.Address) > 0 { - new[i].Address = sdk.AccAddress(r.Address).String() - } else { - // must parse signing key into address - if r.Signer.SigningPublicKey == nil || - r.Signer.SigningPublicKey.Curve != v039metadata.PublicKeyCurve_SECP256K1 { - panic(fmt.Errorf("unsupported signing publickey type and account address unavailable")) - } - _, addr, err := v039metadata.ParsePublicKey(r.Signer.SigningPublicKey.PublicKeyBytes) - if err != nil { - panic(err) - } - new[i].Address = addr.String() - } - // old v39 and new v40 enum codes are the same - new[i].Role = v040metadata.PartyType(int32(r.SignerRole)) - } - return -} - -func convertContractSpec(old *v039metadata.ContractSpec) ( - newSpec v040metadata.ContractSpecification, - newRecords []v040metadata.RecordSpecification, - err error, -) { - rawProtoOld, err := proto.Marshal(old) - if err != nil { - return newSpec, nil, err - } - sha512Old := sha512.Sum512(rawProtoOld) - specUUID, err := uuid.FromBytes(sha512Old[0:16]) - if err != nil { - return newSpec, nil, err - } - id := v040metadata.ContractSpecMetadataAddress(specUUID) - - parties := make([]v040metadata.PartyType, len(old.PartiesInvolved)) - for i := range old.PartiesInvolved { - parties[i] = v040metadata.PartyType(int32(old.PartiesInvolved[i])) - } - - newSpec = v040metadata.ContractSpecification{ - SpecificationId: id, - Description: &v040metadata.Description{ - Name: old.Definition.Name, - Description: old.Definition.ResourceLocation.Classname, - }, - PartiesInvolved: parties, - // OwnerAddresses: -- TODO: there were no owners set on the v39 chain, maybe trace one from a group that used this spec? - Source: &v040metadata.ContractSpecification_Hash{ - Hash: base64.StdEncoding.EncodeToString(sha512Old[:]), - }, - ClassName: old.Definition.ResourceLocation.Classname, - } - - newRecords = make([]v040metadata.RecordSpecification, len(old.ConsiderationSpecs)) - for i := range old.ConsiderationSpecs { - recordInputs, err := convertInputSpecs(old.ConsiderationSpecs[i].InputSpecs) - if err != nil { - return newSpec, nil, err - } - specUUID, err := newSpec.SpecificationId.ContractSpecUUID() - if err != nil { - return newSpec, nil, err - } - recordSpecID := v040metadata.RecordSpecMetadataAddress(specUUID, old.ConsiderationSpecs[i].OutputSpec.Spec.Name) - newRecords[i] = v040metadata.RecordSpecification{ - SpecificationId: recordSpecID, - Name: old.ConsiderationSpecs[i].OutputSpec.Spec.Name, - TypeName: old.ConsiderationSpecs[i].OutputSpec.Spec.ResourceLocation.Classname, - ResultType: v040metadata.DefinitionType(old.ConsiderationSpecs[i].OutputSpec.Spec.Type), - Inputs: recordInputs, - ResponsibleParties: []v040metadata.PartyType{v040metadata.PartyType(old.ConsiderationSpecs[i].ResponsibleParty)}, - } - } - - return newSpec, newRecords, nil -} - -// converts a v39 DefinitionSpec used for inputs into a v40 input specification. -func convertInputSpecs(old []*v039metadata.DefinitionSpec) (inputs []*v040metadata.InputSpecification, err error) { - inputs = make([]*v040metadata.InputSpecification, len(old)) - for i, oldInput := range old { - if oldInput.ResourceLocation.Ref.ScopeUuid != nil && - len(oldInput.ResourceLocation.Ref.ScopeUuid.Value) > 0 { - scopeUUID, err := uuid.Parse(oldInput.ResourceLocation.Ref.ScopeUuid.Value) - if err != nil { - return nil, err - } - if len(oldInput.ResourceLocation.Ref.Name) < 1 { - return nil, fmt.Errorf("must have a value for record name") - } - inputs[i] = &v040metadata.InputSpecification{ - Name: oldInput.Name, - TypeName: oldInput.ResourceLocation.Classname, - Source: &v040metadata.InputSpecification_RecordId{ - RecordId: v040metadata.RecordMetadataAddress(scopeUUID, oldInput.ResourceLocation.Ref.Name), - }, - } - } else { - inputs[i] = &v040metadata.InputSpecification{ - Name: oldInput.Name, - TypeName: oldInput.ResourceLocation.Classname, - Source: &v040metadata.InputSpecification_Hash{ - Hash: oldInput.ResourceLocation.Ref.Hash, - }, - } - } - } - return -} diff --git a/x/metadata/legacy/v040/migrate_test.go b/x/metadata/legacy/v040/migrate_test.go deleted file mode 100644 index ca4d3dad39..0000000000 --- a/x/metadata/legacy/v040/migrate_test.go +++ /dev/null @@ -1,382 +0,0 @@ -package v040_test - -import ( - "encoding/json" - "testing" - - "github.com/stretchr/testify/require" - - "github.com/cosmos/cosmos-sdk/client" - - simapp "github.com/provenance-io/provenance/app" - v039metadata "github.com/provenance-io/provenance/x/metadata/legacy/v039" - v040metadata "github.com/provenance-io/provenance/x/metadata/legacy/v040" -) - -var ( - exampleV39Spec = `{ - "consideration_specs": [ - { - "func_name": "additionalParties", - "input_specs": [ - { - "name": "perform_input_checks", - "resource_location": { - "classname": "io.provenance.Common$BooleanResult", - "ref": { - "hash": "Adv+huolGTKofYCR0dw5GHm/R7sUWOwF32XR8r8r9kDy4il5U/LApxOWYHb05jhK4+eY4YzRMRiWcxU3Lx0+Mw==" - } - }, - "type": 1 - }, - { - "name": "additional_parties", - "resource_location": { - "classname": "io.provenance.loan.LoanProtos$PartiesList", - "ref": { - "hash": "Adv+huolGTKofYCR0dw5GHm/R7sUWOwF32XR8r8r9kDy4il5U/LApxOWYHb05jhK4+eY4YzRMRiWcxU3Lx0+Mw==" - } - }, - "type": 1 - } - ], - "output_spec": { - "spec": { - "name": "additional_parties", - "resource_location": { - "classname": "io.provenance.loan.LoanProtos$PartiesList", - "ref": { - "hash": "Adv+huolGTKofYCR0dw5GHm/R7sUWOwF32XR8r8r9kDy4il5U/LApxOWYHb05jhK4+eY4YzRMRiWcxU3Lx0+Mw==" - } - }, - "type": 1 - } - }, - "responsible_party": 1 - }, - { - "func_name": "documents", - "input_specs": [ - { - "name": "perform_input_checks", - "resource_location": { - "classname": "io.provenance.Common$BooleanResult", - "ref": { - "hash": "Adv+huolGTKofYCR0dw5GHm/R7sUWOwF32XR8r8r9kDy4il5U/LApxOWYHb05jhK4+eY4YzRMRiWcxU3Lx0+Mw==" - } - }, - "type": 1 - }, - { - "name": "documents", - "resource_location": { - "classname": "io.provenance.common.DocumentProtos$DocumentList", - "ref": { - "hash": "Adv+huolGTKofYCR0dw5GHm/R7sUWOwF32XR8r8r9kDy4il5U/LApxOWYHb05jhK4+eY4YzRMRiWcxU3Lx0+Mw==" - } - }, - "type": 1 - } - ], - "output_spec": { - "spec": { - "name": "documents", - "resource_location": { - "classname": "io.provenance.common.DocumentProtos$DocumentList", - "ref": { - "hash": "Adv+huolGTKofYCR0dw5GHm/R7sUWOwF32XR8r8r9kDy4il5U/LApxOWYHb05jhK4+eY4YzRMRiWcxU3Lx0+Mw==" - } - }, - "type": 1 - } - }, - "responsible_party": 1 - } - ], - "definition": { - "name": "ExampleContract", - "resource_location": { - "classname": "io.provenance.contracts.ExampleContract", - "ref": { - "hash": "E36eeTUk8GYXGXjIbZTm4s/Dw3G1e42SinH1195t4ekgcXXPhfIpfQaEJ21PTzKhdv6JjhzQJ2kAJXK+TRXmeQ==" - } - }, - "type": 2 - }, - "input_specs": [ - { - "name": "additional_parties", - "resource_location": { - "classname": "io.provenance.loan.LoanProtos$PartiesList", - "ref": { - "hash": "Adv+huolGTKofYCR0dw5GHm/R7sUWOwF32XR8r8r9kDy4il5U/LApxOWYHb05jhK4+eY4YzRMRiWcxU3Lx0+Mw==" - } - }, - "type": 2 - }, - { - "name": "documents", - "resource_location": { - "classname": "io.provenance.common.DocumentProtos$DocumentList", - "ref": { - "hash": "Adv+huolGTKofYCR0dw5GHm/R7sUWOwF32XR8r8r9kDy4il5U/LApxOWYHb05jhK4+eY4YzRMRiWcxU3Lx0+Mw==" - } - }, - "type": 2 - } - ], - "parties_involved": [ - 1 - ] -}` - exampleV39Scope = `{ - "last_event": { - "execution_uuid": { - "value": "d60098e7-153c-492e-bcb3-37ce293ffb17" - }, - "group_uuid": { - "value": "0f2c6db3-8b47-4d98-ae5f-647a7e511545" - } - }, - "parties": [ - { - "address": "GOrX55pQULrlronarLFe8U4U3bc=", - "signer": { - "encryption_public_key": { - "public_key_bytes": "BOMGXlqove6huk+stReazUD43ANdehXQbewNHw/mv8vzRWsrxK/II+0wulZKG08458ykUnhSHHKpiv4EyYT8XzM=" - }, - "signing_public_key": { - "public_key_bytes": "BOMGXlqove6huk+stReazUD43ANdehXQbewNHw/mv8vzRWsrxK/II+0wulZKG08458ykUnhSHHKpiv4EyYT8XzM=" - } - }, - "signer_role": 1 - }, - { - "signer": { - "encryption_public_key": { - "public_key_bytes": "BGxX6eJRAdXlU64APi95Al44m1FJVgfHlrTpXAqUAB+8JNhM0HgIGWElKbgD6K0KOX9HTJZdlX0z3WTmQrdW+8Q=" - }, - "signing_public_key": { - "public_key_bytes": "BGxX6eJRAdXlU64APi95Al44m1FJVgfHlrTpXAqUAB+8JNhM0HgIGWElKbgD6K0KOX9HTJZdlX0z3WTmQrdW+8Q=" - } - }, - "signer_role": 1 - } - ], - "record_group": [ - { - "audit": { - "created_by": "tp1rr4d0eu62pgt4edw38d2ev27798pfhdhp5ttha", - "created_date": { - "seconds": 1608242483 - }, - "version": 1 - }, - "classname": "io.p8e.contracts.origination.ETLTouch", - "executor": { - "encryption_public_key": { - "public_key_bytes": "BOMGXlqove6huk+stReazUD43ANdehXQbewNHw/mv8vzRWsrxK/II+0wulZKG08458ykUnhSHHKpiv4EyYT8XzM=" - } - }, - "group_uuid": { - "value": "0f2c6db3-8b47-4d98-ae5f-647a7e511545" - }, - "parties": [ - { - "address": "GOrX55pQULrlronarLFe8U4U3bc=", - "signer": { - "encryption_public_key": { - "public_key_bytes": "BOMGXlqove6huk+stReazUD43ANdehXQbewNHw/mv8vzRWsrxK/II+0wulZKG08458ykUnhSHHKpiv4EyYT8XzM=" - }, - "signing_public_key": { - "public_key_bytes": "BOMGXlqove6huk+stReazUD43ANdehXQbewNHw/mv8vzRWsrxK/II+0wulZKG08458ykUnhSHHKpiv4EyYT8XzM=" - } - }, - "signer_role": 1 - } - ], - "records": [ - { - "classname": "io.provenance.proto.loan.LoanProtos$Loan", - "hash": "VQUlaiUsAJB6XVegaZ3vD+vMdqfR+/jHp6UjNSW/RUdbJOTUrKn50/HkDGzQyUmniNYYZ/YxjwrdCkTB9mm6qw==", - "name": "noop", - "result": 1, - "result_hash": "poYoiYr8gi22vyBlo09YkSSnGHRY0jQW9DZAvaTPT5slTbt2SV8KgGSKoK72PYVL/yLrCgnrEDaRn08byB/JHQ==", - "result_name": "loan" - } - ], - "specification": "2Sl7QeL/Zn37Md9w0Rncl9/qG8UvfLbsxOpwUUUi3pel4P8xa3sdEzSjwVvENpYGwjHY51jpdvlSX7PbntrjOg==" - } - ], - "uuid": { - "value": "000029c9-8e2a-45d7-95af-b670bb54061a" - } -}` -) - -func TestMigrate(t *testing.T) { - - encodingConfig := simapp.MakeEncodingConfig() - clientCtx := client.Context{}. - WithInterfaceRegistry(encodingConfig.InterfaceRegistry). - WithTxConfig(encodingConfig.TxConfig). - WithLegacyAmino(encodingConfig.Amino). - WithJSONCodec(encodingConfig.Marshaler) - - var v39ContractSpec v039metadata.ContractSpec - clientCtx.JSONCodec.UnmarshalJSON([]byte(exampleV39Spec), &v39ContractSpec) - - var v39Scope v039metadata.Scope - clientCtx.JSONCodec.UnmarshalJSON([]byte(exampleV39Scope), &v39Scope) - - gs := v039metadata.GenesisState{ - ScopeRecords: []v039metadata.Scope{v39Scope}, - Specifications: []v039metadata.ContractSpec{v39ContractSpec}, - } - - migrated := v040metadata.Migrate(gs) - - expected := `{ - "contract_specifications": [ - { - "class_name": "io.provenance.contracts.ExampleContract", - "description": { - "description": "io.provenance.contracts.ExampleContract", - "icon_url": "", - "name": "ExampleContract", - "website_url": "" - }, - "hash": "fJXLW6TsYwWys0utfWwrqaZiqAx27Kl2sj3dXVO9fOU8g32/uuL2fBr6ajlSeRMPRrNE05Mz8AVJE2XvWhvEvw==", - "owner_addresses": [], - "parties_involved": [ - "PARTY_TYPE_ORIGINATOR" - ], - "specification_id": "contractspec1qd7ftj6m5nkxxpdjkd966ltv9w5sjjc9tt" - } - ], - "o_s_locator_params": { - "max_uri_length": 2048 - }, - "object_store_locators": [], - "params": {}, - "record_specifications": [ - { - "inputs": [ - { - "hash": "Adv+huolGTKofYCR0dw5GHm/R7sUWOwF32XR8r8r9kDy4il5U/LApxOWYHb05jhK4+eY4YzRMRiWcxU3Lx0+Mw==", - "name": "perform_input_checks", - "type_name": "io.provenance.Common$BooleanResult" - }, - { - "hash": "Adv+huolGTKofYCR0dw5GHm/R7sUWOwF32XR8r8r9kDy4il5U/LApxOWYHb05jhK4+eY4YzRMRiWcxU3Lx0+Mw==", - "name": "additional_parties", - "type_name": "io.provenance.loan.LoanProtos$PartiesList" - } - ], - "name": "additional_parties", - "responsible_parties": [ - "PARTY_TYPE_ORIGINATOR" - ], - "result_type": "DEFINITION_TYPE_PROPOSED", - "specification_id": "recspec1q47ftj6m5nkxxpdjkd966ltv9w56y0aeyhnus90eqmv3xfwwugdwq738ll6", - "type_name": "io.provenance.loan.LoanProtos$PartiesList" - }, - { - "inputs": [ - { - "hash": "Adv+huolGTKofYCR0dw5GHm/R7sUWOwF32XR8r8r9kDy4il5U/LApxOWYHb05jhK4+eY4YzRMRiWcxU3Lx0+Mw==", - "name": "perform_input_checks", - "type_name": "io.provenance.Common$BooleanResult" - }, - { - "hash": "Adv+huolGTKofYCR0dw5GHm/R7sUWOwF32XR8r8r9kDy4il5U/LApxOWYHb05jhK4+eY4YzRMRiWcxU3Lx0+Mw==", - "name": "documents", - "type_name": "io.provenance.common.DocumentProtos$DocumentList" - } - ], - "name": "documents", - "responsible_parties": [ - "PARTY_TYPE_ORIGINATOR" - ], - "result_type": "DEFINITION_TYPE_PROPOSED", - "specification_id": "recspec1q47ftj6m5nkxxpdjkd966ltv9w5ek945f58q5h9vf7tghmaskk67kezsda9", - "type_name": "io.provenance.common.DocumentProtos$DocumentList" - } - ], - "records": [ - { - "inputs": [], - "name": "loan", - "outputs": [ - { - "hash": "poYoiYr8gi22vyBlo09YkSSnGHRY0jQW9DZAvaTPT5slTbt2SV8KgGSKoK72PYVL/yLrCgnrEDaRn08byB/JHQ==", - "status": "RESULT_STATUS_PASS" - } - ], - "process": { - "hash": "VQUlaiUsAJB6XVegaZ3vD+vMdqfR+/jHp6UjNSW/RUdbJOTUrKn50/HkDGzQyUmniNYYZ/YxjwrdCkTB9mm6qw==", - "method": "noop", - "name": "io.provenance.proto.loan.LoanProtos$Loan" - }, - "session_id": "session1qyqqq2wf3c4yt4u447m8pw65qcdq7trdkw95wnvc4e0kg7n72y252q9j0yu", - "specification_id": "recspec1qhvjj76putlkvl0mx80hp5gemjt5w2alzjfrutnualv99xp9csq7s7xf2aw" - } - ], - "scope_specifications": [], - "scopes": [ - { - "data_access": [ - "cosmos1rr4d0eu62pgt4edw38d2ev27798pfhdhm39zct", - "cosmos1vz99nyd2er8myeugsr4xm5duwhulhp5ae4dvpa" - ], - "owners": [ - { - "address": "cosmos1rr4d0eu62pgt4edw38d2ev27798pfhdhm39zct", - "role": "PARTY_TYPE_ORIGINATOR" - }, - { - "address": "cosmos1vz99nyd2er8myeugsr4xm5duwhulhp5ae4dvpa", - "role": "PARTY_TYPE_ORIGINATOR" - } - ], - "scope_id": "scope1qqqqq2wf3c4yt4u447m8pw65qcdqrre82d", - "specification_id": "", - "value_owner_address": "" - } - ], - "sessions": [ - { - "audit": { - "created_by": "tp1rr4d0eu62pgt4edw38d2ev27798pfhdhp5ttha", - "created_date": "2020-12-17T22:01:23Z", - "message": "", - "updated_by": "", - "updated_date": "0001-01-01T00:00:00Z", - "version": 1 - }, - "context": null, - "name": "io.p8e.contracts.origination.ETLTouch", - "parties": [ - { - "address": "cosmos1rr4d0eu62pgt4edw38d2ev27798pfhdhm39zct", - "role": "PARTY_TYPE_ORIGINATOR" - } - ], - "session_id": "session1qyqqq2wf3c4yt4u447m8pw65qcdq7trdkw95wnvc4e0kg7n72y252q9j0yu", - "specification_id": "contractspec1q0vjj76putlkvl0mx80hp5gemjts9mzggk" - } - ] -}` - bz, err := clientCtx.JSONCodec.MarshalJSON(migrated) - require.NoError(t, err) - - // Indent the JSON bz correctly. - var jsonObj map[string]interface{} - err = json.Unmarshal(bz, &jsonObj) - require.NoError(t, err) - indentedBz, err := json.MarshalIndent(jsonObj, "", " ") - require.NoError(t, err) - - println(string(indentedBz)) - require.Equal(t, expected, string(indentedBz)) -} diff --git a/x/metadata/legacy/v040/types.go b/x/metadata/legacy/v040/types.go deleted file mode 100644 index 8912d7d689..0000000000 --- a/x/metadata/legacy/v040/types.go +++ /dev/null @@ -1,5 +0,0 @@ -package v040 - -const ( - ModuleName = "metadata" -) diff --git a/x/name/legacy/v039/types.go b/x/name/legacy/v039/types.go deleted file mode 100644 index 97f4d8decd..0000000000 --- a/x/name/legacy/v039/types.go +++ /dev/null @@ -1,45 +0,0 @@ -package v039 - -import ( - "fmt" - "strings" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// NameRecord is an address with a flag that indicates if the name is restricted -type NameRecord struct { - // The bound name - Name string `json:"name" yaml:"name"` - // The address the name resolved to. - Address sdk.AccAddress `json:"address" yaml:"address"` - // Whether owner signature is required to add sub-names. - Restricted bool `json:"restricted,omitempty" yaml:"restricted"` - // The value exchange address - Pointer sdk.AccAddress `json:"pointer,omitempty" yaml:"pointer"` -} - -// NewNameRecord creates a name record binding that is restricted for child updates to the owner. -func NewNameRecord(name string, address sdk.AccAddress, restricted bool) NameRecord { - return NameRecord{ - Name: name, - Address: address, - Restricted: restricted, - } -} - -// implement fmt.Stringer -func (nr NameRecord) String() string { - if nr.Restricted { - return strings.TrimSpace(fmt.Sprintf(`%s: %s [restricted]`, nr.Name, nr.Address)) - } - return strings.TrimSpace(fmt.Sprintf(`%s: %s`, nr.Name, nr.Address)) -} - -// NameRecords within the GenesisState -type NameRecords []NameRecord - -// GenesisState is the initial set of name -> address bindings. -type GenesisState struct { - Bindings NameRecords `json:"bindings"` -} diff --git a/x/name/legacy/v040/migrate.go b/x/name/legacy/v040/migrate.go deleted file mode 100644 index 1421fad259..0000000000 --- a/x/name/legacy/v040/migrate.go +++ /dev/null @@ -1,27 +0,0 @@ -package v040 - -import ( - v039name "github.com/provenance-io/provenance/x/name/legacy/v039" - v040name "github.com/provenance-io/provenance/x/name/types" -) - -// Migrate accepts exported x/name genesis state from v0.39 and migrates it -// to v0.40 x/name genesis state. The migration includes: -// -// - Convert addresses from bytes to bech32 strings. -// - Re-encode in v0.40 GenesisState. -func Migrate(oldGenState v039name.GenesisState) *v040name.GenesisState { - var nameRecords = make([]v040name.NameRecord, 0, len(oldGenState.Bindings)) - for _, name := range oldGenState.Bindings { - nameRecords = append(nameRecords, v040name.NameRecord{ - Name: name.Name, - Address: name.Address.String(), - Restricted: name.Restricted, - }) - } - - return &v040name.GenesisState{ - Params: v040name.DefaultParams(), - Bindings: nameRecords, - } -} diff --git a/x/name/legacy/v040/migrate_test.go b/x/name/legacy/v040/migrate_test.go deleted file mode 100644 index def7f7c97e..0000000000 --- a/x/name/legacy/v040/migrate_test.go +++ /dev/null @@ -1,71 +0,0 @@ -package v040_test - -import ( - "encoding/json" - "fmt" - "testing" - - "github.com/stretchr/testify/require" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/simapp" - sdk "github.com/cosmos/cosmos-sdk/types" - - v039name "github.com/provenance-io/provenance/x/name/legacy/v039" - v040name "github.com/provenance-io/provenance/x/name/legacy/v040" -) - -func TestMigrate(t *testing.T) { - encodingConfig := simapp.MakeTestEncodingConfig() - clientCtx := client.Context{}. - WithInterfaceRegistry(encodingConfig.InterfaceRegistry). - WithTxConfig(encodingConfig.TxConfig). - WithLegacyAmino(encodingConfig.Amino). - WithJSONCodec(encodingConfig.Marshaler) - - addr1, err := sdk.AccAddressFromBech32("cosmos16xyempempp92x9hyzz9wrgf94r6j9h5f06pxxv") - superBadAddr, err := sdk.AccAddressFromBech32("cosmos14n2lmufqep8qmn98yhtmy4uwsd7msmpfkr8vfd") - name := "mcvluvin.io" - restricted := false - require.NoError(t, err) - - gs := v039name.GenesisState{ - Bindings: []v039name.NameRecord{ - { - Name: name, - Address: addr1, - Restricted: restricted, - Pointer: superBadAddr, - }, - }, - } - - migrated := v040name.Migrate(gs) - expected := fmt.Sprintf(`{ - "bindings": [ - { - "address": "%s", - "name": "%s", - "restricted": %s - } - ], - "params": { - "allow_unrestricted_names": true, - "max_name_levels": 16, - "max_segment_length": 32, - "min_segment_length": 2 - } -}`, addr1.String(), name, fmt.Sprint(restricted)) - - bz, err := clientCtx.JSONCodec.MarshalJSON(migrated) - require.NoError(t, err) - - // Indent the JSON bz correctly. - var jsonObj map[string]interface{} - err = json.Unmarshal(bz, &jsonObj) - require.NoError(t, err) - indentedBz, err := json.MarshalIndent(jsonObj, "", " ") - require.NoError(t, err) - - require.Equal(t, expected, string(indentedBz)) -} diff --git a/x/name/legacy/v040/types.go b/x/name/legacy/v040/types.go deleted file mode 100644 index 538a832ac5..0000000000 --- a/x/name/legacy/v040/types.go +++ /dev/null @@ -1,5 +0,0 @@ -package v040 - -const ( - ModuleName = "name" -)