diff --git a/.github/workflows/interchaintest.yml b/.github/workflows/interchaintest.yml index c673fb63e..3c1dafc2f 100644 --- a/.github/workflows/interchaintest.yml +++ b/.github/workflows/interchaintest.yml @@ -9,10 +9,10 @@ jobs: events: runs-on: self-hosted steps: - - name: Set up Go 1.19 + - name: Set up Go 1.20 uses: actions/setup-go@v1 with: - go-version: 1.19 + go-version: 1.20 id: go - name: checkout relayer @@ -31,10 +31,10 @@ jobs: legacy: runs-on: self-hosted steps: - - name: Set up Go 1.19 + - name: Set up Go 1.20 uses: actions/setup-go@v1 with: - go-version: 1.19 + go-version: 1.20 id: go - name: checkout relayer @@ -53,10 +53,10 @@ jobs: multiple-paths: runs-on: ubuntu-latest steps: - - name: Set up Go 1.19 + - name: Set up Go 1.20 uses: actions/setup-go@v1 with: - go-version: 1.19 + go-version: 1.20 id: go - name: checkout relayer @@ -75,10 +75,10 @@ jobs: scenarios: runs-on: ubuntu-latest steps: - - name: Set up Go 1.19 + - name: Set up Go 1.20 uses: actions/setup-go@v1 with: - go-version: 1.19 + go-version: 1.20 id: go - name: checkout relayer diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 620472251..5e9673730 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.19 + go-version: 1.20 - run: echo https://github.com/cosmos/relayer/blob/${GITHUB_REF#refs/tags/}/CHANGELOG.md#${GITHUB_REF#refs/tags/} > ../release_notes.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 315deb42d..41ee0c40b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ * [\#466](https://github.com/cosmos/relayer/pull/466) Docs cleanup. * [\#506](https://github.com/cosmos/relayer/pull/506) Fix Timeout Handling on Relayer restart * [\#940](https://github.com/cosmos/relayer/pull/940) Add min-gas-amount parameter for chain configs, to workaround gas estimation failure. +* [\#1177](https://github.com/cosmos/relayer/pull/1177) Avoid panic due to nil map when add new path and ensure path get written to config. +* [\#1178](https://github.com/cosmos/relayer/pull/1178) Add max-gas-amount parameter in chain configs. +* [\#1180](https://github.com/cosmos/relayer/pull/1180) Update SDK from v0.47.0 to v0.47.2. +* [\#1205](https://github.com/cosmos/relayer/pull/1205) Update ibc-go to v7.0.1. ## v0.9.3 diff --git a/Makefile b/Makefile index 905c40e8b..82a80780f 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ ifeq ($(OS),Windows_NT) @go build -mod=readonly $(BUILD_FLAGS) -o build/rly.exe main.go else @echo "building rly binary..." - @go build -mod=readonly $(BUILD_FLAGS) -o build/rly main.go + @go build $(BUILD_FLAGS) -o build/rly main.go endif build-zip: go.sum @@ -83,7 +83,7 @@ interchaintest-multiple: cd interchaintest && go test -race -v -run TestRelayerMultiplePathsSingleProcess . interchaintest-scenario: ## Scenario tests are suitable for simple networks of 1 validator and no full nodes. They test specific functionality. - cd interchaintest && go test -timeout 15m -race -v -run TestScenario ./... + cd interchaintest && go test -timeout 30m -race -v -run TestScenario ./... coverage: @echo "Generating coverage report..." diff --git a/README.md b/README.md index be026aea9..de9c5a153 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Additional information on how IBC works can be found [here](https://ibc.cosmos.n ```shell $ git clone https://github.com/cosmos/relayer.git - $ cd relayer && git checkout v2.0.0-rc3 + $ cd relayer && git checkout v2.3.0 $ make install ``` @@ -59,7 +59,7 @@ Additional information on how IBC works can be found [here](https://ibc.cosmos.n ``` **Default config file location:** `~/.relayer/config/config.yaml` - By default, transactions will be relayed with a memo of `rly(VERSION)` e.g. `rly(v2.0.0)`. + By default, transactions will be relayed with a memo of `rly(VERSION)` e.g. `rly(v2.3.0)`. To customize the memo for all relaying, use the `--memo` flag when initializing the configuration. @@ -67,7 +67,7 @@ Additional information on how IBC works can be found [here](https://ibc.cosmos.n $ rly config init --memo "My custom memo" ``` - Custom memos will have `rly(VERSION)` appended. For example, a memo of `My custom memo` running on relayer version `v2.0.0` would result in a transaction memo of `My custom memo | rly(v2.0.0)`. + Custom memos will have `rly(VERSION)` appended. For example, a memo of `My custom memo` running on relayer version `v2.3.0` would result in a transaction memo of `My custom memo | rly(v2.3.0)`. The `--memo` flag is also available for other `rly` commands also that involve sending transactions such as `rly tx link` and `rly start`. It can be passed there to override the `config.yaml` value if desired. diff --git a/buf.work.yaml b/buf.work.yaml deleted file mode 100644 index 494296bfa..000000000 --- a/buf.work.yaml +++ /dev/null @@ -1,4 +0,0 @@ -version: v1 -directories: - - proto - - third_party/proto diff --git a/cmd/appstate.go b/cmd/appstate.go index 4b5921059..7f26557f3 100644 --- a/cmd/appstate.go +++ b/cmd/appstate.go @@ -11,10 +11,8 @@ import ( "github.com/cosmos/relayer/v2/relayer" "github.com/gofrs/flock" - "github.com/spf13/cobra" "github.com/spf13/viper" "go.uber.org/zap" - "golang.org/x/sync/errgroup" "gopkg.in/yaml.v3" ) @@ -23,18 +21,61 @@ type appState struct { // Log is the root logger of the application. // Consumers are expected to store and use local copies of the logger // after modifying with the .With method. - Log *zap.Logger + log *zap.Logger - Viper *viper.Viper + viper *viper.Viper - HomePath string - Debug bool - Config *Config + homePath string + debug bool + config *Config } -// AddPathFromFile modifies a.config.Paths to include the content stored in the given file. +func (a *appState) configPath() string { + return path.Join(a.homePath, "config", "config.yaml") +} + +// loadConfigFile reads config file into a.Config if file is present. +func (a *appState) loadConfigFile(ctx context.Context) error { + cfgPath := a.configPath() + + if _, err := os.Stat(cfgPath); err != nil { + // don't return error if file doesn't exist + return nil + } + + // read the config file bytes + file, err := os.ReadFile(cfgPath) + if err != nil { + return fmt.Errorf("error reading file: %w", err) + } + + // unmarshall them into the wrapper struct + cfgWrapper := &ConfigInputWrapper{} + err = yaml.Unmarshal(file, cfgWrapper) + if err != nil { + return fmt.Errorf("error unmarshalling config: %w", err) + } + + // retrieve the runtime configuration from the disk configuration. + newCfg, err := cfgWrapper.RuntimeConfig(ctx, a) + if err != nil { + return err + } + + // validate runtime configuration + if err := newCfg.validateConfig(); err != nil { + return fmt.Errorf("error parsing chain config: %w", err) + } + + // save runtime configuration in app state + a.config = newCfg + + return nil +} + +// addPathFromFile modifies a.config.Paths to include the content stored in the given file. // If a non-nil error is returned, a.config.Paths is not modified. -func (a *appState) AddPathFromFile(ctx context.Context, stderr io.Writer, file, name string) error { +func (a *appState) addPathFromFile(ctx context.Context, stderr io.Writer, file, name string) error { if _, err := os.Stat(file); err != nil { return err } @@ -49,17 +90,22 @@ func (a *appState) AddPathFromFile(ctx context.Context, stderr io.Writer, file, return err } - if err = a.Config.ValidatePath(ctx, stderr, p); err != nil { + if err = a.config.ValidatePath(ctx, stderr, p); err != nil { return err } - return a.Config.Paths.Add(name, p) + return a.config.AddPath(name, p) } -// AddPathFromUserInput manually prompts the user to specify all the path details. +// addPathFromUserInput manually prompts the user to specify all the path details. // It returns any input or validation errors. // If the path was successfully added, it returns nil. -func (a *appState) AddPathFromUserInput(ctx context.Context, stdin io.Reader, stderr io.Writer, src, dst, name string) error { +func (a *appState) addPathFromUserInput( + ctx context.Context, + stdin io.Reader, + stderr io.Writer, + src, dst, name string, +) error { // TODO: confirm name is available before going through input. var ( @@ -119,65 +165,15 @@ func (a *appState) AddPathFromUserInput(ctx context.Context, stdin io.Reader, st return err } - if err := a.Config.ValidatePath(ctx, stderr, path); err != nil { + if err := a.config.ValidatePath(ctx, stderr, path); err != nil { return err } - return a.Config.Paths.Add(name, path) + return a.config.AddPath(name, path) } -// OverwriteConfig overwrites the config files on disk with the serialization of cfg, -// and it replaces a.Config with cfg. -// -// It is possible to use a brand new Config argument, -// but typically the argument is a.Config. -func (a *appState) OverwriteConfig(cfg *Config) error { - cfgPath := path.Join(a.HomePath, "config", "config.yaml") - if _, err := os.Stat(cfgPath); err != nil { - return fmt.Errorf("failed to check existence of config file at %s: %w", cfgPath, err) - } - - a.Viper.SetConfigFile(cfgPath) - if err := a.Viper.ReadInConfig(); err != nil { - // TODO: if we failed to read in the new config, should we restore the old config? - return fmt.Errorf("failed to read config file at %s: %w", cfgPath, err) - } - - // ensure validateConfig runs properly - if err := validateConfig(cfg); err != nil { - return fmt.Errorf("failed to validate config at %s: %w", cfgPath, err) - } - - // marshal the new config - out, err := yaml.Marshal(cfg.Wrapped()) - if err != nil { - return err - } - - // Overwrite the config file. - if err := os.WriteFile(a.Viper.ConfigFileUsed(), out, 0600); err != nil { - return fmt.Errorf("failed to write config file at %s: %w", cfgPath, err) - } - - // Write the config back into the app state. - a.Config = cfg - return nil -} - -// OverwriteConfigOnTheFly overwrites the config file concurrently, -// locking to read, modify, then write the config. -func (a *appState) OverwriteConfigOnTheFly( - cmd *cobra.Command, - pathName string, - clientSrc, clientDst string, - connectionSrc, connectionDst string, -) error { - if pathName == "" { - return errors.New("empty path name not allowed") - } - - // use lock file to guard concurrent access to config.yaml - lockFilePath := path.Join(a.HomePath, "config", "config.lock") +func (a *appState) performConfigLockingOperation(ctx context.Context, operation func() error) error { + lockFilePath := path.Join(a.homePath, "config", "config.lock") fileLock := flock.New(lockFilePath) _, err := fileLock.TryLock() if err != nil { @@ -185,7 +181,7 @@ func (a *appState) OverwriteConfigOnTheFly( } defer func() { if err := fileLock.Unlock(); err != nil { - a.Log.Error("error unlocking config file lock, please manually delete", + a.log.Error("error unlocking config file lock, please manually delete", zap.String("filepath", lockFilePath), ) } @@ -193,46 +189,39 @@ func (a *appState) OverwriteConfigOnTheFly( // load config from file and validate it. don't want to miss // any changes that may have been made while unlocked. - if err := initConfig(cmd, a); err != nil { + if err := a.loadConfigFile(ctx); err != nil { return fmt.Errorf("failed to initialize config from file: %w", err) } - path, ok := a.Config.Paths[pathName] - - if !ok { - return fmt.Errorf("config does not exist for that path: %s", pathName) - } - if clientSrc != "" { - path.Src.ClientID = clientSrc - } - if clientDst != "" { - path.Dst.ClientID = clientDst - } - if connectionSrc != "" { - path.Src.ConnectionID = connectionSrc + // perform the operation that requires config flock. + if err := operation(); err != nil { + return err } - if connectionDst != "" { - path.Dst.ConnectionID = connectionDst + + // validate config after changes have been made. + if err := a.config.validateConfig(); err != nil { + return fmt.Errorf("error parsing chain config: %w", err) } // marshal the new config - out, err := yaml.Marshal(a.Config.Wrapped()) + out, err := yaml.Marshal(a.config.Wrapped()) if err != nil { return err } - cfgPath := a.Viper.ConfigFileUsed() + cfgPath := a.configPath() // Overwrite the config file. if err := os.WriteFile(cfgPath, out, 0600); err != nil { return fmt.Errorf("failed to write config file at %s: %w", cfgPath, err) } + return nil } func (a *appState) GetConfigProviderNameFromChainId(chainId string) (string, error) { - chains := a.Config.Chains + chains := a.config.Chains for k, v := range chains { if v.ChainID() == chainId { return k, nil @@ -243,7 +232,7 @@ func (a *appState) GetConfigProviderNameFromChainId(chainId string) (string, err } func (a *appState) CheckIfProviderType(providerName string, providerType string) bool { - providers := a.Config.Wrapped() + providers := a.config.Wrapped() for p, v := range providers.ProviderConfigs { if p == providerName && v.Type == providerType { return true @@ -252,119 +241,152 @@ func (a *appState) CheckIfProviderType(providerName string, providerType string) return false } -func (a *appState) UpdateConfigsIfContainIcon(cmd *cobra.Command, src *relayer.Chain, dst *relayer.Chain) error { - - ctx := context.Background() - eg, egCtx := errgroup.WithContext(ctx) +// func (a *appState) UpdateConfigsIfContainIcon(cmd *cobra.Command, src *relayer.Chain, dst *relayer.Chain) error { + +// ctx := context.Background() +// eg, egCtx := errgroup.WithContext(ctx) + +// eg.Go(func() error { +// var err error +// err = a.UpdateProviderIfIcon(cmd, egCtx, src) +// if err != nil { +// return err +// } + +// return nil + +// }) +// eg.Go(func() error { +// var err error +// err = a.UpdateProviderIfIcon(cmd, egCtx, dst) +// if err != nil { +// return err +// } +// return nil + +// }) + +// if err := eg.Wait(); err != nil { +// return err +// } + +// return nil + +// } + +// func (a *appState) UpdateProviderIfIcon(cmd *cobra.Command, ctx context.Context, chain *relayer.Chain) error { + +// providerName, err := a.GetConfigProviderNameFromChainId(chain.ChainID()) +// if err != nil { +// return err +// } + +// if !a.CheckIfProviderType(providerName, "icon") { +// return nil +// } +// // height, err := chain.ChainProvider.QueryLatestHeight(ctx) +// // if err != nil { +// // return errors.New(fmt.Sprintf("Error fetching chain latest height %s ", chain.ChainID())) +// // } + +// // err = a.OverwriteChainConfig(cmd, providerName, "btpHeight", height) +// // if err != nil { +// // return errors.New(fmt.Sprintf("Error updating BTPHeight of config of chain %s ", chain.ChainID())) +// // } +// return nil +// } + +// func (a *appState) OverwriteChainConfig( +// cmd *cobra.Command, +// providerName string, +// fieldName string, +// fieldValue interface{}, +// ) error { + +// // use lock file to guard concurrent access to config.yaml +// lockFilePath := path.Join(a.homePath, "config", "config.lock") +// fileLock := flock.New(lockFilePath) +// err := fileLock.Lock() +// if err != nil { +// return fmt.Errorf("failed to acquire config lock: %w", err) +// } +// defer func() { +// if err := fileLock.Unlock(); err != nil { +// a.Log.Error("error unlocking config file lock, please manually delete", +// zap.String("filepath", lockFilePath), +// ) +// } +// }() + +// if err := initConfig(cmd, a); err != nil { +// return fmt.Errorf("failed to initialize config from file: %w", err) +// } + +// wrappedConfig := a.config.Wrapped() +// err = setProviderConfigField(wrappedConfig, providerName, fieldName, fieldValue) +// if err != nil { +// return err +// } + +// out, err := yaml.Marshal(wrappedConfig) +// if err != nil { +// return err +// } + +// cfgPath := a.viper.ConfigFileUsed() + +// // Overwrite the config file. +// if err := os.WriteFile(cfgPath, out, 0600); err != nil { +// return fmt.Errorf("failed to write config file at %s: %w", cfgPath, err) +// } + +// return nil +// } + +// func setProviderConfigField(cfg *ConfigOutputWrapper, providerName string, fieldToChange string, newValue interface{}) error { +// providerConfigs := cfg.ProviderConfigs +// providerConfigWrapper, ok := providerConfigs[providerName] +// if !ok { +// return fmt.Errorf("ProviderConfigWrapper %s not found", providerName) +// } +// providerConfigValue := providerConfigWrapper.Value +// if err := providerConfigValue.Set(fieldToChange, newValue); err != nil { +// return err +// } +// providerConfigWrapper.Value = providerConfigValue + +// return nil +// } + +// updatePathConfig overwrites the config file concurrently, +// locking to read, modify, then write the config. +func (a *appState) updatePathConfig( + ctx context.Context, + pathName string, + clientSrc, clientDst string, + connectionSrc, connectionDst string, +) error { + if pathName == "" { + return errors.New("empty path name not allowed") + } - eg.Go(func() error { - var err error - err = a.UpdateProviderIfIcon(cmd, egCtx, src) - if err != nil { - return err + return a.performConfigLockingOperation(ctx, func() error { + path, ok := a.config.Paths[pathName] + if !ok { + return fmt.Errorf("config does not exist for that path: %s", pathName) } - - return nil - - }) - eg.Go(func() error { - var err error - err = a.UpdateProviderIfIcon(cmd, egCtx, dst) - if err != nil { - return err + if clientSrc != "" { + path.Src.ClientID = clientSrc + } + if clientDst != "" { + path.Dst.ClientID = clientDst + } + if connectionSrc != "" { + path.Src.ConnectionID = connectionSrc + } + if connectionDst != "" { + path.Dst.ConnectionID = connectionDst } return nil - }) - - if err := eg.Wait(); err != nil { - return err - } - - return nil - -} - -func (a *appState) UpdateProviderIfIcon(cmd *cobra.Command, ctx context.Context, chain *relayer.Chain) error { - - providerName, err := a.GetConfigProviderNameFromChainId(chain.ChainID()) - if err != nil { - return err - } - - if !a.CheckIfProviderType(providerName, "icon") { - return nil - } - height, err := chain.ChainProvider.QueryLatestHeight(ctx) - if err != nil { - return errors.New(fmt.Sprintf("Error fetching chain latest height %s ", chain.ChainID())) - } - - err = a.OverwriteChainConfig(cmd, providerName, "btpHeight", height) - if err != nil { - return errors.New(fmt.Sprintf("Error updating BTPHeight of config of chain %s ", chain.ChainID())) - } - return nil -} - -func (a *appState) OverwriteChainConfig( - cmd *cobra.Command, - providerName string, - fieldName string, - fieldValue interface{}, -) error { - - // use lock file to guard concurrent access to config.yaml - lockFilePath := path.Join(a.HomePath, "config", "config.lock") - fileLock := flock.New(lockFilePath) - err := fileLock.Lock() - if err != nil { - return fmt.Errorf("failed to acquire config lock: %w", err) - } - defer func() { - if err := fileLock.Unlock(); err != nil { - a.Log.Error("error unlocking config file lock, please manually delete", - zap.String("filepath", lockFilePath), - ) - } - }() - - if err := initConfig(cmd, a); err != nil { - return fmt.Errorf("failed to initialize config from file: %w", err) - } - - wrappedConfig := a.Config.Wrapped() - err = setProviderConfigField(wrappedConfig, providerName, fieldName, fieldValue) - if err != nil { - return err - } - - out, err := yaml.Marshal(wrappedConfig) - if err != nil { - return err - } - - cfgPath := a.Viper.ConfigFileUsed() - - // Overwrite the config file. - if err := os.WriteFile(cfgPath, out, 0600); err != nil { - return fmt.Errorf("failed to write config file at %s: %w", cfgPath, err) - } - - return nil -} - -func setProviderConfigField(cfg *ConfigOutputWrapper, providerName string, fieldToChange string, newValue interface{}) error { - providerConfigs := cfg.ProviderConfigs - providerConfigWrapper, ok := providerConfigs[providerName] - if !ok { - return fmt.Errorf("ProviderConfigWrapper %s not found", providerName) - } - providerConfigValue := providerConfigWrapper.Value - if err := providerConfigValue.Set(fieldToChange, newValue); err != nil { - return err - } - providerConfigWrapper.Value = providerConfigValue - - return nil } diff --git a/cmd/chains.go b/cmd/chains.go index 6cf3117e9..53404cabe 100644 --- a/cmd/chains.go +++ b/cmd/chains.go @@ -54,7 +54,7 @@ func chainsAddrCmd(a *appState) *cobra.Command { $ %s chains address ibc-0 $ %s ch addr ibc-0`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { - chain, ok := a.Config.Chains[args[0]] + chain, ok := a.config.Chains[args[0]] if !ok { return errChainNotFound(args[0]) } @@ -83,7 +83,7 @@ $ %s chains show ibc-0 --yaml $ %s ch s ibc-0 --json $ %s ch s ibc-0 --yaml`, appName, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { - c, ok := a.Config.Chains[args[0]] + c, ok := a.config.Chains[args[0]] if !ok { return errChainNotFound(args[0]) } @@ -117,7 +117,7 @@ $ %s ch s ibc-0 --yaml`, appName, appName, appName, appName)), } }, } - return jsonFlag(a.Viper, cmd) + return jsonFlag(a.viper, cmd) } func chainsDeleteCmd(a *appState) *cobra.Command { @@ -130,12 +130,15 @@ func chainsDeleteCmd(a *appState) *cobra.Command { $ %s chains delete ibc-0 $ %s ch d ibc-0`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { - _, ok := a.Config.Chains[args[0]] - if !ok { - return errChainNotFound(args[0]) - } - a.Config.DeleteChain(args[0]) - return a.OverwriteConfig(a.Config) + chain := args[0] + return a.performConfigLockingOperation(cmd.Context(), func() error { + _, ok := a.config.Chains[chain] + if !ok { + return errChainNotFound(chain) + } + a.config.DeleteChain(chain) + return nil + }) }, } return cmd @@ -158,7 +161,7 @@ func chainsRegistryList(a *appState) *cobra.Command { return err } - chains, err := cregistry.DefaultChainRegistry(a.Log).ListChains(cmd.Context()) + chains, err := cregistry.DefaultChainRegistry(a.log).ListChains(cmd.Context()) if err != nil { return err } @@ -188,7 +191,7 @@ func chainsRegistryList(a *appState) *cobra.Command { return nil }, } - return yamlFlag(a.Viper, jsonFlag(a.Viper, cmd)) + return yamlFlag(a.viper, jsonFlag(a.viper, cmd)) } func chainsListCmd(a *appState) *cobra.Command { @@ -211,7 +214,7 @@ $ %s ch l`, appName, appName)), return err } - configs := a.Config.Wrapped().ProviderConfigs + configs := a.config.Wrapped().ProviderConfigs if len(configs) == 0 { fmt.Fprintln(cmd.ErrOrStderr(), "warning: no chains found (do you need to run 'rly chains add'?)") } @@ -235,7 +238,7 @@ $ %s ch l`, appName, appName)), return nil default: i := 0 - for _, c := range a.Config.Chains { + for _, c := range a.config.Chains { var ( key = xIcon p = xIcon @@ -251,7 +254,7 @@ $ %s ch l`, appName, appName)), bal = check } - for _, pth := range a.Config.Paths { + for _, pth := range a.config.Paths { if pth.Src.ChainID == c.ChainProvider.ChainId() || pth.Dst.ChainID == c.ChainID() { p = check } @@ -263,7 +266,7 @@ $ %s ch l`, appName, appName)), } }, } - return yamlFlag(a.Viper, jsonFlag(a.Viper, cmd)) + return yamlFlag(a.viper, jsonFlag(a.viper, cmd)) } func chainsAddCmd(a *appState) *cobra.Command { @@ -283,48 +286,45 @@ func chainsAddCmd(a *appState) *cobra.Command { return err } - if ok := a.Config; ok == nil { + if ok := a.config; ok == nil { return fmt.Errorf("config not initialized, consider running `rly config init`") } - // default behavior fetch from chain registry - // still allow for adding config from url or file - switch { - case file != "": - var chainName string - switch len(args) { - case 0: - chainName = strings.Split(filepath.Base(file), ".")[0] - case 1: - chainName = args[0] + return a.performConfigLockingOperation(cmd.Context(), func() error { + // default behavior fetch from chain registry + // still allow for adding config from url or file + switch { + case file != "": + var chainName string + switch len(args) { + case 0: + chainName = strings.Split(filepath.Base(file), ".")[0] + case 1: + chainName = args[0] + default: + return errors.New("one chain name is required") + } + if err := addChainFromFile(a, chainName, file); err != nil { + return err + } + case url != "": + if len(args) != 1 { + return errors.New("one chain name is required") + } + if err := addChainFromURL(a, args[0], url); err != nil { + return err + } default: - return errors.New("one chain name is required") - } - if err := addChainFromFile(a, chainName, file); err != nil { - return err - } - case url != "": - if len(args) != 1 { - return errors.New("one chain name is required") - } - if err := addChainFromURL(a, args[0], url); err != nil { - return err - } - default: - if err := addChainsFromRegistry(cmd.Context(), a, args); err != nil { - return err + if err := addChainsFromRegistry(cmd.Context(), a, args); err != nil { + return err + } } - } - - if err := validateConfig(a.Config); err != nil { - return err - } - - return a.OverwriteConfig(a.Config) + return nil + }) }, } - return chainsAddFlags(a.Viper, cmd) + return chainsAddFlags(a.viper, cmd) } func chainsAddDirCmd(a *appState) *cobra.Command { @@ -340,10 +340,7 @@ func chainsAddDirCmd(a *appState) *cobra.Command { $ %s chains add-dir configs/demo/chains $ %s ch ad testnet/chains/`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) (err error) { - if err := addChainsFromDirectory(cmd.ErrOrStderr(), a, args[0]); err != nil { - return err - } - return a.OverwriteConfig(a.Config) + return addChainsFromDirectory(cmd.Context(), cmd.ErrOrStderr(), a, args[0]) }, } @@ -369,15 +366,15 @@ func addChainFromFile(a *appState, chainName string, file string) error { } prov, err := pcw.Value.NewProvider( - a.Log.With(zap.String("provider_type", pcw.Type)), - a.HomePath, a.Debug, chainName, + a.log.With(zap.String("provider_type", pcw.Type)), + a.homePath, a.debug, chainName, ) if err != nil { return fmt.Errorf("failed to build ChainProvider for %s: %w", file, err) } - c := relayer.NewChain(a.Log, prov, a.Debug) - if err = a.Config.AddChain(c); err != nil { + c := relayer.NewChain(a.log, prov, a.debug) + if err = a.config.AddChain(c); err != nil { return err } @@ -409,28 +406,28 @@ func addChainFromURL(a *appState, chainName string, rawurl string) error { // build the ChainProvider before initializing the chain prov, err := pcw.Value.NewProvider( - a.Log.With(zap.String("provider_type", pcw.Type)), - a.HomePath, a.Debug, chainName, + a.log.With(zap.String("provider_type", pcw.Type)), + a.homePath, a.debug, chainName, ) if err != nil { return fmt.Errorf("failed to build ChainProvider for %s: %w", rawurl, err) } - c := relayer.NewChain(a.Log, prov, a.Debug) - if err := a.Config.AddChain(c); err != nil { + c := relayer.NewChain(a.log, prov, a.debug) + if err := a.config.AddChain(c); err != nil { return err } return nil } func addChainsFromRegistry(ctx context.Context, a *appState, chains []string) error { - chainRegistry := cregistry.DefaultChainRegistry(a.Log) + chainRegistry := cregistry.DefaultChainRegistry(a.log) var existed, failed, added []string for _, chain := range chains { - if _, ok := a.Config.Chains[chain]; ok { - a.Log.Warn( + if _, ok := a.config.Chains[chain]; ok { + a.log.Warn( "Chain already exists", zap.String("chain", chain), zap.String("source_link", chainRegistry.SourceLink()), @@ -441,7 +438,7 @@ func addChainsFromRegistry(ctx context.Context, a *appState, chains []string) er chainInfo, err := chainRegistry.GetChain(ctx, chain) if err != nil { - a.Log.Warn( + a.log.Warn( "Error retrieving chain", zap.String("chain", chain), zap.Error(err), @@ -452,7 +449,7 @@ func addChainsFromRegistry(ctx context.Context, a *appState, chains []string) er chainConfig, err := chainInfo.GetChainConfig(ctx) if err != nil { - a.Log.Warn( + a.log.Warn( "Error generating chain config", zap.String("chain", chain), zap.Error(err), @@ -465,11 +462,11 @@ func addChainsFromRegistry(ctx context.Context, a *appState, chains []string) er // build the ChainProvider prov, err := chainConfig.NewProvider( - a.Log.With(zap.String("provider_type", "cosmos")), - a.HomePath, a.Debug, chainInfo.ChainName, + a.log.With(zap.String("provider_type", "cosmos")), + a.homePath, a.debug, chainInfo.ChainName, ) if err != nil { - a.Log.Warn( + a.log.Warn( "Failed to build ChainProvider", zap.String("chain_id", chainConfig.ChainID), zap.Error(err), @@ -479,9 +476,9 @@ func addChainsFromRegistry(ctx context.Context, a *appState, chains []string) er } // add to config - c := relayer.NewChain(a.Log, prov, a.Debug) - if err = a.Config.AddChain(c); err != nil { - a.Log.Warn( + c := relayer.NewChain(a.log, prov, a.debug) + if err = a.config.AddChain(c); err != nil { + a.log.Warn( "Failed to add chain to config", zap.String("chain", chain), zap.Error(err), @@ -494,7 +491,7 @@ func addChainsFromRegistry(ctx context.Context, a *appState, chains []string) er // found the correct chain so move on to next chain in chains } - a.Log.Info("Config update status", + a.log.Info("Config update status", zap.Any("added", added), zap.Any("failed", failed), zap.Any("already existed", existed), diff --git a/cmd/config.go b/cmd/config.go index 8ab798ced..fa692decd 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -33,6 +33,7 @@ import ( archway "github.com/cosmos/relayer/v2/relayer/chains/archway" "github.com/cosmos/relayer/v2/relayer/chains/cosmos" "github.com/cosmos/relayer/v2/relayer/chains/icon" + "github.com/cosmos/relayer/v2/relayer/chains/penumbra" "github.com/cosmos/relayer/v2/relayer/provider" "github.com/spf13/cobra" "go.uber.org/zap" @@ -89,14 +90,14 @@ $ %s cfg list`, appName, defaultHome, appName)), case yml && jsn: return fmt.Errorf("can't pass both --json and --yaml, must pick one") case jsn: - out, err := json.Marshal(a.Config.Wrapped()) + out, err := json.Marshal(a.config.Wrapped()) if err != nil { return err } fmt.Fprintln(cmd.OutOrStdout(), string(out)) return nil default: - out, err := yaml.Marshal(a.Config.Wrapped()) + out, err := yaml.Marshal(a.config.Wrapped()) if err != nil { return err } @@ -106,7 +107,7 @@ $ %s cfg list`, appName, defaultHome, appName)), }, } - return yamlFlag(a.Viper, jsonFlag(a.Viper, cmd)) + return yamlFlag(a.viper, jsonFlag(a.viper, cmd)) } // Command for initializing an empty config at the --home location @@ -167,7 +168,7 @@ $ %s cfg i`, appName, defaultHome, appName)), return fmt.Errorf("config already exists: %s", cfgPath) }, } - cmd = memoFlag(a.Viper, cmd) + cmd = memoFlag(a.viper, cmd) return cmd } @@ -177,48 +178,51 @@ $ %s cfg i`, appName, defaultHome, appName)), // If any files fail to parse or otherwise are not able to be added to a's chains, // the error is logged. // An error is only returned if the directory cannot be read at all. -func addChainsFromDirectory(stderr io.Writer, a *appState, dir string) error { +func addChainsFromDirectory(ctx context.Context, stderr io.Writer, a *appState, dir string) error { dir = path.Clean(dir) files, err := ioutil.ReadDir(dir) if err != nil { return err } - for _, f := range files { - pth := filepath.Join(dir, f.Name()) - if f.IsDir() { - fmt.Fprintf(stderr, "directory at %s, skipping...\n", pth) - continue - } - byt, err := os.ReadFile(pth) - if err != nil { - fmt.Fprintf(stderr, "failed to read file %s. Err: %v skipping...\n", pth, err) - continue - } + return a.performConfigLockingOperation(ctx, func() error { + for _, f := range files { + pth := filepath.Join(dir, f.Name()) + if f.IsDir() { + fmt.Fprintf(stderr, "directory at %s, skipping...\n", pth) + continue + } - var pcw ProviderConfigWrapper - if err = json.Unmarshal(byt, &pcw); err != nil { - fmt.Fprintf(stderr, "failed to unmarshal file %s. Err: %v skipping...\n", pth, err) - continue - } - chainName := strings.Split(f.Name(), ".")[0] - prov, err := pcw.Value.NewProvider( - a.Log.With(zap.String("provider_type", pcw.Type)), - a.HomePath, a.Debug, chainName, - ) - if err != nil { - fmt.Fprintf(stderr, "failed to build ChainProvider for %s. Err: %v \n", pth, err) - continue - } + byt, err := os.ReadFile(pth) + if err != nil { + fmt.Fprintf(stderr, "failed to read file %s. Err: %v skipping...\n", pth, err) + continue + } + + var pcw ProviderConfigWrapper + if err = json.Unmarshal(byt, &pcw); err != nil { + fmt.Fprintf(stderr, "failed to unmarshal file %s. Err: %v skipping...\n", pth, err) + continue + } + chainName := strings.Split(f.Name(), ".")[0] + prov, err := pcw.Value.NewProvider( + a.log.With(zap.String("provider_type", pcw.Type)), + a.homePath, a.debug, chainName, + ) + if err != nil { + fmt.Fprintf(stderr, "failed to build ChainProvider for %s. Err: %v \n", pth, err) + continue + } - c := relayer.NewChain(a.Log, prov, a.Debug) - if err = a.Config.AddChain(c); err != nil { - fmt.Fprintf(stderr, "failed to add chain %s: %v \n", pth, err) - continue + c := relayer.NewChain(a.log, prov, a.debug) + if err = a.config.AddChain(c); err != nil { + fmt.Fprintf(stderr, "failed to add chain %s: %v \n", pth, err) + continue + } + fmt.Fprintf(stderr, "added chain %s...\n", c.ChainProvider.ChainId()) } - fmt.Fprintf(stderr, "added chain %s...\n", c.ChainProvider.ChainId()) - } - return nil + return nil + }) } // addPathsFromDirectory parses all the files containing JSON-encoded paths in dir, @@ -232,36 +236,38 @@ func addPathsFromDirectory(ctx context.Context, stderr io.Writer, a *appState, d if err != nil { return err } - for _, f := range files { - pth := filepath.Join(dir, f.Name()) - if f.IsDir() { - fmt.Fprintf(stderr, "directory at %s, skipping...\n", pth) - continue - } + return a.performConfigLockingOperation(ctx, func() error { + for _, f := range files { + pth := filepath.Join(dir, f.Name()) + if f.IsDir() { + fmt.Fprintf(stderr, "directory at %s, skipping...\n", pth) + continue + } - byt, err := os.ReadFile(pth) - if err != nil { - return fmt.Errorf("failed to read file %s: %w", pth, err) - } + byt, err := os.ReadFile(pth) + if err != nil { + return fmt.Errorf("failed to read file %s: %w", pth, err) + } - p := &relayer.Path{} - if err = json.Unmarshal(byt, p); err != nil { - return fmt.Errorf("failed to unmarshal file %s: %w", pth, err) - } + p := &relayer.Path{} + if err = json.Unmarshal(byt, p); err != nil { + return fmt.Errorf("failed to unmarshal file %s: %w", pth, err) + } - pthName := strings.Split(f.Name(), ".")[0] - if err := a.Config.ValidatePath(ctx, stderr, p); err != nil { - return fmt.Errorf("failed to validate path %s: %w", pth, err) - } + pthName := strings.Split(f.Name(), ".")[0] + if err := a.config.ValidatePath(ctx, stderr, p); err != nil { + return fmt.Errorf("failed to validate path %s: %w", pth, err) + } - if err := a.Config.AddPath(pthName, p); err != nil { - return fmt.Errorf("failed to add path %s: %w", pth, err) - } + if err := a.config.AddPath(pthName, p); err != nil { + return fmt.Errorf("failed to add path %s: %w", pth, err) + } - fmt.Fprintf(stderr, "added path %s...\n\n", pthName) - } + fmt.Fprintf(stderr, "added path %s...\n\n", pthName) + } - return nil + return nil + }) } // Wrapped converts the Config struct into a ConfigOutputWrapper struct @@ -278,8 +284,8 @@ func (c *Config) Wrapped() *ConfigOutputWrapper { } // rlyMemo returns a formatted message memo string -// that includes "rly" and the version, e.g. "rly(v2.0.0)" -// or "My custom memo | rly(v2.0.0)" +// that includes "rly" and the version, e.g. "rly(v2.3.0)" +// or "My custom memo | rly(v2.3.0)" func rlyMemo(memo string) string { if memo == "-" { // omit memo entirely @@ -324,6 +330,34 @@ type ConfigInputWrapper struct { Paths relayer.Paths `yaml:"paths"` } +// RuntimeConfig converts the input disk config into the relayer runtime config. +func (c *ConfigInputWrapper) RuntimeConfig(ctx context.Context, a *appState) (*Config, error) { + // build providers for each chain + chains := make(relayer.Chains) + for chainName, pcfg := range c.ProviderConfigs { + prov, err := pcfg.Value.(provider.ProviderConfig).NewProvider( + a.log.With(zap.String("provider_type", pcfg.Type)), + a.homePath, a.debug, chainName, + ) + if err != nil { + return nil, fmt.Errorf("failed to build ChainProviders: %w", err) + } + + if err := prov.Init(ctx); err != nil { + return nil, fmt.Errorf("failed to initialize provider: %w", err) + } + + chain := relayer.NewChain(a.log, prov, a.debug) + chains[chainName] = chain + } + + return &Config{ + Global: c.Global, + Chains: chains, + Paths: c.Paths, + }, nil +} + type ProviderConfigs map[string]*ProviderConfigWrapper // ProviderConfigWrapper is an intermediary type for parsing arbitrary ProviderConfigs from json files and writing to json/yaml files @@ -342,9 +376,10 @@ type ProviderConfigYAMLWrapper struct { // NOTE: Add new ProviderConfig types in the map here with the key set equal to the type of ChainProvider (e.g. cosmos, substrate, etc.) func (pcw *ProviderConfigWrapper) UnmarshalJSON(data []byte) error { customTypes := map[string]reflect.Type{ - "cosmos": reflect.TypeOf(cosmos.CosmosProviderConfig{}), - "icon": reflect.TypeOf(icon.IconProviderConfig{}), - "archway": reflect.TypeOf(archway.ArchwayProviderConfig{}), + "cosmos": reflect.TypeOf(cosmos.CosmosProviderConfig{}), + "icon": reflect.TypeOf(icon.IconProviderConfig{}), + "archway": reflect.TypeOf(archway.ArchwayProviderConfig{}), + "penumbra": reflect.TypeOf(penumbra.PenumbraProviderConfig{}), } val, err := UnmarshalJSONProviderConfig(data, customTypes) if err != nil { @@ -401,6 +436,8 @@ func (iw *ProviderConfigYAMLWrapper) UnmarshalYAML(n *yaml.Node) error { iw.Value = new(icon.IconProviderConfig) case "archway": iw.Value = new(archway.ArchwayProviderConfig) + case "penumbra": + iw.Value = new(penumbra.PenumbraProviderConfig) default: return fmt.Errorf("%s is an invalid chain type, check your config file", iw.Type) } @@ -516,6 +553,10 @@ func checkPathEndConflict(pathID, direction string, oldPe, newPe *relayer.PathEn // AddPath adds an additional path to the config func (c *Config) AddPath(name string, path *relayer.Path) (err error) { + // Ensure path is initialized. + if c.Paths == nil { + c.Paths = make(relayer.Paths) + } // Check if the path does not yet exist. oldPath, err := c.Paths.Get(name) if err != nil { @@ -539,87 +580,19 @@ func (c *Config) DeleteChain(chain string) { } // validateConfig is used to validate the GlobalConfig values -func validateConfig(c *Config) error { +func (c *Config) validateConfig() error { _, err := time.ParseDuration(c.Global.Timeout) if err != nil { return fmt.Errorf("did you remember to run 'rly config init' error:%w", err) } - return nil -} - -// initConfig reads config file into a.Config if file is present. -func initConfig(cmd *cobra.Command, a *appState) error { - if a.HomePath == "" { - var err error - a.HomePath, err = cmd.PersistentFlags().GetString(flagHome) - if err != nil { - return err - } - } - - cfgPath := path.Join(a.HomePath, "config", "config.yaml") - if _, err := os.Stat(cfgPath); err != nil { - // don't return error if file doesn't exist - return nil - } - a.Viper.SetConfigFile(cfgPath) - if err := a.Viper.ReadInConfig(); err != nil { - return err - } - // read the config file bytes - file, err := os.ReadFile(a.Viper.ConfigFileUsed()) - if err != nil { - fmt.Fprintln(cmd.ErrOrStderr(), "Error reading file:", err) - return err - } - - // unmarshall them into the wrapper struct - cfgWrapper := &ConfigInputWrapper{} - err = yaml.Unmarshal(file, cfgWrapper) - if err != nil { - fmt.Fprintln(cmd.ErrOrStderr(), "Error unmarshalling config:", err) - return err - } - // verify that the channel filter rule is valid for every path in the config - for _, p := range cfgWrapper.Paths { + for _, p := range c.Paths { if err := p.ValidateChannelFilterRule(); err != nil { return fmt.Errorf("error initializing the relayer config for path %s: %w", p.String(), err) } } - // build the config struct - chains := make(relayer.Chains) - for chainName, pcfg := range cfgWrapper.ProviderConfigs { - prov, err := pcfg.Value.(provider.ProviderConfig).NewProvider( - a.Log.With(zap.String("provider_type", pcfg.Type)), - a.HomePath, a.Debug, chainName, - ) - if err != nil { - return fmt.Errorf("failed to build ChainProviders: %w", err) - } - - if err := prov.Init(cmd.Context()); err != nil { - return fmt.Errorf("failed to initialize provider: %w", err) - } - - chain := relayer.NewChain(a.Log, prov, a.Debug) - chains[chainName] = chain - } - - a.Config = &Config{ - Global: cfgWrapper.Global, - Chains: chains, - Paths: cfgWrapper.Paths, - } - - // ensure config has []*relayer.Chain used for all chain operations - if err := validateConfig(a.Config); err != nil { - fmt.Fprintln(cmd.ErrOrStderr(), "Error parsing chain config:", err) - return err - } - return nil } diff --git a/cmd/flags.go b/cmd/flags.go index a0bc5e226..1254a9e6d 100644 --- a/cmd/flags.go +++ b/cmd/flags.go @@ -234,11 +234,12 @@ func urlFlag(v *viper.Viper, cmd *cobra.Command) *cobra.Command { } func strategyFlag(v *viper.Viper, cmd *cobra.Command) *cobra.Command { - cmd.Flags().StringP(flagMaxTxSize, "s", "2", "strategy of path to generate of the messages in a relay transaction") - cmd.Flags().StringP(flagMaxMsgLength, "l", "5", "maximum number of messages in a relay transaction") - if err := v.BindPFlag(flagMaxTxSize, cmd.Flags().Lookup(flagMaxTxSize)); err != nil { - panic(err) - } + cmd.Flags().Uint64P( + flagMaxMsgLength, + "l", + relayer.DefaultMaxMsgLength, + "maximum number of messages per transaction", + ) if err := v.BindPFlag(flagMaxMsgLength, cmd.Flags().Lookup(flagMaxMsgLength)); err != nil { panic(err) } diff --git a/cmd/keys.go b/cmd/keys.go index 36072d405..0ddd447d4 100644 --- a/cmd/keys.go +++ b/cmd/keys.go @@ -22,6 +22,7 @@ import ( "io" "strings" + "github.com/cosmos/cosmos-sdk/crypto/hd" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/relayer/v2/relayer/chains/cosmos" "github.com/spf13/cobra" @@ -30,6 +31,7 @@ import ( const ( flagCoinType = "coin-type" + flagAlgo = "signing-algorithm" defaultCoinType uint32 = sdk.CoinType ) @@ -46,8 +48,8 @@ func keysCmd(a *appState) *cobra.Command { keysRestoreCmd(a), keysDeleteCmd(a), keysListCmd(a), - keysShowCmd(a), keysExportCmd(a), + keysShowCmd(a), ) return cmd @@ -65,7 +67,7 @@ $ %s keys add ibc-0 $ %s keys add ibc-1 key2 $ %s k a cosmoshub testkey`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { - chain, ok := a.Config.Chains[args[0]] + chain, ok := a.config.Chains[args[0]] if !ok { return errChainNotFound(args[0]) } @@ -75,20 +77,35 @@ $ %s k a cosmoshub testkey`, appName, appName, appName)), return errKeyExists(keyName) } - coinType, err := cmd.Flags().GetInt32(flagCoinType) + cmdFlags := cmd.Flags() + + coinType, err := cmdFlags.GetInt32(flagCoinType) if err != nil { return err } if coinType < 0 { - if ccp, ok := chain.ChainProvider.(*cosmos.CosmosProvider); ok { - coinType = int32(ccp.PCfg.Slip44) + if ccp, ok := chain.ChainProvider.(*cosmos.CosmosProvider); ok && ccp.PCfg.Slip44 != nil { + coinType = int32(*ccp.PCfg.Slip44) } else { coinType = int32(defaultCoinType) } } - ko, err := chain.ChainProvider.AddKey(keyName, uint32(coinType)) + algo, err := cmdFlags.GetString(flagAlgo) + if err != nil { + return err + } + + if algo == "" { + if ccp, ok := chain.ChainProvider.(*cosmos.CosmosProvider); ok { + algo = ccp.PCfg.SigningAlgorithm + } else { + algo = string(hd.Secp256k1Type) + } + } + + ko, err := chain.ChainProvider.AddKey(keyName, uint32(coinType), algo) if err != nil { return fmt.Errorf("failed to add key: %w", err) } @@ -103,6 +120,7 @@ $ %s k a cosmoshub testkey`, appName, appName, appName)), }, } cmd.Flags().Int32(flagCoinType, -1, "coin type number for HD derivation") + cmd.Flags().String(flagAlgo, "", "signing algorithm for key (secp256k1, sr25519)") return cmd } @@ -120,7 +138,7 @@ $ %s k r cosmoshub faucet-key "[mnemonic-words]"`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { keyName := args[1] - chain, ok := a.Config.Chains[args[0]] + chain, ok := a.config.Chains[args[0]] if !ok { return errChainNotFound(args[0]) } @@ -129,20 +147,35 @@ $ %s k r cosmoshub faucet-key "[mnemonic-words]"`, appName, appName)), return errKeyExists(keyName) } - coinType, err := cmd.Flags().GetInt32(flagCoinType) + cmdFlags := cmd.Flags() + + coinType, err := cmdFlags.GetInt32(flagCoinType) if err != nil { return err } if coinType < 0 { - if ccp, ok := chain.ChainProvider.(*cosmos.CosmosProvider); ok { - coinType = int32(ccp.PCfg.Slip44) + if ccp, ok := chain.ChainProvider.(*cosmos.CosmosProvider); ok && ccp.PCfg.Slip44 != nil { + coinType = int32(*ccp.PCfg.Slip44) } else { coinType = int32(defaultCoinType) } } - address, err := chain.ChainProvider.RestoreKey(keyName, args[2], uint32(coinType)) + algo, err := cmdFlags.GetString(flagAlgo) + if err != nil { + return err + } + + if algo == "" { + if ccp, ok := chain.ChainProvider.(*cosmos.CosmosProvider); ok { + algo = ccp.PCfg.SigningAlgorithm + } else { + algo = string(hd.Secp256k1Type) + } + } + + address, err := chain.ChainProvider.RestoreKey(keyName, args[2], uint32(coinType), algo) if err != nil { return err } @@ -152,6 +185,7 @@ $ %s k r cosmoshub faucet-key "[mnemonic-words]"`, appName, appName)), }, } cmd.Flags().Int32(flagCoinType, -1, "coin type number for HD derivation") + cmd.Flags().String(flagAlgo, "", "signing algorithm for key (secp256k1, sr25519)") return cmd } @@ -168,7 +202,7 @@ $ %s keys delete ibc-0 -y $ %s keys delete ibc-1 key2 -y $ %s k d cosmoshub default`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { - chain, ok := a.Config.Chains[args[0]] + chain, ok := a.config.Chains[args[0]] if !ok { return errChainNotFound(args[0]) } @@ -195,7 +229,7 @@ $ %s k d cosmoshub default`, appName, appName, appName)), }, } - return skipConfirm(a.Viper, cmd) + return skipConfirm(a.viper, cmd) } func askForConfirmation(a *appState, stdin io.Reader, stderr io.Writer) bool { @@ -203,7 +237,7 @@ func askForConfirmation(a *appState, stdin io.Reader, stderr io.Writer) bool { _, err := fmt.Fscanln(stdin, &response) if err != nil { - a.Log.Fatal("Failed to read input", zap.Error(err)) + a.log.Fatal("Failed to read input", zap.Error(err)) } switch strings.ToLower(response) { @@ -230,7 +264,7 @@ $ %s k l ibc-1`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chainName := args[0] - chain, ok := a.Config.Chains[chainName] + chain, ok := a.config.Chains[chainName] if !ok { return errChainNotFound(chainName) } @@ -255,47 +289,6 @@ $ %s k l ibc-1`, appName, appName)), return cmd } -// keysShowCmd respresents the `keys show` command -func keysShowCmd(a *appState) *cobra.Command { - cmd := &cobra.Command{ - Use: "show chain_name [key_name]", - Aliases: []string{"s"}, - Short: "Shows a key from the keychain associated with a particular chain", - Args: withUsage(cobra.RangeArgs(1, 2)), - Example: strings.TrimSpace(fmt.Sprintf(` -$ %s keys show ibc-0 -$ %s keys show ibc-1 key2 -$ %s k s ibc-2 testkey`, appName, appName, appName)), - RunE: func(cmd *cobra.Command, args []string) error { - chain, ok := a.Config.Chains[args[0]] - if !ok { - return errChainNotFound(args[0]) - } - - var keyName string - if len(args) == 2 { - keyName = args[1] - } else { - keyName = chain.ChainProvider.Key() - } - - if !chain.ChainProvider.KeyExists(keyName) { - return errKeyDoesntExist(keyName) - } - - address, err := chain.ChainProvider.ShowAddress(keyName) - if err != nil { - return err - } - - fmt.Fprintln(cmd.OutOrStdout(), address) - return nil - }, - } - - return cmd -} - // keysExportCmd respresents the `keys export` command func keysExportCmd(a *appState) *cobra.Command { cmd := &cobra.Command{ @@ -308,7 +301,7 @@ $ %s keys export ibc-0 testkey $ %s k e cosmoshub testkey`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { keyName := args[1] - chain, ok := a.Config.Chains[args[0]] + chain, ok := a.config.Chains[args[0]] if !ok { return errChainNotFound(args[0]) } @@ -329,3 +322,64 @@ $ %s k e cosmoshub testkey`, appName, appName)), return cmd } + +// ShowAddressByChainAndKey represents the logic for showing relayer address by chain_name and key_name +func (a *appState) showAddressByChainAndKey(cmd *cobra.Command, args []string) error { + chain, ok := a.config.Chains[args[0]] + if !ok { + return errChainNotFound(args[0]) + } + + var keyName string + if len(args) == 2 { + keyName = args[1] + } else { + keyName = chain.ChainProvider.Key() + } + + if !chain.ChainProvider.KeyExists(keyName) { + return errKeyDoesntExist(keyName) + } + + address, err := chain.ChainProvider.ShowAddress(keyName) + if err != nil { + return err + } + + fmt.Fprintln(cmd.OutOrStdout(), address) + return nil +} + +// keysShowCmd respresents the `keys show` command +func keysShowCmd(a *appState) *cobra.Command { + cmd := &cobra.Command{ + Use: "show chain_name [key_name]", + Aliases: []string{"s"}, + Short: "Shows a key from the keychain associated with a particular chain", + Args: withUsage(cobra.RangeArgs(1, 2)), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s keys show ibc-0 +$ %s keys show ibc-1 key2 +$ %s k s ibc-2 testkey`, appName, appName, appName)), + RunE: a.showAddressByChainAndKey, + } + + return cmd +} + +// addressCmd represents the address of a relayer +func addressCmd(a *appState) *cobra.Command { + cmd := &cobra.Command{ + Use: "address chain_name [key_name]", + Aliases: []string{"a"}, + Short: "Shows the address of a relayer", + Args: withUsage(cobra.RangeArgs(1, 2)), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s address ibc-0 +$ %s address ibc-1 key2 +$ %s a ibc-2 testkey`, appName, appName, appName)), + RunE: a.showAddressByChainAndKey, + } + + return cmd +} diff --git a/cmd/keys_test.go b/cmd/keys_test.go index 6a302fd1c..df51f8924 100644 --- a/cmd/keys_test.go +++ b/cmd/keys_test.go @@ -42,6 +42,8 @@ func TestKeysRestore_Delete(t *testing.T) { _ = sys.MustRun(t, "config", "init") + slip44 := 118 + sys.MustAddChain(t, "testChain", cmd.ProviderConfigWrapper{ Type: "cosmos", Value: cosmos.CosmosProviderConfig{ @@ -49,7 +51,7 @@ func TestKeysRestore_Delete(t *testing.T) { ChainID: "testcosmos", KeyringBackend: "test", Timeout: "10s", - Slip44: 118, + Slip44: &slip44, }, }) @@ -82,6 +84,8 @@ func TestKeysExport(t *testing.T) { _ = sys.MustRun(t, "config", "init") + slip44 := 118 + sys.MustAddChain(t, "testChain", cmd.ProviderConfigWrapper{ Type: "cosmos", Value: cosmos.CosmosProviderConfig{ @@ -89,7 +93,7 @@ func TestKeysExport(t *testing.T) { ChainID: "testcosmos", KeyringBackend: "test", Timeout: "10s", - Slip44: 118, + Slip44: &slip44, }, }) @@ -113,3 +117,68 @@ func TestKeysExport(t *testing.T) { // TODO: confirm the imported address matches? } + +func TestKeysDefaultCoinType(t *testing.T) { + t.Parallel() + + sys := relayertest.NewSystem(t) + + _ = sys.MustRun(t, "config", "init") + + slip44 := 118 + + sys.MustAddChain(t, "testChain", cmd.ProviderConfigWrapper{ + Type: "cosmos", + Value: cosmos.CosmosProviderConfig{ + AccountPrefix: "cosmos", + ChainID: "testcosmos-1", + KeyringBackend: "test", + Timeout: "10s", + Slip44: &slip44, + }, + }) + + sys.MustAddChain(t, "testChain2", cmd.ProviderConfigWrapper{ + Type: "cosmos", + Value: cosmos.CosmosProviderConfig{ + AccountPrefix: "cosmos", + ChainID: "testcosmos-2", + KeyringBackend: "test", + Timeout: "10s", + }, + }) + + // Restore a key with mnemonic to the chain. + res := sys.MustRun(t, "keys", "restore", "testChain", "default", relayertest.ZeroMnemonic) + require.Equal(t, res.Stdout.String(), relayertest.ZeroCosmosAddr+"\n") + require.Empty(t, res.Stderr.String()) + + // Restore a key with mnemonic to the chain. + res = sys.MustRun(t, "keys", "restore", "testChain2", "default", relayertest.ZeroMnemonic) + require.Equal(t, res.Stdout.String(), relayertest.ZeroCosmosAddr+"\n") + require.Empty(t, res.Stderr.String()) + + // Export the key. + res = sys.MustRun(t, "keys", "export", "testChain", "default") + armorOut := res.Stdout.String() + require.Contains(t, armorOut, "BEGIN TENDERMINT PRIVATE KEY") + require.Empty(t, res.Stderr.String()) + + // Export the key. + res = sys.MustRun(t, "keys", "export", "testChain2", "default") + armorOut2 := res.Stdout.String() + require.Contains(t, armorOut, "BEGIN TENDERMINT PRIVATE KEY") + require.Empty(t, res.Stderr.String()) + + // Import the key to a temporary keyring. + registry := codectypes.NewInterfaceRegistry() + cryptocodec.RegisterInterfaces(registry) + cdc := codec.NewProtoCodec(registry) + kr := keyring.NewInMemory(cdc) + require.NoError(t, kr.ImportPrivKey("temp", armorOut, keys.DefaultKeyPass)) + + // This should fail due to same key + err := kr.ImportPrivKey("temp", armorOut2, keys.DefaultKeyPass) + require.Error(t, err, "same key was able to be imported twice") + require.Contains(t, err.Error(), "cannot overwrite key") +} diff --git a/cmd/paths.go b/cmd/paths.go index 46fc5aec8..640414fa5 100644 --- a/cmd/paths.go +++ b/cmd/paths.go @@ -49,11 +49,13 @@ func pathsDeleteCmd(a *appState) *cobra.Command { $ %s paths delete demo-path $ %s pth d path-name`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { - if _, err := a.Config.Paths.Get(args[0]); err != nil { - return err - } - delete(a.Config.Paths, args[0]) - return a.OverwriteConfig(a.Config) + return a.performConfigLockingOperation(cmd.Context(), func() error { + if _, err := a.config.Paths.Get(args[0]); err != nil { + return err + } + delete(a.config.Paths, args[0]) + return nil + }) }, } return cmd @@ -76,14 +78,14 @@ $ %s pth l`, appName, appName, appName)), case yml && jsn: return fmt.Errorf("can't pass both --json and --yaml, must pick one") case yml: - out, err := yaml.Marshal(a.Config.Paths) + out, err := yaml.Marshal(a.config.Paths) if err != nil { return err } fmt.Fprintln(cmd.OutOrStdout(), string(out)) return nil case jsn: - out, err := json.Marshal(a.Config.Paths) + out, err := json.Marshal(a.config.Paths) if err != nil { return err } @@ -91,8 +93,8 @@ $ %s pth l`, appName, appName, appName)), return nil default: i := 0 - for k, pth := range a.Config.Paths { - chains, err := a.Config.Chains.Gets(pth.Src.ChainID, pth.Dst.ChainID) + for k, pth := range a.config.Paths { + chains, err := a.config.Chains.Gets(pth.Src.ChainID, pth.Dst.ChainID) if err != nil { return err } @@ -107,7 +109,7 @@ $ %s pth l`, appName, appName, appName)), } }, } - return yamlFlag(a.Viper, jsonFlag(a.Viper, cmd)) + return yamlFlag(a.viper, jsonFlag(a.viper, cmd)) } func printPath(stdout io.Writer, i int, k string, pth *relayer.Path, chains, clients, connection string) { @@ -133,11 +135,11 @@ $ %s paths show demo-path --yaml $ %s paths show demo-path --json $ %s pth s path-name`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { - p, err := a.Config.Paths.Get(args[0]) + p, err := a.config.Paths.Get(args[0]) if err != nil { return err } - chains, err := a.Config.Chains.Gets(p.Src.ChainID, p.Dst.ChainID) + chains, err := a.config.Chains.Gets(p.Src.ChainID, p.Dst.ChainID) if err != nil { return err } @@ -168,7 +170,7 @@ $ %s pth s path-name`, appName, appName, appName)), return nil }, } - return yamlFlag(a.Viper, jsonFlag(a.Viper, cmd)) + return yamlFlag(a.viper, jsonFlag(a.viper, cmd)) } func pathsAddCmd(a *appState) *cobra.Command { @@ -183,30 +185,32 @@ $ %s paths add ibc-0 ibc-1 demo-path --file paths/demo.json $ %s pth a ibc-0 ibc-1 demo-path`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { src, dst := args[0], args[1] - _, err := a.Config.Chains.Gets(src, dst) - if err != nil { - return fmt.Errorf("chains need to be configured before paths to them can be added: %w", err) - } - - file, err := cmd.Flags().GetString(flagFile) - if err != nil { - return err - } - if file != "" { - if err := a.AddPathFromFile(cmd.Context(), cmd.ErrOrStderr(), file, args[2]); err != nil { - return err + return a.performConfigLockingOperation(cmd.Context(), func() error { + _, err := a.config.Chains.Gets(src, dst) + if err != nil { + return fmt.Errorf("chains need to be configured before paths to them can be added: %w", err) } - } else { - if err := a.AddPathFromUserInput(cmd.Context(), cmd.InOrStdin(), cmd.ErrOrStderr(), src, dst, args[2]); err != nil { + + file, err := cmd.Flags().GetString(flagFile) + if err != nil { return err } - } - return a.OverwriteConfig(a.Config) + if file != "" { + if err := a.addPathFromFile(cmd.Context(), cmd.ErrOrStderr(), file, args[2]); err != nil { + return err + } + } else { + if err := a.addPathFromUserInput(cmd.Context(), cmd.InOrStdin(), cmd.ErrOrStderr(), src, dst, args[2]); err != nil { + return err + } + } + return nil + }) }, } - return fileFlag(a.Viper, cmd) + return fileFlag(a.viper, cmd) } func pathsAddDirCmd(a *appState) *cobra.Command { @@ -220,10 +224,7 @@ func pathsAddDirCmd(a *appState) *cobra.Command { Example: strings.TrimSpace(fmt.Sprintf(` $ %s config add-paths examples/demo/configs/paths`, appName)), RunE: func(cmd *cobra.Command, args []string) (err error) { - if err := addPathsFromDirectory(cmd.Context(), cmd.ErrOrStderr(), a, args[0]); err != nil { - return err - } - return a.OverwriteConfig(a.Config) + return addPathsFromDirectory(cmd.Context(), cmd.ErrOrStderr(), a, args[0]) }, } @@ -241,25 +242,27 @@ $ %s paths new ibc-0 ibc-1 demo-path $ %s pth n ibc-0 ibc-1 demo-path`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { src, dst := args[0], args[1] - _, err := a.Config.Chains.Gets(src, dst) - if err != nil { - return fmt.Errorf("chains need to be configured before paths to them can be added: %w", err) - } - p := &relayer.Path{ - Src: &relayer.PathEnd{ChainID: src}, - Dst: &relayer.PathEnd{ChainID: dst}, - } + return a.performConfigLockingOperation(cmd.Context(), func() error { + _, err := a.config.Chains.Gets(src, dst) + if err != nil { + return fmt.Errorf("chains need to be configured before paths to them can be added: %w", err) + } - name := args[2] - if err = a.Config.Paths.Add(name, p); err != nil { - return err - } + p := &relayer.Path{ + Src: &relayer.PathEnd{ChainID: src}, + Dst: &relayer.PathEnd{ChainID: dst}, + } - return a.OverwriteConfig(a.Config) + name := args[2] + if err = a.config.AddPath(name, p); err != nil { + return err + } + return nil + }) }, } - return channelParameterFlags(a.Viper, cmd) + return channelParameterFlags(a.viper, cmd) } func pathsUpdateCmd(a *appState) *cobra.Command { @@ -280,77 +283,79 @@ $ %s paths update demo-path --src-connection-id connection-02 --dst-connection-i flags := cmd.Flags() - p := a.Config.Paths.MustGet(name) + return a.performConfigLockingOperation(cmd.Context(), func() error { + p := a.config.Paths.MustGet(name) - actionTaken := false + actionTaken := false - filterRule, _ := flags.GetString(flagFilterRule) - if filterRule != blankValue { - if filterRule != "" && filterRule != processor.RuleAllowList && filterRule != processor.RuleDenyList { - return fmt.Errorf( - `invalid filter rule : "%s". valid rules: ("", "%s", "%s")`, - filterRule, processor.RuleAllowList, processor.RuleDenyList) + filterRule, _ := flags.GetString(flagFilterRule) + if filterRule != blankValue { + if filterRule != "" && filterRule != processor.RuleAllowList && filterRule != processor.RuleDenyList { + return fmt.Errorf( + `invalid filter rule : "%s". valid rules: ("", "%s", "%s")`, + filterRule, processor.RuleAllowList, processor.RuleDenyList) + } + p.Filter.Rule = filterRule + actionTaken = true } - p.Filter.Rule = filterRule - actionTaken = true - } - filterChannels, _ := flags.GetString(flagFilterChannels) - if filterChannels != blankValue { - var channelList []string + filterChannels, _ := flags.GetString(flagFilterChannels) + if filterChannels != blankValue { + var channelList []string - if filterChannels != "" { - channelList = strings.Split(filterChannels, ",") - } + if filterChannels != "" { + channelList = strings.Split(filterChannels, ",") + } - p.Filter.ChannelList = channelList - actionTaken = true - } + p.Filter.ChannelList = channelList + actionTaken = true + } - srcChainID, _ := flags.GetString(flagSrcChainID) - if srcChainID != "" { - p.Src.ChainID = srcChainID - actionTaken = true - } + srcChainID, _ := flags.GetString(flagSrcChainID) + if srcChainID != "" { + p.Src.ChainID = srcChainID + actionTaken = true + } - dstChainID, _ := flags.GetString(flagDstChainID) - if dstChainID != "" { - p.Dst.ChainID = dstChainID - actionTaken = true - } + dstChainID, _ := flags.GetString(flagDstChainID) + if dstChainID != "" { + p.Dst.ChainID = dstChainID + actionTaken = true + } - srcClientID, _ := flags.GetString(flagSrcClientID) - if srcClientID != "" { - p.Src.ClientID = srcClientID - actionTaken = true - } + srcClientID, _ := flags.GetString(flagSrcClientID) + if srcClientID != "" { + p.Src.ClientID = srcClientID + actionTaken = true + } - dstClientID, _ := flags.GetString(flagDstClientID) - if dstClientID != "" { - p.Dst.ClientID = dstClientID - actionTaken = true - } + dstClientID, _ := flags.GetString(flagDstClientID) + if dstClientID != "" { + p.Dst.ClientID = dstClientID + actionTaken = true + } - srcConnID, _ := flags.GetString(flagSrcConnID) - if srcConnID != "" { - p.Src.ConnectionID = srcConnID - actionTaken = true - } + srcConnID, _ := flags.GetString(flagSrcConnID) + if srcConnID != "" { + p.Src.ConnectionID = srcConnID + actionTaken = true + } - dstConnID, _ := flags.GetString(flagDstConnID) - if dstConnID != "" { - p.Dst.ConnectionID = dstConnID - actionTaken = true - } + dstConnID, _ := flags.GetString(flagDstConnID) + if dstConnID != "" { + p.Dst.ConnectionID = dstConnID + actionTaken = true + } - if !actionTaken { - return fmt.Errorf("at least one flag must be provided") - } + if !actionTaken { + return fmt.Errorf("at least one flag must be provided") + } - return a.OverwriteConfig(a.Config) + return nil + }) }, } - cmd = pathFilterFlags(a.Viper, cmd) + cmd = pathFilterFlags(a.viper, cmd) return cmd } @@ -367,91 +372,88 @@ $ %s pth fch`, appName, defaultHome, appName)), RunE: func(cmd *cobra.Command, args []string) error { overwrite, _ := cmd.Flags().GetBool(flagOverwriteConfig) - chains := []string{} - for chainName := range a.Config.Chains { - chains = append(chains, chainName) - } + return a.performConfigLockingOperation(cmd.Context(), func() error { + chains := []string{} + for chainName := range a.config.Chains { + chains = append(chains, chainName) + } - // find all combinations of paths for configured chains - chainCombinations := make(map[string]bool) - for _, chainA := range chains { - for _, chainB := range chains { - if chainA == chainB { - continue + // find all combinations of paths for configured chains + chainCombinations := make(map[string]bool) + for _, chainA := range chains { + for _, chainB := range chains { + if chainA == chainB { + continue + } + + pair := chainA + "-" + chainB + if chainB < chainA { + pair = chainB + "-" + chainA + } + chainCombinations[pair] = true } + } - pair := chainA + "-" + chainB - if chainB < chainA { - pair = chainB + "-" + chainA + client := github.NewClient(nil) + for pthName := range chainCombinations { + _, exist := a.config.Paths[pthName] + if exist && !overwrite { + fmt.Fprintf(cmd.ErrOrStderr(), "skipping: %s already exists in config, use -o to overwrite (clears filters)\n", pthName) + continue } - chainCombinations[pair] = true - } - } - client := github.NewClient(nil) - for pthName := range chainCombinations { - _, exist := a.Config.Paths[pthName] - if exist && !overwrite { - fmt.Fprintf(cmd.ErrOrStderr(), "skipping: %s already exists in config, use -o to overwrite (clears filters)\n", pthName) - continue - } + // TODO: Don't use github api. Potentially use: https://github.com/eco-stake/cosmos-directory once they integrate IBC data into restAPI. This will avoid rate limits. + fileName := pthName + ".json" + regPath := path.Join("_IBC", fileName) + client, _, err := client.Repositories.DownloadContents(cmd.Context(), "cosmos", "chain-registry", regPath, nil) + if err != nil { + if errors.As(err, new(*github.RateLimitError)) { + fmt.Println("some paths failed: ", err) + break + } + fmt.Fprintf(cmd.ErrOrStderr(), "failure retrieving: %s: consider adding to cosmos/chain-registry: ERR: %v\n", pthName, err) + continue + } + defer client.Close() - // TODO: Don't use github api. Potentially use: https://github.com/eco-stake/cosmos-directory once they integrate IBC data into restAPI. This will avoid rate limits. - fileName := pthName + ".json" - regPath := path.Join("_IBC", fileName) - client, _, err := client.Repositories.DownloadContents(cmd.Context(), "cosmos", "chain-registry", regPath, nil) - if err != nil { - if errors.As(err, new(*github.RateLimitError)) { - fmt.Println("some paths failed: ", err) - break + b, err := io.ReadAll(client) + if err != nil { + return fmt.Errorf("error reading response body: %w", err) } - fmt.Fprintf(cmd.ErrOrStderr(), "failure retrieving: %s: consider adding to cosmos/chain-registry: ERR: %v\n", pthName, err) - continue - } - defer client.Close() - b, err := io.ReadAll(client) - if err != nil { - return fmt.Errorf("error reading response body: %w", err) - } + ibc := &relayer.IBCdata{} + if err = json.Unmarshal(b, &ibc); err != nil { + return fmt.Errorf("failed to unmarshal: %w ", err) + } - ibc := &relayer.IBCdata{} - if err = json.Unmarshal(b, &ibc); err != nil { - return fmt.Errorf("failed to unmarshal: %w ", err) - } + srcChainName := ibc.Chain1.ChainName + dstChainName := ibc.Chain2.ChainName - srcChainName := ibc.Chain1.ChainName - dstChainName := ibc.Chain2.ChainName + srcPathEnd := &relayer.PathEnd{ + ChainID: a.config.Chains[srcChainName].ChainID(), + ClientID: ibc.Chain1.ClientID, + ConnectionID: ibc.Chain1.ConnectionID, + } + dstPathEnd := &relayer.PathEnd{ + ChainID: a.config.Chains[dstChainName].ChainID(), + ClientID: ibc.Chain2.ClientID, + ConnectionID: ibc.Chain2.ConnectionID, + } + newPath := &relayer.Path{ + Src: srcPathEnd, + Dst: dstPathEnd, + } + client.Close() - srcPathEnd := &relayer.PathEnd{ - ChainID: a.Config.Chains[srcChainName].ChainID(), - ClientID: ibc.Chain1.ClientID, - ConnectionID: ibc.Chain1.ConnectionID, - } - dstPathEnd := &relayer.PathEnd{ - ChainID: a.Config.Chains[dstChainName].ChainID(), - ClientID: ibc.Chain2.ClientID, - ConnectionID: ibc.Chain2.ConnectionID, - } - newPath := &relayer.Path{ - Src: srcPathEnd, - Dst: dstPathEnd, - } - client.Close() + if err = a.config.AddPath(pthName, newPath); err != nil { + return fmt.Errorf("failed to add path %s: %w", pthName, err) + } + fmt.Fprintf(cmd.ErrOrStderr(), "added: %s\n", pthName) - if err = a.Config.AddPath(pthName, newPath); err != nil { - return fmt.Errorf("failed to add path %s: %w", pthName, err) } - fmt.Fprintf(cmd.ErrOrStderr(), "added: %s\n", pthName) - - } - - if err := a.OverwriteConfig(a.Config); err != nil { - return err - } - return nil - + return nil + }) }, } - return OverwriteConfigFlag(a.Viper, cmd) + return OverwriteConfigFlag(a.viper, cmd) } diff --git a/cmd/query.go b/cmd/query.go index 9e74aa395..5540fb916 100644 --- a/cmd/query.go +++ b/cmd/query.go @@ -63,7 +63,7 @@ $ %s q ibc-denoms ibc-0`, appName, appName, )), RunE: func(cmd *cobra.Command, args []string) error { - chain, ok := a.Config.Chains[args[0]] + chain, ok := a.config.Chains[args[0]] if !ok { return errChainNotFound(args[0]) } @@ -99,7 +99,7 @@ $ %s q denom-trace osmosis 9BBA9A1C257E971E38C1422780CE6F0B0686F0A3085E2D61118D9 appName, appName, )), RunE: func(cmd *cobra.Command, args []string) error { - c, ok := a.Config.Chains[args[0]] + c, ok := a.config.Chains[args[0]] if !ok { return errChainNotFound(args[0]) } @@ -127,7 +127,7 @@ $ %s q tx ibc-0 A5DF8D272F1C451CFF92BA6C41942C4D29B5CF180279439ED6AB038282F956BE appName, appName, )), RunE: func(cmd *cobra.Command, args []string) error { - chain, ok := a.Config.Chains[args[0]] + chain, ok := a.config.Chains[args[0]] if !ok { return errChainNotFound(args[0]) } @@ -168,7 +168,7 @@ $ %s q txs ibc-0 "message.action=transfer"`, appName, appName, )), RunE: func(cmd *cobra.Command, args []string) error { - chain, ok := a.Config.Chains[args[0]] + chain, ok := a.config.Chains[args[0]] if !ok { return errChainNotFound(args[0]) } @@ -198,7 +198,7 @@ $ %s q txs ibc-0 "message.action=transfer"`, }, } - return paginationFlags(a.Viper, cmd, "txs") + return paginationFlags(a.viper, cmd, "txs") } func queryBalanceCmd(a *appState) *cobra.Command { @@ -213,7 +213,7 @@ $ %s query balance ibc-0 testkey`, appName, appName, )), RunE: func(cmd *cobra.Command, args []string) error { - chain, ok := a.Config.Chains[args[0]] + chain, ok := a.config.Chains[args[0]] if !ok { return errChainNotFound(args[0]) } @@ -247,7 +247,7 @@ $ %s query balance ibc-0 testkey`, }, } - return ibcDenomFlags(a.Viper, cmd) + return ibcDenomFlags(a.viper, cmd) } func queryHeaderCmd(a *appState) *cobra.Command { @@ -261,7 +261,7 @@ $ %s query header ibc-0 1400`, appName, appName, )), RunE: func(cmd *cobra.Command, args []string) error { - chain, ok := a.Config.Chains[args[0]] + chain, ok := a.config.Chains[args[0]] if !ok { return errChainNotFound(args[0]) } @@ -315,7 +315,7 @@ $ %s q node-state ibc-1`, appName, appName, )), RunE: func(cmd *cobra.Command, args []string) error { - chain, ok := a.Config.Chains[args[0]] + chain, ok := a.config.Chains[args[0]] if !ok { return errChainNotFound(args[0]) } @@ -355,7 +355,7 @@ $ %s query client ibc-0 ibczeroclient --height 1205`, appName, appName, )), RunE: func(cmd *cobra.Command, args []string) error { - chain, ok := a.Config.Chains[args[0]] + chain, ok := a.config.Chains[args[0]] if !ok { return errChainNotFound(args[0]) } @@ -392,7 +392,7 @@ $ %s query client ibc-0 ibczeroclient --height 1205`, }, } - return heightFlag(a.Viper, cmd) + return heightFlag(a.viper, cmd) } func queryClientsCmd(a *appState) *cobra.Command { @@ -407,7 +407,7 @@ $ %s query clients ibc-2 --offset 2 --limit 30`, appName, appName, )), RunE: func(cmd *cobra.Command, args []string) error { - chain, ok := a.Config.Chains[args[0]] + chain, ok := a.config.Chains[args[0]] if !ok { return errChainNotFound(args[0]) } @@ -437,7 +437,7 @@ $ %s query clients ibc-2 --offset 2 --limit 30`, }, } - return paginationFlags(a.Viper, cmd, "client states") + return paginationFlags(a.viper, cmd, "client states") } func queryConnections(a *appState) *cobra.Command { @@ -453,7 +453,7 @@ $ %s q conns ibc-1`, appName, appName, appName, )), RunE: func(cmd *cobra.Command, args []string) error { - chain, ok := a.Config.Chains[args[0]] + chain, ok := a.config.Chains[args[0]] if !ok { return errChainNotFound(args[0]) } @@ -483,7 +483,7 @@ $ %s q conns ibc-1`, }, } - return paginationFlags(a.Viper, cmd, "connections on a network") + return paginationFlags(a.viper, cmd, "connections on a network") } func queryConnectionsUsingClient(a *appState) *cobra.Command { @@ -499,7 +499,7 @@ $ %s query client-connections ibc-0 ibczeroclient --height 1205`, RunE: func(cmd *cobra.Command, args []string) error { //TODO - Add pagination - chain, ok := a.Config.Chains[args[0]] + chain, ok := a.config.Chains[args[0]] if !ok { return errChainNotFound(args[0]) } @@ -536,7 +536,7 @@ $ %s query client-connections ibc-0 ibczeroclient --height 1205`, }, } - return heightFlag(a.Viper, cmd) + return heightFlag(a.viper, cmd) } func queryConnection(a *appState) *cobra.Command { @@ -551,7 +551,7 @@ $ %s q conn ibc-1 ibconeconn`, appName, appName, )), RunE: func(cmd *cobra.Command, args []string) error { - chain, ok := a.Config.Chains[args[0]] + chain, ok := a.config.Chains[args[0]] if !ok { return errChainNotFound(args[0]) } @@ -595,7 +595,7 @@ $ %s query connection-channels ibc-2 ibcconnection2 --offset 2 --limit 30`, appName, appName, )), RunE: func(cmd *cobra.Command, args []string) error { - chain, ok := a.Config.Chains[args[0]] + chain, ok := a.config.Chains[args[0]] if !ok { return errChainNotFound(args[0]) } @@ -629,7 +629,7 @@ $ %s query connection-channels ibc-2 ibcconnection2 --offset 2 --limit 30`, }, } - return paginationFlags(a.Viper, cmd, "channels associated with a connection") + return paginationFlags(a.viper, cmd, "channels associated with a connection") } func queryChannel(a *appState) *cobra.Command { @@ -643,7 +643,7 @@ $ %s query channel ibc-2 ibctwochannel transfer --height 1205`, appName, appName, )), RunE: func(cmd *cobra.Command, args []string) error { - chain, ok := a.Config.Chains[args[0]] + chain, ok := a.config.Chains[args[0]] if !ok { return errChainNotFound(args[0]) } @@ -682,7 +682,7 @@ $ %s query channel ibc-2 ibctwochannel transfer --height 1205`, }, } - return heightFlag(a.Viper, cmd) + return heightFlag(a.viper, cmd) } // chanExtendedInfo is an intermediate type for holding additional useful @@ -880,13 +880,13 @@ $ %s query channels ibc-0 ibc-2`, appName, appName, appName, )), RunE: func(cmd *cobra.Command, args []string) error { - chain, ok := a.Config.Chains[args[0]] + chain, ok := a.config.Chains[args[0]] if !ok { return errChainNotFound(args[0]) } if len(args) > 1 { - dstChain, ok := a.Config.Chains[args[1]] + dstChain, ok := a.config.Chains[args[1]] if !ok { return errChainNotFound(args[1]) } @@ -902,7 +902,7 @@ $ %s query channels ibc-0 ibc-2`, }, } - return paginationFlags(a.Viper, cmd, "channels on a network") + return paginationFlags(a.viper, cmd, "channels on a network") } func queryPacketCommitment(a *appState) *cobra.Command { @@ -916,7 +916,7 @@ $ %s q packet-commit ibc-1 ibconechannel transfer 31`, appName, appName, )), RunE: func(cmd *cobra.Command, args []string) error { - chain, ok := a.Config.Chains[args[0]] + chain, ok := a.config.Chains[args[0]] if !ok { return errChainNotFound(args[0]) } @@ -961,14 +961,14 @@ $ %s query unrelayed-pkts demo-path channel-0`, appName, appName, appName, )), RunE: func(cmd *cobra.Command, args []string) error { - path, err := a.Config.Paths.Get(args[0]) + path, err := a.config.Paths.Get(args[0]) if err != nil { return err } src, dst := path.Src.ChainID, path.Dst.ChainID - c, err := a.Config.Chains.Gets(src, dst) + c, err := a.config.Chains.Gets(src, dst) if err != nil { return err } @@ -1014,13 +1014,13 @@ $ %s query unrelayed-acks demo-path channel-0`, appName, appName, appName, )), RunE: func(cmd *cobra.Command, args []string) error { - path, err := a.Config.Paths.Get(args[0]) + path, err := a.config.Paths.Get(args[0]) if err != nil { return err } src, dst := path.Src.ChainID, path.Dst.ChainID - c, err := a.Config.Chains.Gets(src, dst) + c, err := a.config.Chains.Gets(src, dst) if err != nil { return err } @@ -1063,12 +1063,12 @@ $ %s query clients-expiration demo-path`, appName, )), RunE: func(cmd *cobra.Command, args []string) error { - path, err := a.Config.Paths.Get(args[0]) + path, err := a.config.Paths.Get(args[0]) if err != nil { return err } src, dst := path.Src.ChainID, path.Dst.ChainID - c, err := a.Config.Chains.Gets(src, dst) + c, err := a.config.Chains.Gets(src, dst) if err != nil { return err } diff --git a/cmd/root.go b/cmd/root.go index 8aaa5d919..f32feb7a7 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -34,13 +34,9 @@ import ( "github.com/spf13/viper" "go.uber.org/zap" "go.uber.org/zap/zapcore" - "golang.org/x/term" ) -const ( - MB = 1024 * 1024 // in bytes - appName = "rly" -) +const appName = "rly" var defaultHome = filepath.Join(os.Getenv("HOME"), ".relayer") @@ -57,9 +53,9 @@ func NewRootCmd(log *zap.Logger) *cobra.Command { // Use a local app state instance scoped to the new root command, // so that tests don't concurrently access the state. a := &appState{ - Viper: viper.New(), + viper: viper.New(), - Log: log, + log: log, } // RootCmd represents the base command when called without any subcommands @@ -78,37 +74,37 @@ func NewRootCmd(log *zap.Logger) *cobra.Command { rootCmd.PersistentPreRunE = func(cmd *cobra.Command, _ []string) error { // Inside persistent pre-run because this takes effect after flags are parsed. if log == nil { - log, err := newRootLogger(a.Viper.GetString("log-format"), a.Viper.GetBool("debug")) + log, err := newRootLogger(a.viper.GetString("log-format"), a.viper.GetBool("debug")) if err != nil { return err } - a.Log = log + a.log = log } // reads `homeDir/config/config.yaml` into `a.Config` - return initConfig(rootCmd, a) + return a.loadConfigFile(rootCmd.Context()) } rootCmd.PersistentPostRun = func(cmd *cobra.Command, _ []string) { // Force syncing the logs before exit, if anything is buffered. - a.Log.Sync() + _ = a.log.Sync() } // Register --home flag - rootCmd.PersistentFlags().StringVar(&a.HomePath, flagHome, defaultHome, "set home directory") - if err := a.Viper.BindPFlag(flagHome, rootCmd.PersistentFlags().Lookup(flagHome)); err != nil { + rootCmd.PersistentFlags().StringVar(&a.homePath, flagHome, defaultHome, "set home directory") + if err := a.viper.BindPFlag(flagHome, rootCmd.PersistentFlags().Lookup(flagHome)); err != nil { panic(err) } // Register --debug flag - rootCmd.PersistentFlags().BoolVarP(&a.Debug, "debug", "d", false, "debug output") - if err := a.Viper.BindPFlag("debug", rootCmd.PersistentFlags().Lookup("debug")); err != nil { + rootCmd.PersistentFlags().BoolVarP(&a.debug, "debug", "d", false, "debug output") + if err := a.viper.BindPFlag("debug", rootCmd.PersistentFlags().Lookup("debug")); err != nil { panic(err) } rootCmd.PersistentFlags().String("log-format", "auto", "log output format (auto, logfmt, json, or console)") - if err := a.Viper.BindPFlag("log-format", rootCmd.PersistentFlags().Lookup("log-format")); err != nil { + if err := a.viper.BindPFlag("log-format", rootCmd.PersistentFlags().Lookup("log-format")); err != nil { panic(err) } @@ -124,6 +120,7 @@ func NewRootCmd(log *zap.Logger) *cobra.Command { startCmd(a), lineBreakCommand(), getVersionCmd(a), + addressCmd(a), ) return rootCmd @@ -185,18 +182,10 @@ func newRootLogger(format string, debug bool) (*zap.Logger, error) { switch format { case "json": enc = zapcore.NewJSONEncoder(config) - case "console": + case "auto", "console": enc = zapcore.NewConsoleEncoder(config) case "logfmt": enc = zaplogfmt.NewEncoder(config) - case "auto": - if term.IsTerminal(int(os.Stderr.Fd())) { - // When a user runs relayer in the foreground, use easier to read output. - enc = zapcore.NewConsoleEncoder(config) - } else { - // Otherwise, use consistent logfmt format for simplistic machine processing. - enc = zaplogfmt.NewEncoder(config) - } default: return nil, fmt.Errorf("unrecognized log format %q", format) } diff --git a/cmd/start.go b/cmd/start.go index bc8143865..c2cdf9406 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -21,7 +21,6 @@ import ( "errors" "fmt" "net" - "strconv" "strings" "github.com/cosmos/relayer/v2/internal/relaydebug" @@ -50,7 +49,7 @@ $ %s start demo-path2 --max-tx-size 10`, appName, appName, appName, appName)), if len(args) > 0 { for i, pathName := range args { - path := a.Config.Paths.MustGet(pathName) + path := a.config.Paths.MustGet(pathName) paths[i] = relayer.NamedPath{ Name: pathName, Path: path, @@ -61,7 +60,7 @@ $ %s start demo-path2 --max-tx-size 10`, appName, appName, appName, appName)), chains[path.Dst.ChainID] = nil } } else { - for n, path := range a.Config.Paths { + for n, path := range a.config.Paths { paths = append(paths, relayer.NamedPath{ Name: n, Path: path, @@ -79,7 +78,7 @@ $ %s start demo-path2 --max-tx-size 10`, appName, appName, appName, appName)), } // get chain configurations - chains, err := a.Config.Chains.Gets(chainIDs...) + chains, err := a.config.Chains.Gets(chainIDs...) if err != nil { return err } @@ -88,14 +87,14 @@ $ %s start demo-path2 --max-tx-size 10`, appName, appName, appName, appName)), return err } - maxTxSize, maxMsgLength, err := GetStartOptions(cmd) + maxMsgLength, err := cmd.Flags().GetUint64(flagMaxMsgLength) if err != nil { return err } var prometheusMetrics *processor.PrometheusMetrics - debugAddr := a.Config.Global.APIListenPort + debugAddr := a.config.Global.APIListenPort debugAddrFlag, err := cmd.Flags().GetString(flagDebugAddr) if err != nil { @@ -107,14 +106,14 @@ $ %s start demo-path2 --max-tx-size 10`, appName, appName, appName, appName)), } if debugAddr == "" { - a.Log.Info("Skipping debug server due to empty debug address flag") + a.log.Info("Skipping debug server due to empty debug address flag") } else { ln, err := net.Listen("tcp", debugAddr) if err != nil { - a.Log.Error("Failed to listen on debug address. If you have another relayer process open, use --" + flagDebugAddr + " to pick a different address.") + a.log.Error("Failed to listen on debug address. If you have another relayer process open, use --" + flagDebugAddr + " to pick a different address.") return fmt.Errorf("failed to listen on debug address %q: %w", debugAddr, err) } - log := a.Log.With(zap.String("sys", "debughttp")) + log := a.log.With(zap.String("sys", "debughttp")) log.Info("Debug server listening", zap.String("addr", debugAddr)) prometheusMetrics = processor.NewPrometheusMetrics() relaydebug.StartDebugServer(cmd.Context(), log, ln, prometheusMetrics.Registry) @@ -146,11 +145,11 @@ $ %s start demo-path2 --max-tx-size 10`, appName, appName, appName, appName)), rlyErrCh := relayer.StartRelayer( cmd.Context(), - a.Log, + a.log, chains, paths, - maxTxSize, maxMsgLength, - a.Config.memo(cmd), + maxMsgLength, + a.config.memo(cmd), clientUpdateThresholdTime, flushInterval, nil, @@ -164,7 +163,7 @@ $ %s start demo-path2 --max-tx-size 10`, appName, appName, appName, appName)), // so we don't want to separately monitor the ctx.Done channel, // because we would risk returning before the relayer cleans up. if err := <-rlyErrCh; err != nil && !errors.Is(err, context.Canceled) { - a.Log.Warn( + a.log.Warn( "Relayer start error", zap.Error(err), ) @@ -173,37 +172,12 @@ $ %s start demo-path2 --max-tx-size 10`, appName, appName, appName, appName)), return nil }, } - cmd = updateTimeFlags(a.Viper, cmd) - cmd = strategyFlag(a.Viper, cmd) - cmd = debugServerFlags(a.Viper, cmd) - cmd = processorFlag(a.Viper, cmd) - cmd = initBlockFlag(a.Viper, cmd) - cmd = flushIntervalFlag(a.Viper, cmd) - cmd = memoFlag(a.Viper, cmd) + cmd = updateTimeFlags(a.viper, cmd) + cmd = strategyFlag(a.viper, cmd) + cmd = debugServerFlags(a.viper, cmd) + cmd = processorFlag(a.viper, cmd) + cmd = initBlockFlag(a.viper, cmd) + cmd = flushIntervalFlag(a.viper, cmd) + cmd = memoFlag(a.viper, cmd) return cmd } - -// GetStartOptions sets strategy specific fields. -func GetStartOptions(cmd *cobra.Command) (uint64, uint64, error) { - maxTxSize, err := cmd.Flags().GetString(flagMaxTxSize) - if err != nil { - return 0, 0, err - } - - txSize, err := strconv.ParseUint(maxTxSize, 10, 64) - if err != nil { - return 0, 0, err - } - - maxMsgLength, err := cmd.Flags().GetString(flagMaxMsgLength) - if err != nil { - return txSize * MB, 0, err - } - - msgLen, err := strconv.ParseUint(maxMsgLength, 10, 64) - if err != nil { - return txSize * MB, 0, err - } - - return txSize * MB, msgLen, nil -} diff --git a/cmd/tx.go b/cmd/tx.go index d1dff4818..f57c4cb36 100644 --- a/cmd/tx.go +++ b/cmd/tx.go @@ -50,6 +50,7 @@ Most of these commands take a [path] argument. Make sure: createChannelCmd(a), closeChannelCmd(a), lineBreakCommand(), + registerCounterpartyCmd(a), ) return cmd @@ -91,7 +92,7 @@ func createClientsCmd(a *appState) *cobra.Command { path := args[0] - c, src, dst, err := a.Config.ChainsFromPath(path) + c, src, dst, err := a.config.ChainsFromPath(path) if err != nil { return err } @@ -104,13 +105,13 @@ func createClientsCmd(a *appState) *cobra.Command { return fmt.Errorf("key %s not found on dst chain %s", c[dst].ChainProvider.Key(), c[dst].ChainID()) } - clientSrc, clientDst, err := c[src].CreateClients(cmd.Context(), c[dst], allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour, override, customClientTrustingPeriod, a.Config.memo(cmd), iconStartHeight) + clientSrc, clientDst, err := c[src].CreateClients(cmd.Context(), c[dst], allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour, override, customClientTrustingPeriod, a.config.memo(cmd), iconStartHeight) if err != nil { return err } if clientSrc != "" || clientDst != "" { - if err := a.OverwriteConfigOnTheFly(cmd, path, clientSrc, clientDst, "", ""); err != nil { + if err := a.updatePathConfig(cmd.Context(), path, clientSrc, clientDst, "", ""); err != nil { return err } @@ -123,10 +124,10 @@ func createClientsCmd(a *appState) *cobra.Command { }, } - cmd = clientParameterFlags(a.Viper, cmd) - cmd = overrideFlag(a.Viper, cmd) - cmd = memoFlag(a.Viper, cmd) - cmd = iconStartHeightFlag(a.Viper, cmd) + cmd = clientParameterFlags(a.viper, cmd) + cmd = overrideFlag(a.viper, cmd) + cmd = memoFlag(a.viper, cmd) + cmd = iconStartHeightFlag(a.viper, cmd) return cmd } @@ -159,17 +160,17 @@ func createClientCmd(a *appState) *cobra.Command { return err } - src, ok := a.Config.Chains[args[0]] + src, ok := a.config.Chains[args[0]] if !ok { return errChainNotFound(args[0]) } - dst, ok := a.Config.Chains[args[1]] + dst, ok := a.config.Chains[args[1]] if !ok { return errChainNotFound(args[1]) } pathName := args[2] - path, err := a.Config.Paths.Get(pathName) + path, err := a.config.Paths.Get(pathName) if err != nil { return err } @@ -220,7 +221,7 @@ func createClientCmd(a *appState) *cobra.Command { } return nil }, retry.Context(cmd.Context()), relayer.RtyAtt, relayer.RtyDel, relayer.RtyErr, retry.OnRetry(func(n uint, err error) { - a.Log.Info( + a.log.Info( "Failed to get light signed header", zap.String("src_chain_id", src.ChainID()), zap.Int64("src_height", srch), @@ -235,7 +236,7 @@ func createClientCmd(a *appState) *cobra.Command { return err } - clientID, err := relayer.CreateClient(cmd.Context(), src, dst, srcUpdateHeader, dstUpdateHeader, allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour, override, customClientTrustingPeriod, a.Config.memo(cmd), iconStartHeight) + clientID, err := relayer.CreateClient(cmd.Context(), src, dst, srcUpdateHeader, dstUpdateHeader, allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour, override, customClientTrustingPeriod, a.config.memo(cmd), iconStartHeight) if err != nil { return err } @@ -246,7 +247,7 @@ func createClientCmd(a *appState) *cobra.Command { clientDst = clientID } if clientID != "" { - if err = a.OverwriteConfigOnTheFly(cmd, pathName, clientSrc, clientDst, "", ""); err != nil { + if err = a.updatePathConfig(cmd.Context(), pathName, clientSrc, clientDst, "", ""); err != nil { return err } } @@ -255,10 +256,10 @@ func createClientCmd(a *appState) *cobra.Command { }, } - cmd = clientParameterFlags(a.Viper, cmd) - cmd = overrideFlag(a.Viper, cmd) - cmd = memoFlag(a.Viper, cmd) - cmd = iconStartHeightFlag(a.Viper, cmd) + cmd = clientParameterFlags(a.viper, cmd) + cmd = overrideFlag(a.viper, cmd) + cmd = memoFlag(a.viper, cmd) + cmd = iconStartHeightFlag(a.viper, cmd) return cmd } @@ -272,7 +273,7 @@ corresponding update-client messages.`, Args: withUsage(cobra.ExactArgs(1)), Example: strings.TrimSpace(fmt.Sprintf(`$ %s transact update-clients demo-path`, appName)), RunE: func(cmd *cobra.Command, args []string) error { - c, src, dst, err := a.Config.ChainsFromPath(args[0]) + c, src, dst, err := a.config.ChainsFromPath(args[0]) if err != nil { return err } @@ -285,11 +286,11 @@ corresponding update-client messages.`, return fmt.Errorf("key %s not found on dst chain %s", c[dst].ChainProvider.Key(), c[dst].ChainID()) } - return relayer.UpdateClients(cmd.Context(), c[src], c[dst], a.Config.memo(cmd)) + return relayer.UpdateClients(cmd.Context(), c[src], c[dst], a.config.memo(cmd)) }, } - return memoFlag(a.Viper, cmd) + return memoFlag(a.viper, cmd) } func upgradeClientsCmd(a *appState) *cobra.Command { @@ -298,7 +299,7 @@ func upgradeClientsCmd(a *appState) *cobra.Command { Short: "upgrades IBC clients between two configured chains with a configured path and chain-id", Args: withUsage(cobra.ExactArgs(2)), RunE: func(cmd *cobra.Command, args []string) error { - c, src, dst, err := a.Config.ChainsFromPath(args[0]) + c, src, dst, err := a.config.ChainsFromPath(args[0]) if err != nil { return err } @@ -318,7 +319,7 @@ func upgradeClientsCmd(a *appState) *cobra.Command { targetChainID := args[1] - memo := a.Config.memo(cmd) + memo := a.config.memo(cmd) // send the upgrade message on the targetChainID if src == targetChainID { @@ -329,8 +330,8 @@ func upgradeClientsCmd(a *appState) *cobra.Command { }, } - cmd = heightFlag(a.Viper, cmd) - cmd = memoFlag(a.Viper, cmd) + cmd = heightFlag(a.viper, cmd) + cmd = memoFlag(a.viper, cmd) return cmd } @@ -366,7 +367,7 @@ $ %s tx conn demo-path --timeout 5s`, pathName := args[0] - c, src, dst, err := a.Config.ChainsFromPath(pathName) + c, src, dst, err := a.config.ChainsFromPath(pathName) if err != nil { return err } @@ -394,7 +395,7 @@ $ %s tx conn demo-path --timeout 5s`, return fmt.Errorf("key %s not found on dst chain %s", c[dst].ChainProvider.Key(), c[dst].ChainID()) } - memo := a.Config.memo(cmd) + memo := a.config.memo(cmd) initialBlockHistory, err := cmd.Flags().GetUint64(flagInitialBlockHistory) if err != nil { @@ -412,7 +413,7 @@ $ %s tx conn demo-path --timeout 5s`, return err } if clientSrc != "" || clientDst != "" { - if err := a.OverwriteConfigOnTheFly(cmd, pathName, clientSrc, clientDst, "", ""); err != nil { + if err := a.updatePathConfig(cmd.Context(), pathName, clientSrc, clientDst, "", ""); err != nil { return err } // if err := a.UpdateConfigsIfContainIcon(cmd, c[src], c[dst]); err != nil { @@ -425,7 +426,7 @@ $ %s tx conn demo-path --timeout 5s`, return err } if connectionSrc != "" || connectionDst != "" { - if err := a.OverwriteConfigOnTheFly(cmd, pathName, "", "", connectionSrc, connectionDst); err != nil { + if err := a.updatePathConfig(cmd.Context(), pathName, "", "", connectionSrc, connectionDst); err != nil { return err } @@ -439,13 +440,13 @@ $ %s tx conn demo-path --timeout 5s`, }, } - cmd = timeoutFlag(a.Viper, cmd) - cmd = retryFlag(a.Viper, cmd) - cmd = clientParameterFlags(a.Viper, cmd) - cmd = overrideFlag(a.Viper, cmd) - cmd = memoFlag(a.Viper, cmd) - cmd = initBlockFlag(a.Viper, cmd) - cmd = iconStartHeightFlag(a.Viper, cmd) + cmd = timeoutFlag(a.viper, cmd) + cmd = retryFlag(a.viper, cmd) + cmd = clientParameterFlags(a.viper, cmd) + cmd = overrideFlag(a.viper, cmd) + cmd = memoFlag(a.viper, cmd) + cmd = initBlockFlag(a.viper, cmd) + cmd = iconStartHeightFlag(a.viper, cmd) return cmd } @@ -467,7 +468,7 @@ $ %s tx chan demo-path --timeout 5s --max-retries 10`, pathName := args[0] - c, src, dst, err := a.Config.ChainsFromPath(pathName) + c, src, dst, err := a.config.ChainsFromPath(pathName) if err != nil { return err } @@ -516,20 +517,15 @@ $ %s tx chan demo-path --timeout 5s --max-retries 10`, } // create channel if it isn't already created - err = c[src].CreateOpenChannels(cmd.Context(), c[dst], retries, to, srcPort, dstPort, order, version, override, a.Config.memo(cmd), pathName) - if err != nil { - return err - } - - return nil + return c[src].CreateOpenChannels(cmd.Context(), c[dst], retries, to, srcPort, dstPort, order, version, override, a.config.memo(cmd), pathName) }, } - cmd = timeoutFlag(a.Viper, cmd) - cmd = retryFlag(a.Viper, cmd) - cmd = overrideFlag(a.Viper, cmd) - cmd = channelParameterFlags(a.Viper, cmd) - cmd = memoFlag(a.Viper, cmd) + cmd = timeoutFlag(a.viper, cmd) + cmd = retryFlag(a.viper, cmd) + cmd = overrideFlag(a.viper, cmd) + cmd = channelParameterFlags(a.viper, cmd) + cmd = memoFlag(a.viper, cmd) return cmd } @@ -548,7 +544,7 @@ $ %s tx channel-close demo-path channel-0 transfer -o 3s`, RunE: func(cmd *cobra.Command, args []string) error { pathName := args[0] - c, src, dst, err := a.Config.ChainsFromPath(pathName) + c, src, dst, err := a.config.ChainsFromPath(pathName) if err != nil { return err } @@ -584,13 +580,13 @@ $ %s tx channel-close demo-path channel-0 transfer -o 3s`, return err } - return c[src].CloseChannel(cmd.Context(), c[dst], retries, to, channelID, portID, a.Config.memo(cmd), pathName) + return c[src].CloseChannel(cmd.Context(), c[dst], retries, to, channelID, portID, a.config.memo(cmd), pathName) }, } - cmd = timeoutFlag(a.Viper, cmd) - cmd = retryFlag(a.Viper, cmd) - cmd = memoFlag(a.Viper, cmd) + cmd = timeoutFlag(a.viper, cmd) + cmd = retryFlag(a.viper, cmd) + cmd = memoFlag(a.viper, cmd) return cmd } @@ -627,13 +623,13 @@ $ %s tx connect demo-path --src-port mock --dst-port mock --order unordered --ve pathName := args[0] - pth, err := a.Config.Paths.Get(pathName) + pth, err := a.config.Paths.Get(pathName) if err != nil { return err } src, dst := pth.Src.ChainID, pth.Dst.ChainID - c, err := a.Config.Chains.Gets(src, dst) + c, err := a.config.Chains.Gets(src, dst) if err != nil { return err } @@ -684,7 +680,7 @@ $ %s tx connect demo-path --src-port mock --dst-port mock --order unordered --ve return fmt.Errorf("key %s not found on dst chain %s", c[dst].ChainProvider.Key(), c[dst].ChainID()) } - memo := a.Config.memo(cmd) + memo := a.config.memo(cmd) initialBlockHistory, err := cmd.Flags().GetUint64(flagInitialBlockHistory) if err != nil { @@ -702,7 +698,7 @@ $ %s tx connect demo-path --src-port mock --dst-port mock --order unordered --ve return fmt.Errorf("error creating clients: %w", err) } if clientSrc != "" || clientDst != "" { - if err := a.OverwriteConfigOnTheFly(cmd, pathName, clientSrc, clientDst, "", ""); err != nil { + if err := a.updatePathConfig(cmd.Context(), pathName, clientSrc, clientDst, "", ""); err != nil { return err } } @@ -713,7 +709,7 @@ $ %s tx connect demo-path --src-port mock --dst-port mock --order unordered --ve return fmt.Errorf("error creating connections: %w", err) } if connectionSrc != "" || connectionDst != "" { - if err := a.OverwriteConfigOnTheFly(cmd, pathName, "", "", connectionSrc, connectionDst); err != nil { + if err := a.updatePathConfig(cmd.Context(), pathName, "", "", connectionSrc, connectionDst); err != nil { return err } } @@ -722,14 +718,14 @@ $ %s tx connect demo-path --src-port mock --dst-port mock --order unordered --ve return c[src].CreateOpenChannels(cmd.Context(), c[dst], retries, to, srcPort, dstPort, order, version, override, memo, pathName) }, } - cmd = timeoutFlag(a.Viper, cmd) - cmd = retryFlag(a.Viper, cmd) - cmd = clientParameterFlags(a.Viper, cmd) - cmd = channelParameterFlags(a.Viper, cmd) - cmd = overrideFlag(a.Viper, cmd) - cmd = memoFlag(a.Viper, cmd) - cmd = initBlockFlag(a.Viper, cmd) - cmd = iconStartHeightFlag(a.Viper, cmd) + cmd = timeoutFlag(a.viper, cmd) + cmd = retryFlag(a.viper, cmd) + cmd = clientParameterFlags(a.viper, cmd) + cmd = channelParameterFlags(a.viper, cmd) + cmd = overrideFlag(a.viper, cmd) + cmd = memoFlag(a.viper, cmd) + cmd = initBlockFlag(a.viper, cmd) + cmd = iconStartHeightFlag(a.viper, cmd) return cmd } @@ -749,7 +745,7 @@ $ %s tx link-then-start demo-path --timeout 5s`, appName, appName)), lCmd := linkCmd(a) for err := lCmd.RunE(cmd, args); err != nil; err = lCmd.RunE(cmd, args) { - a.Log.Info("Error running link; retrying", zap.Error(err)) + a.log.Info("Error running link; retrying", zap.Error(err)) select { case <-time.After(time.Second): // Keep going. @@ -763,17 +759,17 @@ $ %s tx link-then-start demo-path --timeout 5s`, appName, appName)), }, } - cmd = timeoutFlag(a.Viper, cmd) - cmd = retryFlag(a.Viper, cmd) - cmd = strategyFlag(a.Viper, cmd) - cmd = clientParameterFlags(a.Viper, cmd) - cmd = channelParameterFlags(a.Viper, cmd) - cmd = overrideFlag(a.Viper, cmd) - cmd = memoFlag(a.Viper, cmd) - cmd = debugServerFlags(a.Viper, cmd) - cmd = initBlockFlag(a.Viper, cmd) - cmd = processorFlag(a.Viper, cmd) - cmd = updateTimeFlags(a.Viper, cmd) + cmd = timeoutFlag(a.viper, cmd) + cmd = retryFlag(a.viper, cmd) + cmd = strategyFlag(a.viper, cmd) + cmd = clientParameterFlags(a.viper, cmd) + cmd = channelParameterFlags(a.viper, cmd) + cmd = overrideFlag(a.viper, cmd) + cmd = memoFlag(a.viper, cmd) + cmd = debugServerFlags(a.viper, cmd) + cmd = initBlockFlag(a.viper, cmd) + cmd = processorFlag(a.viper, cmd) + cmd = updateTimeFlags(a.viper, cmd) return cmd } @@ -795,7 +791,7 @@ $ %s tx flush demo-path channel-0`, if len(args) > 0 { pathName := args[0] - path := a.Config.Paths.MustGet(pathName) + path := a.config.Paths.MustGet(pathName) paths = append(paths, relayer.NamedPath{ Name: pathName, Path: path, @@ -805,7 +801,7 @@ $ %s tx flush demo-path channel-0`, chains[path.Src.ChainID] = nil chains[path.Dst.ChainID] = nil } else { - for n, path := range a.Config.Paths { + for n, path := range a.config.Paths { paths = append(paths, relayer.NamedPath{ Name: n, Path: path, @@ -823,7 +819,7 @@ $ %s tx flush demo-path channel-0`, } // get chain configurations - chains, err := a.Config.Chains.Gets(chainIDs...) + chains, err := a.config.Chains.Gets(chainIDs...) if err != nil { return err } @@ -832,7 +828,7 @@ $ %s tx flush demo-path channel-0`, return err } - maxTxSize, maxMsgLength, err := GetStartOptions(cmd) + maxMsgLength, err := cmd.Flags().GetUint64(flagMaxMsgLength) if err != nil { return err } @@ -850,11 +846,11 @@ $ %s tx flush demo-path channel-0`, rlyErrCh := relayer.StartRelayer( ctx, - a.Log, + a.log, chains, paths, - maxTxSize, maxMsgLength, - a.Config.memo(cmd), + maxMsgLength, + a.config.memo(cmd), 0, 0, &processor.FlushLifecycle{}, @@ -868,7 +864,7 @@ $ %s tx flush demo-path channel-0`, // so we don't want to separately monitor the ctx.Done channel, // because we would risk returning before the relayer cleans up. if err := <-rlyErrCh; err != nil && !errors.Is(err, context.Canceled) { - a.Log.Warn( + a.log.Warn( "Relayer start error", zap.Error(err), ) @@ -878,8 +874,8 @@ $ %s tx flush demo-path channel-0`, }, } - cmd = strategyFlag(a.Viper, cmd) - cmd = memoFlag(a.Viper, cmd) + cmd = strategyFlag(a.viper, cmd) + cmd = memoFlag(a.viper, cmd) return cmd } @@ -895,13 +891,13 @@ $ %s tx relay-pkts demo-path channel-0`, appName, appName, )), RunE: func(cmd *cobra.Command, args []string) error { - a.Log.Warn("This command is deprecated. Please use 'tx flush' command instead") + a.log.Warn("This command is deprecated. Please use 'tx flush' command instead") return flushCmd(a).RunE(cmd, args) }, } - cmd = strategyFlag(a.Viper, cmd) - cmd = memoFlag(a.Viper, cmd) + cmd = strategyFlag(a.viper, cmd) + cmd = memoFlag(a.viper, cmd) return cmd } @@ -917,13 +913,13 @@ $ %s tx relay-acks demo-path channel-0 -l 3 -s 6`, appName, appName, )), RunE: func(cmd *cobra.Command, args []string) error { - a.Log.Warn("This command is deprecated. Please use 'tx flush' command instead") + a.log.Warn("This command is deprecated. Please use 'tx flush' command instead") return flushCmd(a).RunE(cmd, args) }, } - cmd = strategyFlag(a.Viper, cmd) - cmd = memoFlag(a.Viper, cmd) + cmd = strategyFlag(a.viper, cmd) + cmd = memoFlag(a.viper, cmd) return cmd } @@ -941,11 +937,11 @@ $ %s tx transfer ibc-0 ibc-1 100000stake raw:non-bech32-address channel-0 --path $ %s tx raw send ibc-0 ibc-1 100000stake cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk channel-0 --path demo -c 5 `, appName, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { - src, ok := a.Config.Chains[args[0]] + src, ok := a.config.Chains[args[0]] if !ok { return errChainNotFound(args[0]) } - dst, ok := a.Config.Chains[args[1]] + dst, ok := a.config.Chains[args[1]] if !ok { return errChainNotFound(args[1]) } @@ -1031,16 +1027,16 @@ $ %s tx raw send ibc-0 ibc-1 100000stake cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9 dstAddr = rawDstAddr } - return src.SendTransferMsg(cmd.Context(), a.Log, dst, amount, dstAddr, toHeightOffset, toTimeOffset, srcChannel) + return src.SendTransferMsg(cmd.Context(), a.log, dst, amount, dstAddr, toHeightOffset, toTimeOffset, srcChannel) }, } - return timeoutFlags(a.Viper, pathFlag(a.Viper, cmd)) + return timeoutFlags(a.viper, pathFlag(a.viper, cmd)) } func setPathsFromArgs(a *appState, src, dst *relayer.Chain, name string) (*relayer.Path, error) { // find any configured paths between the chains - paths, err := a.Config.Paths.PathsFromChains(src.ChainID(), dst.ChainID()) + paths, err := a.config.Paths.PathsFromChains(src.ChainID(), dst.ChainID()) if err != nil { return nil, err } @@ -1089,3 +1085,39 @@ func ensureKeysExist(chains map[string]*relayer.Chain) error { return nil } + +// MsgRegisterCounterpartyPayee registers the counterparty_payee +func registerCounterpartyCmd(a *appState) *cobra.Command { + cmd := &cobra.Command{ + Use: "register-counterparty chain_name channel_id port_id relay_addr counterparty_payee", + Aliases: []string{"reg-cpt"}, + Short: "register the counterparty relayer address for ics-29 fee middleware", + Args: withUsage(cobra.MatchAll(cobra.ExactArgs(5))), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s register-counterparty channel-1 transfer cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk juno1g0ny488ws4064mjjxk4keenwfjrthn503ngjxd +$ %s reg-cpt channel-1 cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk juno1g0ny488ws4064mjjxk4keenwfjrthn503ngjxd`, + appName, appName)), + RunE: func(cmd *cobra.Command, args []string) error { + + chain, ok := a.config.Chains[args[0]] + if !ok { + return errChainNotFound(args[0]) + } + + channelID := args[1] + portID := args[2] + + relayerAddr := args[3] + counterpartyPayee := args[4] + + msg, err := chain.ChainProvider.MsgRegisterCounterpartyPayee(portID, channelID, relayerAddr, counterpartyPayee) + if err != nil { + return err + } + res, success, err := chain.ChainProvider.SendMessage(cmd.Context(), msg, "") + fmt.Println(res, success, err) + return nil + }, + } + return cmd +} diff --git a/cmd/version.go b/cmd/version.go index 2079685de..7f18c6519 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -76,5 +76,5 @@ $ %s v`, }, } - return jsonFlag(a.Viper, versionCmd) + return jsonFlag(a.viper, versionCmd) } diff --git a/cregistry/chain_info.go b/cregistry/chain_info.go index 7cea1cb5a..6d2d8dea3 100644 --- a/cregistry/chain_info.go +++ b/cregistry/chain_info.go @@ -55,8 +55,9 @@ type ChainInfo struct { Genesis struct { GenesisURL string `json:"genesis_url"` } `json:"genesis"` - Slip44 int `json:"slip44"` - Codebase struct { + Slip44 *int `json:"slip44"` + SigningAlgorithm string `json:"signing-algorithm"` + Codebase struct { GitRepo string `json:"git_repo"` RecommendedVersion string `json:"recommended_version"` CompatibleVersions []string `json:"compatible_versions"` @@ -82,6 +83,8 @@ type ChainInfo struct { Provider string `json:"provider"` } `json:"rest"` } `json:"apis"` + ExtraCodecs []string `json:"extra_codecs"` + MaxGasAmount uint64 `json:"max_gas_amount"` } // NewChainInfo returns a ChainInfo that is uninitialized other than the provided zap.Logger. @@ -251,18 +254,21 @@ func (c ChainInfo) GetChainConfig(ctx context.Context) (*cosmos.CosmosProviderCo } return &cosmos.CosmosProviderConfig{ - Key: "default", - ChainID: c.ChainID, - RPCAddr: rpc, - AccountPrefix: c.Bech32Prefix, - KeyringBackend: "test", - GasAdjustment: 1.2, - GasPrices: gasPrices, - KeyDirectory: home, - Debug: debug, - Timeout: "20s", - OutputFormat: "json", - SignModeStr: "direct", - Slip44: c.Slip44, + Key: "default", + ChainID: c.ChainID, + RPCAddr: rpc, + AccountPrefix: c.Bech32Prefix, + KeyringBackend: "test", + GasAdjustment: 1.2, + GasPrices: gasPrices, + KeyDirectory: home, + Debug: debug, + Timeout: "20s", + OutputFormat: "json", + SignModeStr: "direct", + Slip44: c.Slip44, + SigningAlgorithm: c.SigningAlgorithm, + ExtraCodecs: c.ExtraCodecs, + MaxGasAmount: c.MaxGasAmount, }, nil } diff --git a/docs/advanced_usage.md b/docs/advanced_usage.md index a95d8d51e..715bc283d 100644 --- a/docs/advanced_usage.md +++ b/docs/advanced_usage.md @@ -38,16 +38,20 @@ By default, the Relayer will automatically update clients (`MsgUpdateClient`) if > This auto-update functionality is specifically useful on low trafficked paths where messages aren't regularly being relayed. -You can choose to update clients more regularly by using the `--time-threshold` flag when running the `rly start` command. +Alternitavely, you can choose to update clients more frequently by using the `--time-threshold` flag when running the `rly start` command. Example: -- You are relaying on a path that has a client trusting period of 9 minutes. +- Say... You are relaying on a path that has a client trusting period of 9 minutes. - If no messages are sent for 6 minutes and the client is 3 minutes (1/3) to expiration, the relayer will automatically update the client. - If you wish to update the client more frequently, say anytime two minutes have passed without a `MsgUpdateClient` being sent, use flag: `--time-threshold 2m` Selecting a time-threshold that is greater than 2/3 of the client trusting period will deem itself useless. +Use cases for configuring the `--time-threshold` flag: +- The underlying chain node that the relayer is using as an endpoint has restrictive pruning. Client updates are needed more frequently since states 2/3 trusting period ago would not be available due to pruning. +- Mitiage relayer operational errors allowing more frequent updates incase a relayer node goes down for > the client trusting period. + \* It is not mandatory for relayers to include the `MsgUpdateClient` when relaying packets, however most, if not all relayers currently do. --- diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index dbfac01dc..75f46195e 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -53,6 +53,17 @@ it will be helpful to provide the output from `http://localhost:7597/debug/pprof --- +**Error querying blockdata** + +The relayer looks back in time at historical transactions and needs to have an index of them. + +Specifically check `~/./config/config.toml` has the following fields set: +```toml +indexer = "kv" +index_all_tags = true +``` +--- + **Error building or broadcasting transaction** When preparing a transaction for relaying, the amount of gas that the transaction will consume is unknown. To compute how much gas the transaction will need, the transaction is prepared with 0 gas and delivered as a `/cosmos.tx.v1beta1.Service/Simulate` query to the RPC endpoint. Recently chains have been creating AnteHandlers in which 0 gas triggers an error case: diff --git a/go.mod b/go.mod index 6400167e7..13f8c691f 100644 --- a/go.mod +++ b/go.mod @@ -5,18 +5,19 @@ go 1.19 require ( cosmossdk.io/api v0.3.1 cosmossdk.io/errors v1.0.0-beta.7 - cosmossdk.io/math v1.0.0 - github.com/CosmWasm/wasmd v1.0.0 + cosmossdk.io/math v1.0.1 + github.com/CosmWasm/wasmd v0.0.0-00010101000000-000000000000 github.com/avast/retry-go/v4 v4.3.3 - github.com/btcsuite/btcd v0.22.1 - github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce + github.com/btcsuite/btcd v0.23.4 + github.com/btcsuite/btcd/btcutil v1.1.3 github.com/cometbft/cometbft v0.37.1 github.com/cosmos/cosmos-proto v1.0.0-beta.2 - github.com/cosmos/cosmos-sdk v0.47.1 + github.com/cosmos/cosmos-sdk v0.47.3 github.com/cosmos/go-bip39 v1.0.0 - github.com/cosmos/gogoproto v1.4.8 - github.com/cosmos/ibc-go/v7 v7.0.0 - github.com/ethereum/go-ethereum v1.11.4 + github.com/cosmos/gogoproto v1.4.10 + github.com/cosmos/ibc-go/v7 v7.1.0-rc0 + github.com/cosmos/ics23/go v0.10.0 + github.com/ethereum/go-ethereum v1.10.26 github.com/gofrs/flock v0.8.1 github.com/gogo/protobuf v1.3.3 github.com/google/go-cmp v0.5.9 @@ -38,9 +39,8 @@ require ( golang.org/x/crypto v0.8.0 golang.org/x/mod v0.10.0 golang.org/x/sync v0.1.0 - golang.org/x/term v0.7.0 golang.org/x/text v0.9.0 - google.golang.org/grpc v1.54.0 + google.golang.org/grpc v1.55.0 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 @@ -54,6 +54,7 @@ require ( cloud.google.com/go/storage v1.29.0 // indirect cosmossdk.io/core v0.5.1 // indirect cosmossdk.io/depinject v1.0.0-alpha.3 // indirect + cosmossdk.io/log v1.1.0 // indirect cosmossdk.io/tools/rosetta v0.2.1 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect @@ -80,8 +81,7 @@ require ( github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/iavl v0.20.0 // indirect - github.com/cosmos/ics23/go v0.9.1-0.20221207100636-b1abd8678aab // indirect - github.com/cosmos/ledger-cosmos-go v0.12.2 // indirect + github.com/cosmos/ledger-cosmos-go v0.12.1 // indirect github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect github.com/creachadair/taskgroup v0.4.2 // indirect github.com/danieljoos/wincred v1.1.2 // indirect @@ -97,7 +97,6 @@ require ( github.com/evalphobia/logrus_fluent v0.5.4 // indirect github.com/felixge/httpsnoop v1.0.2 // indirect github.com/fluent/fluent-logger-golang v1.4.0 // indirect - github.com/frankban/quicktest v1.14.4 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect @@ -126,7 +125,7 @@ require ( github.com/gtank/ristretto255 v0.1.2 // indirect github.com/haltingstate/secp256k1-go v0.0.0-20151224084235-572209b26df6 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter v1.7.0 // indirect + github.com/hashicorp/go-getter v1.7.1 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect @@ -157,16 +156,16 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/pelletier/go-toml/v2 v2.0.7 // indirect - github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d // indirect - github.com/philhofer/fwd v1.1.1 // indirect + github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect + github.com/philhofer/fwd v1.0.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/common v0.42.0 // indirect github.com/prometheus/procfs v0.9.0 // indirect github.com/rakyll/statik v0.1.7 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rivo/uniseg v0.4.4 // indirect github.com/rs/cors v1.8.3 // indirect + github.com/rs/zerolog v1.29.1 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/sirupsen/logrus v1.9.0 // indirect github.com/spf13/afero v1.9.3 // indirect @@ -178,8 +177,7 @@ require ( github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/tendermint/go-amino v0.16.0 // indirect github.com/tidwall/btree v1.6.0 // indirect - github.com/tinylib/msgp v1.1.5 // indirect - github.com/tklauser/numcpus v0.4.0 // indirect + github.com/tinylib/msgp v1.1.2 // indirect github.com/ulikunitz/xz v0.5.11 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.2.1 // indirect @@ -190,14 +188,15 @@ require ( go.etcd.io/bbolt v1.3.7 // indirect go.opencensus.io v0.24.0 // indirect go.uber.org/atomic v1.10.0 // indirect - golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect + golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc // indirect golang.org/x/net v0.9.0 // indirect - golang.org/x/oauth2 v0.5.0 // indirect + golang.org/x/oauth2 v0.6.0 // indirect golang.org/x/sys v0.7.0 // indirect + golang.org/x/term v0.7.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/api v0.110.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44 // indirect + google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect diff --git a/go.sum b/go.sum index 6c5a21350..8abce6682 100644 --- a/go.sum +++ b/go.sum @@ -122,7 +122,7 @@ cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= -cloud.google.com/go/longrunning v0.3.0 h1:NjljC+FYPV3uh5/OwWT6pVU+doBqMg2x/rZlE+CamDs= +cloud.google.com/go/longrunning v0.4.1 h1:v+yFJOfKC3yZdY6ZUI933pIYdhyhV8S3NpWrXWmg7jM= cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= @@ -203,8 +203,10 @@ cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -cosmossdk.io/math v1.0.0 h1:ro9w7eKx23om2tZz/VM2Pf+z2WAbGX1yDQQOJ6iGeJw= -cosmossdk.io/math v1.0.0/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= +cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= +cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= +cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= +cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -242,7 +244,6 @@ github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= -github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Kubuxu/go-os-helper v0.0.1/go.mod h1:N8B+I7vPCT80IcP58r50u4+gEEcsZETFUpAzWW2ep1Y= github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= @@ -338,19 +339,25 @@ github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c/go.mod h1:3J08xEfcug github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MRgMY/8NJ7K94= -github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= -github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= +github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M= +github.com/btcsuite/btcd v0.23.0/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= +github.com/btcsuite/btcd v0.23.4 h1:IzV6qqkfwbItOS/sg/aDfPDsjPP8twrCOE2R93hxMlQ= +github.com/btcsuite/btcd v0.23.4/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= +github.com/btcsuite/btcd/btcec/v2 v2.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA= +github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ= +github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A= +github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE= +github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= +github.com/btcsuite/btcd/btcutil v1.1.3/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= -github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce h1:YtWJF7RHm2pYCvA5t0RPmAaLUhREsKuKd+SLhxFbFeQ= -github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= @@ -358,6 +365,7 @@ github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= +github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= @@ -403,10 +411,6 @@ github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b80 github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= -github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 h1:ytcWPaNPhNoGMWEhDvS3zToKcDpRsLuRolQJBVGdozk= -github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/coinbase/rosetta-sdk-go v0.4.6/go.mod h1:Luv0AhzZH81eul2hYZ3w0hBGwmFPiexwbntYxihEZck= github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA= @@ -428,30 +432,31 @@ github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-proto v1.0.0-beta.2 h1:X3OKvWgK9Gsejo0F1qs5l8Qn6xJV/AzgIWR2wZ8Nua8= github.com/cosmos/cosmos-proto v1.0.0-beta.2/go.mod h1:+XRCLJ14pr5HFEHIUcn51IKXD1Fy3rkEQqt4WqmN4V0= -github.com/cosmos/cosmos-sdk v0.47.1 h1:HnaCYtaAMWZp1SdlwwE1mPJ8kFlZ/TuEJ/ciNXH6Uno= -github.com/cosmos/cosmos-sdk v0.47.1/go.mod h1:14tO5KQaTrl2q3OxBnDRfue7TRN9zkXS0cLutrSqkOo= +github.com/cosmos/cosmos-sdk v0.47.3 h1:r0hGmZoAzP2D+MaPaFGHwAaTdFQq3pNpHaUp1BsffbM= +github.com/cosmos/cosmos-sdk v0.47.3/go.mod h1:c4OfLdAykA9zsj1CqrxBRqXzVz48I++JSvIMPSPcEmk= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.8 h1:BrHKc6WFZt8+jRV71vKSQE+JrfF+JAnzrKo2VP7wIZ4= -github.com/cosmos/gogoproto v1.4.8/go.mod h1:hnb0DIEWTv+wdNzNcqus5xCQXq5+CXauq1FJuurRfVY= +github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= +github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= github.com/cosmos/iavl v0.20.0 h1:fTVznVlepH0KK8NyKq8w+U7c2L6jofa27aFX6YGlm38= github.com/cosmos/iavl v0.20.0/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= -github.com/cosmos/ibc-go/v7 v7.0.0 h1:j4kyywlG0hhDmT9FmSaR5iCIka7Pz7kJTxGWY1nlV9Q= -github.com/cosmos/ibc-go/v7 v7.0.0/go.mod h1:BFh8nKWjr5zeR2OZfhkzdgDzj1+KjRn3aJLpwapStj8= -github.com/cosmos/ics23/go v0.9.1-0.20221207100636-b1abd8678aab h1:I9ialKTQo7248V827Bba4OuKPmk+FPzmTVHsLXaIJWw= -github.com/cosmos/ics23/go v0.9.1-0.20221207100636-b1abd8678aab/go.mod h1:2CwqasX5dSD7Hbp/9b6lhK6BwoBDCBldx7gPKRukR60= -github.com/cosmos/ledger-cosmos-go v0.12.2 h1:/XYaBlE2BJxtvpkHiBm97gFGSGmYGKunKyF3nNqAXZA= -github.com/cosmos/ledger-cosmos-go v0.12.2/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= +github.com/cosmos/ibc-go/v7 v7.1.0-rc0 h1:b78+/74AJDp0Sc7utMO1l4nI/u4ERnyta1nqooqQrGI= +github.com/cosmos/ibc-go/v7 v7.1.0-rc0/go.mod h1:7MptlWeIyqmDiuJeRAFqBvXKY8Hybd+rF8vMSmGd2zg= +github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= +github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= +github.com/cosmos/ledger-cosmos-go v0.12.1 h1:sMBxza5p/rNK/06nBSNmsI/WDqI0pVJFVNihy1Y984w= +github.com/cosmos/ledger-cosmos-go v0.12.1/go.mod h1:dhO6kj+Y+AHIOgAe4L9HL/6NDdyyth4q238I9yFpD2g= github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= github.com/cosmwasm/wasmd v0.40.0-rc.1.0.20230424144037-55647a1fd1f9 h1:JCkKi1yHPIlBAKAeKQrBJIWmWAwScA1z9mLd3vVQGX0= @@ -482,6 +487,8 @@ github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea/go.mod h1:93vs github.com/deckarep/golang-set v1.7.1/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= +github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= @@ -548,8 +555,8 @@ github.com/ethereum/go-ethereum v1.4.0/go.mod h1:PwpWDrCLZrV+tfrhqqF6kPknbISMHaJ github.com/ethereum/go-ethereum v1.9.21/go.mod h1:RXAVzbGrSGmDkDnHymruTAIEjUR3E4TX0EOpaj702sI= github.com/ethereum/go-ethereum v1.9.23/go.mod h1:JIfVb6esrqALTExdz9hRYvrP0xBDf6wCncIu1hNwHpM= github.com/ethereum/go-ethereum v1.10.16/go.mod h1:Anj6cxczl+AHy63o4X9O8yWNHuN5wMpfb8MAnHkWn7Y= -github.com/ethereum/go-ethereum v1.11.4 h1:KG81SnUHXWk8LJB3mBcHg/E2yLvXoiPmRMCIRxgx3cE= -github.com/ethereum/go-ethereum v1.11.4/go.mod h1:it7x0DWnTDMfVFdXcU6Ti4KEFQynLHVRarcSlPr0HBo= +github.com/ethereum/go-ethereum v1.10.26 h1:i/7d9RBBwiXCEuyduBQzJw/mKmnvzsN14jqBmytw72s= +github.com/ethereum/go-ethereum v1.10.26/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= github.com/evalphobia/logrus_fluent v0.5.4 h1:G4BSBTm7+L+oanWfFtA/A5Y3pvL2OMxviczyZPYO5xc= github.com/evalphobia/logrus_fluent v0.5.4/go.mod h1:hasyj+CXm3BDP1YhFk/rnTcjlegyqvkokV9A25cQsaA= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= @@ -572,8 +579,7 @@ github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/ github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= -github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/fsnotify/fsnotify v1.4.3-0.20170329110642-4da3e2cfbabc/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -585,12 +591,11 @@ github.com/garyburd/redigo v1.1.1-0.20170914051019-70e1b1943d4f/go.mod h1:NR3MbY github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= -github.com/getsentry/sentry-go v0.18.0 h1:MtBW5H9QgdcJabtZcuJG80BMOwaBpkRDZkxRkNC1sN0= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= -github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= @@ -623,10 +628,10 @@ github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3yg github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= -github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= @@ -657,9 +662,9 @@ github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/flock v0.0.0-20190320160742-5135e617513b/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= @@ -883,8 +888,8 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-getter v1.7.0 h1:bzrYP+qu/gMrL1au7/aDvkoOVGUJpeKBgbqRHACAFDY= -github.com/hashicorp/go-getter v1.7.0/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-getter v1.7.1 h1:SWiSWN/42qdpR0MdhaOc/bLR48PLuP1ZQtYLRlM69uY= +github.com/hashicorp/go-getter v1.7.1/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -1012,7 +1017,7 @@ github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZl github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jhump/protoreflect v1.12.1-0.20220721211354-060cc04fc18b h1:izTof8BKh/nE1wrKOrloNA5q4odOarjf+Xpe+4qow98= +github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= @@ -1071,13 +1076,11 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= github.com/labstack/echo/v4 v4.6.1/go.mod h1:RnjgMWNDB9g/HucVWhQYNQP9PvbYf6adqftqryo7s9k= @@ -1088,8 +1091,8 @@ github.com/labstack/gommon v0.3.1 h1:OomWaJXm7xR6L1HmEtGyQf26TEn7V6X88mktX9kee9o github.com/labstack/gommon v0.3.1/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= -github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= @@ -1282,6 +1285,7 @@ github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= @@ -1483,14 +1487,12 @@ github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9 github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d h1:htwtWgtQo8YS6JFWWi2DNgY0RwSGJ1ruMoxY6CUUclk= -github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 h1:hDSdbBuw3Lefr6R18ax0tZ2BJeNB3NehB3trOwYBsdU= +github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= -github.com/philhofer/fwd v1.1.1 h1:GdGcTjf5RNAxwS4QLsiMzJYj5KEvPJD3Abr261yRQXQ= -github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -1545,6 +1547,7 @@ github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/prometheus/tsdb v0.7.1 h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= @@ -1558,8 +1561,7 @@ github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGn github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= -github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= -github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/rivo/uniseg v0.4.3 h1:utMvzDsuh3suAEnhH0RdHmoPbU648o6CvXxTx4SBMOw= github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/rjeczalik/notify v0.9.2/go.mod h1:aErll2f0sUX9PXZnVNyeiObbmTlk5jnMoCa4QEjJeqM= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= @@ -1569,14 +1571,16 @@ github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTE github.com/rogpeppe/go-internal v1.6.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.18.0/go.mod h1:9nvC1axdVrAHcu/s9taAVfBuIdTZLVQmKQyvrUjF5+I= +github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= +github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -1697,18 +1701,15 @@ github.com/tidwall/sjson v1.1.1/go.mod h1:yvVuSnpEQv5cYIrO+AT6kw4QVfd5SDZoGIS7/5 github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= +github.com/tinylib/msgp v1.1.2 h1:gWmO7n0Ys2RBEb7GPYB9Ujq8Mk5p2U08lRnmMcGy6BQ= github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= -github.com/tinylib/msgp v1.1.5 h1:2gXmtWueD2HefZHQe1QOy9HVzmFrLOVvsXwXBQ0ayy0= -github.com/tinylib/msgp v1.1.5/go.mod h1:eQsjooMTnV42mHu917E26IogZ2930nFyBQdofk10Udg= github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= +github.com/tklauser/numcpus v0.2.2 h1:oyhllyrScuYI6g+h/zUvNXNp1wy7x8qQy3t/piefldA= github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= -github.com/tklauser/numcpus v0.4.0 h1:E53Dm1HjH1/R2/aoCtXtPgzmElmn51aOkhCFSuZq//o= -github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tommy-muehle/go-mnd v1.1.1/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig= -github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+lC5RZ8IT9rBXDaEDnpnw/Cl+HFiw+v/7Q= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= @@ -1717,8 +1718,8 @@ github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGr github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= @@ -1859,8 +1860,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug= -golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc h1:mCRnTeVUjcrhlRmO0VK8a6k6Rrf6TF9htwo2pJVSjIU= +golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1992,8 +1993,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.5.0 h1:HuArIo48skDwlrvM3sEdHXElYslAMsf3KwRkkW4MC4s= -golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= +golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw= +golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= golang.org/x/sync v0.0.0-20170517211232-f52d1811a629/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -2236,7 +2237,6 @@ golang.org/x/tools v0.0.0-20200731060945-b5fad4ed8dd6/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -2441,8 +2441,8 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44 h1:EfLuoKW5WfkgVdDy7dTK8qSbH37AX5mj/MFh+bGPz14= -google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44/go.mod h1:8B0gmkoRebU8ukX6HP+4wrVQUY1+6PkQ44BSyIlflHA= +google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 h1:DdoeryqhaXp1LtT/emMP1BRJPHHKFi5akj/nbx/zNTA= +google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= google.golang.org/grpc v1.2.1-0.20170921194603-d4b75ebd4f9f/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -2486,8 +2486,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.54.0 h1:EhTqbhiYeixwWQtAEZAxmV9MGqcjEU2mFx52xCzNyag= -google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= +google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= +google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/interchaintest/fee_middleware_test.go b/interchaintest/fee_middleware_test.go new file mode 100644 index 000000000..71d65d616 --- /dev/null +++ b/interchaintest/fee_middleware_test.go @@ -0,0 +1,202 @@ +package interchaintest_test + +import ( + "context" + "fmt" + "testing" + + transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + relayertest "github.com/cosmos/relayer/v2/interchaintest" + interchaintest "github.com/strangelove-ventures/interchaintest/v7" + "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" + ibc "github.com/strangelove-ventures/interchaintest/v7/ibc" + "github.com/strangelove-ventures/interchaintest/v7/testreporter" + "github.com/strangelove-ventures/interchaintest/v7/testutil" + "github.com/stretchr/testify/require" + "go.uber.org/zap/zaptest" +) + +func TestScenarioFeeMiddleware(t *testing.T) { + if testing.Short() { + t.Skip() + } + + t.Parallel() + + nv := 1 + nf := 0 + + // Get both chains + cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ + {Name: "juno", ChainName: "chaina", Version: "v13.0.0", NumValidators: &nv, NumFullNodes: &nf, ChainConfig: ibc.ChainConfig{ChainID: "chaina", GasPrices: "0.0ujuno"}}, + {Name: "juno", ChainName: "chainb", Version: "v13.0.0", NumValidators: &nv, NumFullNodes: &nf, ChainConfig: ibc.ChainConfig{ChainID: "chainb", GasPrices: "0.0ujuno"}}}, + ) + + chains, err := cf.Chains(t.Name()) + require.NoError(t, err) + chainA, chainB := chains[0].(*cosmos.CosmosChain), chains[1].(*cosmos.CosmosChain) + + ctx := context.Background() + client, network := interchaintest.DockerSetup(t) + + rf := relayertest.NewRelayerFactory(relayertest.RelayerConfig{InitialBlockHistory: 50}) + r := rf.Build(t, client, network) + + const pathChainAChainB = "chainA-chainB" + + // Build the network + ic := interchaintest.NewInterchain(). + AddChain(chainA). + AddChain(chainB). + AddRelayer(r, "relayer"). + AddLink(interchaintest.InterchainLink{ + Chain1: chainA, + Chain2: chainB, + Relayer: r, + Path: pathChainAChainB, + CreateChannelOpts: ibc.CreateChannelOptions{ + SourcePortName: "transfer", + DestPortName: "transfer", + Order: ibc.Unordered, + Version: "{\"fee_version\":\"ics29-1\",\"app_version\":\"ics20-1\"}", + }, + CreateClientOpts: ibc.DefaultClientOpts(), + }) + + rep := testreporter.NewNopReporter() + eRep := rep.RelayerExecReporter(t) + + require.NoError(t, ic.Build(ctx, eRep, interchaintest.InterchainBuildOptions{ + TestName: t.Name(), + Client: client, + NetworkID: network, + SkipPathCreation: false, + })) + + t.Cleanup(func() { + _ = ic.Close() + }) + + err = testutil.WaitForBlocks(ctx, 10, chainA, chainB) + require.NoError(t, err) + + // ChainID of ChainA + chainIDA := chainA.Config().ChainID + + // Channel of ChainA + chA, err := r.GetChannels(ctx, eRep, chainIDA) + require.NoError(t, err) + channelA := chA[0] + + // Fund a user account on chain1 and chain2 + const userFunds = int64(1_000_000_000_000) + users := interchaintest.GetAndFundTestUsers(t, ctx, t.Name(), userFunds, chainA, chainB) + userA := users[0] + userAddressA := userA.FormattedAddress() + userB := users[1] + userAddressB := userB.FormattedAddress() + + // Addresses of both the chains + walletA, _ := r.GetWallet(chainA.Config().ChainID) + rlyAddressA := walletA.FormattedAddress() + + walletB, _ := r.GetWallet(chainB.Config().ChainID) + rlyAddressB := walletB.FormattedAddress() + + // register CounterpartyPayee + cmd := []string{ + "tx", "register-counterparty", + chainA.Config().Name, + channelA.ChannelID, + "transfer", + rlyAddressA, + rlyAddressB, + } + _ = r.Exec(ctx, eRep, cmd, nil) + require.NoError(t, err) + + // Query the relayer CounterpartyPayee on a given channel + query := []string{ + chainA.Config().Bin, "query", "ibc-fee", "counterparty-payee", channelA.ChannelID, rlyAddressA, + "--chain-id", chainIDA, + "--node", chainA.GetRPCAddress(), + "--home", chainA.HomeDir(), + "--trace", + } + _, _, err = chainA.Exec(ctx, query, nil) + require.NoError(t, err) + + // Get initial account balances + userAOrigBal, err := chainA.GetBalance(ctx, userAddressA, chainA.Config().Denom) + require.NoError(t, err) + require.Equal(t, userFunds, userAOrigBal) + + userBOrigBal, err := chainB.GetBalance(ctx, userAddressB, chainB.Config().Denom) + require.NoError(t, err) + require.Equal(t, userFunds, userBOrigBal) + + rlyAOrigBal, err := chainA.GetBalance(ctx, rlyAddressA, chainA.Config().Denom) + require.NoError(t, err) + require.Equal(t, userFunds, rlyAOrigBal) + + rlyBOrigBal, err := chainB.GetBalance(ctx, rlyAddressB, chainB.Config().Denom) + require.NoError(t, err) + require.Equal(t, userFunds, rlyBOrigBal) + + // send tx + const txAmount = 1000 + transfer := ibc.WalletAmount{Address: userAddressB, Denom: chainA.Config().Denom, Amount: txAmount} + _, err = chainA.SendIBCTransfer(ctx, channelA.ChannelID, userAddressA, transfer, ibc.TransferOptions{}) + require.NoError(t, err) + + // Incentivizing async packet by returning MsgPayPacketFeeAsync + packetFeeAsync := []string{ + chainA.Config().Bin, "tx", "ibc-fee", "pay-packet-fee", "transfer", channelA.ChannelID, "1", + "--recv-fee", fmt.Sprintf("1000%s", chainA.Config().Denom), + "--ack-fee", fmt.Sprintf("1000%s", chainA.Config().Denom), + "--timeout-fee", fmt.Sprintf("1000%s", chainA.Config().Denom), + "--chain-id", chainIDA, + "--node", chainA.GetRPCAddress(), + "--from", userA.FormattedAddress(), + "--keyring-backend", "test", + "--gas", "400000", + "--yes", + "--home", chainA.HomeDir(), + } + _, _, err = chainA.Exec(ctx, packetFeeAsync, nil) + require.NoError(t, err) + + // start the relayer + err = r.StartRelayer(ctx, eRep, pathChainAChainB) + require.NoError(t, err) + + t.Cleanup( + func() { + err := r.StopRelayer(ctx, eRep) + if err != nil { + t.Logf("an error occured while stopping the relayer: %s", err) + } + }, + ) + + // Wait for relayer to run + err = testutil.WaitForBlocks(ctx, 5, chainA, chainB) + require.NoError(t, err) + + // Assigning denom + chainATokenDenom := transfertypes.GetPrefixedDenom(channelA.PortID, channelA.ChannelID, chainA.Config().Denom) + chainADenomTrace := transfertypes.ParseDenomTrace(chainATokenDenom) + + // Get balances after the fees + chainABal, err := chainA.GetBalance(ctx, userAddressA, chainA.Config().Denom) + require.NoError(t, err) + require.Equal(t, userAOrigBal-(txAmount+1000), chainABal) + + chainBBal, err := chainB.GetBalance(ctx, userAddressB, chainADenomTrace.IBCDenom()) + require.NoError(t, err) + require.Equal(t, int64(txAmount), chainBBal) + + rlyABal, err := chainA.GetBalance(ctx, rlyAddressA, chainA.Config().Denom) + require.NoError(t, err) + require.Equal(t, rlyAOrigBal+1000, rlyABal) +} diff --git a/interchaintest/go.mod b/interchaintest/go.mod index f6962ecc5..45f2853c9 100644 --- a/interchaintest/go.mod +++ b/interchaintest/go.mod @@ -1,17 +1,17 @@ module github.com/cosmos/relayer/v2/interchaintest -go 1.19 +go 1.20 require ( cosmossdk.io/simapp v0.0.0-20230224204036-a6adb0821462 github.com/cometbft/cometbft v0.37.0 - github.com/cosmos/cosmos-sdk v0.47.0-rc3 - github.com/cosmos/ibc-go/v7 v7.0.0-rc1 + github.com/cosmos/cosmos-sdk v0.47.1 + github.com/cosmos/ibc-go/v7 v7.0.0 github.com/cosmos/relayer/v2 v2.0.0 - github.com/docker/docker v20.10.19+incompatible + github.com/docker/docker v20.10.24+incompatible github.com/icza/dyno v0.0.0-20220812133438-f0b6f8a18845 github.com/moby/moby v20.10.22+incompatible - github.com/strangelove-ventures/interchaintest/v7 v7.0.0-20230309210425-6f04be9aab19 + github.com/strangelove-ventures/interchaintest/v7 v7.0.0-20230405184655-2e6d60073e71 github.com/stretchr/testify v1.8.2 go.uber.org/zap v1.24.0 golang.org/x/sync v0.1.0 @@ -27,11 +27,11 @@ require ( cosmossdk.io/core v0.5.1 // indirect cosmossdk.io/depinject v1.0.0-alpha.3 // indirect cosmossdk.io/errors v1.0.0-beta.7 // indirect - cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 // indirect - cosmossdk.io/tools/rosetta v0.2.1 // indirect + cosmossdk.io/math v1.0.0 // indirect + // cosmossdk.io/tools/rosetta v0.2.1 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect - github.com/99designs/keyring v1.2.1 // indirect + github.com/99designs/keyring v1.2.2 // indirect github.com/BurntSushi/toml v1.2.1 // indirect github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect github.com/ChainSafe/go-schnorrkel/1 v0.0.0-00010101000000-000000000000 // indirect @@ -39,7 +39,7 @@ require ( github.com/Microsoft/hcsshim v0.9.6 // indirect github.com/StirlingMarketingGroup/go-namecase v1.0.0 // indirect github.com/armon/go-metrics v0.4.1 // indirect - github.com/avast/retry-go/v4 v4.3.2 // indirect + github.com/avast/retry-go/v4 v4.3.3 // indirect github.com/aws/aws-sdk-go v1.44.203 // indirect github.com/benbjohnson/clock v1.3.0 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -49,7 +49,7 @@ require ( github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect - github.com/centrifuge/go-substrate-rpc-client/v4 v4.0.10 // indirect + github.com/centrifuge/go-substrate-rpc-client/v4 v4.0.12 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chzyer/readline v1.5.1 // indirect @@ -64,7 +64,7 @@ require ( github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/gogoproto v1.4.6 // indirect - github.com/cosmos/iavl v0.20.0-alpha4 // indirect + github.com/cosmos/iavl v0.20.0 // indirect github.com/cosmos/ics23/go v0.9.1-0.20221207100636-b1abd8678aab // indirect github.com/cosmos/ledger-cosmos-go v0.12.2 // indirect github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect @@ -97,10 +97,10 @@ require ( github.com/gofrs/flock v0.8.1 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.3 // indirect - github.com/golang/glog v1.0.0 // indirect + github.com/golang/glog v1.1.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/mock v1.6.0 // indirect - github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.2 // indirect github.com/google/go-cmp v0.5.9 // indirect @@ -130,24 +130,25 @@ require ( github.com/huandu/skiplist v1.2.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/ipfs/go-cid v0.0.7 // indirect + github.com/ipfs/go-cid v0.2.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/jsternberg/zap-logfmt v1.3.0 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect - github.com/klauspost/compress v1.15.15 // indirect - github.com/klauspost/cpuid/v2 v2.0.9 // indirect + github.com/klauspost/compress v1.16.3 // indirect + github.com/klauspost/cpuid/v2 v2.2.3 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/libp2p/go-libp2p-core v0.15.1 // indirect - github.com/libp2p/go-openssl v0.0.7 // indirect + github.com/libp2p/go-libp2p v0.22.0 // indirect + github.com/libp2p/go-libp2p-core v0.20.1 // indirect + github.com/libp2p/go-openssl v0.1.0 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-isatty v0.0.17 // indirect + github.com/mattn/go-pointer v0.0.1 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mimoo/StrobeGo v0.0.0-20220103164710-9a04d6ca976b // indirect - github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/minio/sha256-simd v1.0.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect @@ -159,16 +160,16 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mr-tron/base58 v1.2.0 // indirect github.com/mtibben/percent v0.2.1 // indirect - github.com/multiformats/go-base32 v0.0.3 // indirect + github.com/multiformats/go-base32 v0.0.4 // indirect github.com/multiformats/go-base36 v0.1.0 // indirect - github.com/multiformats/go-multiaddr v0.4.1 // indirect - github.com/multiformats/go-multibase v0.0.3 // indirect - github.com/multiformats/go-multicodec v0.4.1 // indirect - github.com/multiformats/go-multihash v0.1.0 // indirect + github.com/multiformats/go-multiaddr v0.6.0 // indirect + github.com/multiformats/go-multibase v0.1.1 // indirect + github.com/multiformats/go-multicodec v0.5.0 // indirect + github.com/multiformats/go-multihash v0.2.1 // indirect github.com/multiformats/go-varint v0.0.6 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc2 // indirect - github.com/opencontainers/runc v1.1.3 // indirect + github.com/opencontainers/runc v1.1.5 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.0.6 // indirect github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d // indirect @@ -181,7 +182,7 @@ require ( github.com/prometheus/procfs v0.9.0 // indirect github.com/rakyll/statik v0.1.7 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect + github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/rs/cors v1.8.3 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/sirupsen/logrus v1.9.0 // indirect @@ -204,40 +205,40 @@ require ( github.com/vedhavyas/go-subkey v1.0.3 // indirect github.com/zondax/hid v0.9.1 // indirect github.com/zondax/ledger-go v0.14.1 // indirect - go.etcd.io/bbolt v1.3.6 // indirect + go.etcd.io/bbolt v1.3.7 // indirect go.opencensus.io v0.24.0 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect - golang.org/x/crypto v0.6.0 // indirect - golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb // indirect - golang.org/x/mod v0.8.0 // indirect - golang.org/x/net v0.7.0 // indirect + golang.org/x/crypto v0.7.0 // indirect + golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect + golang.org/x/mod v0.9.0 // indirect + golang.org/x/net v0.8.0 // indirect golang.org/x/oauth2 v0.5.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/term v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect - golang.org/x/tools v0.6.0 // indirect + golang.org/x/sys v0.6.0 // indirect + golang.org/x/term v0.6.0 // indirect + golang.org/x/text v0.8.0 // indirect + golang.org/x/tools v0.7.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/api v0.110.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44 // indirect - google.golang.org/grpc v1.53.0 // indirect - google.golang.org/protobuf v1.28.2-0.20230208135220-49eaa78c6c9c // indirect + google.golang.org/grpc v1.54.0 // indirect + google.golang.org/protobuf v1.29.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - lukechampine.com/blake3 v1.1.6 // indirect - lukechampine.com/uint128 v1.1.1 // indirect - modernc.org/cc/v3 v3.36.0 // indirect - modernc.org/ccgo/v3 v3.16.6 // indirect - modernc.org/libc v1.16.7 // indirect - modernc.org/mathutil v1.4.1 // indirect - modernc.org/memory v1.1.1 // indirect - modernc.org/opt v0.1.1 // indirect - modernc.org/sqlite v1.17.3 // indirect - modernc.org/strutil v1.1.1 // indirect - modernc.org/token v1.0.0 // indirect + lukechampine.com/blake3 v1.1.7 // indirect + lukechampine.com/uint128 v1.2.0 // indirect + modernc.org/cc/v3 v3.40.0 // indirect + modernc.org/ccgo/v3 v3.16.13 // indirect + modernc.org/libc v1.22.3 // indirect + modernc.org/mathutil v1.5.0 // indirect + modernc.org/memory v1.5.0 // indirect + modernc.org/opt v0.1.3 // indirect + modernc.org/sqlite v1.21.1 // indirect + modernc.org/strutil v1.1.3 // indirect + modernc.org/token v1.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect pgregory.net/rapid v0.5.5 // indirect sigs.k8s.io/yaml v1.3.0 // indirect @@ -252,4 +253,5 @@ replace ( github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/vedhavyas/go-subkey => github.com/strangelove-ventures/go-subkey v1.0.7 + ) diff --git a/interchaintest/go.sum b/interchaintest/go.sum index bc9bcc63c..e6dc5bf5d 100644 --- a/interchaintest/go.sum +++ b/interchaintest/go.sum @@ -197,8 +197,8 @@ cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 h1:/jnzJ9zFsL7qkV8LCQ1JH3dYHh2EsKZ3k8Mr6AqqiOA= -cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= +cosmossdk.io/math v1.0.0 h1:ro9w7eKx23om2tZz/VM2Pf+z2WAbGX1yDQQOJ6iGeJw= +cosmossdk.io/math v1.0.0/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= cosmossdk.io/simapp v0.0.0-20230224204036-a6adb0821462 h1:g8muUHnXL8vhld2Sjilyhb1UQObc+x9GVuDK43TYZns= cosmossdk.io/simapp v0.0.0-20230224204036-a6adb0821462/go.mod h1:4Dd3NLoLYoN90kZ0uyHoTHzVVk9+J0v4HhZRBNTAq2c= cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= @@ -208,8 +208,8 @@ filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= -github.com/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= -github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= +github.com/99designs/keyring v1.2.2 h1:pZd3neh/EmUzWONb35LxQfvuY7kiSXAq3HQd97+XBn0= +github.com/99designs/keyring v1.2.2/go.mod h1:wes/FrByc8j7lFOAGLGSNEg8f/PaI3cgTBqhFkHUrPk= github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= @@ -293,8 +293,8 @@ github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+ github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/avast/retry-go/v4 v4.3.2 h1:x4sTEu3jSwr7zNjya8NTdIN+U88u/jtO/q3OupBoDtM= -github.com/avast/retry-go/v4 v4.3.2/go.mod h1:rg6XFaiuFYII0Xu3RDbZQkxCofFwruZKW8oEF1jpWiU= +github.com/avast/retry-go/v4 v4.3.3 h1:G56Bp6mU0b5HE1SkaoVjscZjlQb0oy4mezwY/cGH19w= +github.com/avast/retry-go/v4 v4.3.3/go.mod h1:rg6XFaiuFYII0Xu3RDbZQkxCofFwruZKW8oEF1jpWiU= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= @@ -346,8 +346,8 @@ github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInq github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/centrifuge/go-substrate-rpc-client/v4 v4.0.10 h1:HW3XP9G3mXr0gYPfxCAQLD29u+Ys0uIeotv9RWfnhrM= -github.com/centrifuge/go-substrate-rpc-client/v4 v4.0.10/go.mod h1:5g1oM4Zu3BOaLpsKQ+O8PAv2kNuq+kPcA1VzFbsSqxE= +github.com/centrifuge/go-substrate-rpc-client/v4 v4.0.12 h1:DCYWIBOalB0mKKfUg2HhtGgIkBbMA1fnlnkZp7fHB18= +github.com/centrifuge/go-substrate-rpc-client/v4 v4.0.12/go.mod h1:5g1oM4Zu3BOaLpsKQ+O8PAv2kNuq+kPcA1VzFbsSqxE= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -508,8 +508,8 @@ github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-proto v1.0.0-beta.2 h1:X3OKvWgK9Gsejo0F1qs5l8Qn6xJV/AzgIWR2wZ8Nua8= github.com/cosmos/cosmos-proto v1.0.0-beta.2/go.mod h1:+XRCLJ14pr5HFEHIUcn51IKXD1Fy3rkEQqt4WqmN4V0= -github.com/cosmos/cosmos-sdk v0.47.0-rc3 h1:MMun/+mMpzise9d85csTp+kGkhLCkjJLwLK0urp0Bcs= -github.com/cosmos/cosmos-sdk v0.47.0-rc3/go.mod h1:GlXjIIIsIZAD5CPqm7FHtr3v5/anE9eXWDjSWdNmznw= +github.com/cosmos/cosmos-sdk v0.47.1 h1:HnaCYtaAMWZp1SdlwwE1mPJ8kFlZ/TuEJ/ciNXH6Uno= +github.com/cosmos/cosmos-sdk v0.47.1/go.mod h1:14tO5KQaTrl2q3OxBnDRfue7TRN9zkXS0cLutrSqkOo= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -518,10 +518,10 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.4.6 h1:Ee7z15dWJaGlgM2rWrK8N2IX7PQcuccu8oG68jp5RL4= github.com/cosmos/gogoproto v1.4.6/go.mod h1:VS/ASYmPgv6zkPKLjR9EB91lwbLHOzaGCirmKKhncfI= -github.com/cosmos/iavl v0.20.0-alpha4 h1:49SZoxNwah5nqbVE1da8BAhenC7HMSVOTZ0XKVhZpOE= -github.com/cosmos/iavl v0.20.0-alpha4/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= -github.com/cosmos/ibc-go/v7 v7.0.0-rc1 h1:+HokO9GDqWNmjKSLGSC1WjcqjOdDIeSmNGuXQFSHMQE= -github.com/cosmos/ibc-go/v7 v7.0.0-rc1/go.mod h1:wpKGb+lqAnxwThgS3LoCPgDEFNAPVX+1YIQCAJcePcM= +github.com/cosmos/iavl v0.20.0 h1:fTVznVlepH0KK8NyKq8w+U7c2L6jofa27aFX6YGlm38= +github.com/cosmos/iavl v0.20.0/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= +github.com/cosmos/ibc-go/v7 v7.0.0 h1:j4kyywlG0hhDmT9FmSaR5iCIka7Pz7kJTxGWY1nlV9Q= +github.com/cosmos/ibc-go/v7 v7.0.0/go.mod h1:BFh8nKWjr5zeR2OZfhkzdgDzj1+KjRn3aJLpwapStj8= github.com/cosmos/ics23/go v0.9.1-0.20221207100636-b1abd8678aab h1:I9ialKTQo7248V827Bba4OuKPmk+FPzmTVHsLXaIJWw= github.com/cosmos/ics23/go v0.9.1-0.20221207100636-b1abd8678aab/go.mod h1:2CwqasX5dSD7Hbp/9b6lhK6BwoBDCBldx7gPKRukR60= github.com/cosmos/ledger-cosmos-go v0.12.2 h1:/XYaBlE2BJxtvpkHiBm97gFGSGmYGKunKyF3nNqAXZA= @@ -584,8 +584,8 @@ github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4Kfc github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v20.10.19+incompatible h1:lzEmjivyNHFHMNAFLXORMBXyGIhw/UP4DvJwvyKYq64= -github.com/docker/docker v20.10.19+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v20.10.24+incompatible h1:Ugvxm7a8+Gz6vqQYQQ2W7GYq5EUPaAiuPgIfVyI3dYE= +github.com/docker/docker v20.10.24+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= @@ -720,8 +720,8 @@ github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2 github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= -github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= +github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= +github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -756,8 +756,9 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= @@ -815,6 +816,7 @@ github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -941,8 +943,8 @@ github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLf github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/ipfs/go-cid v0.0.7 h1:ysQJVJA3fNDF1qigJbsSQOdjhVLsOEoPdh0+R97k3jY= -github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= +github.com/ipfs/go-cid v0.2.0 h1:01JTiihFq9en9Vz0lc0VDWvZe/uBonGpzo4THP0vcQ0= +github.com/ipfs/go-cid v0.2.0/go.mod h1:P+HXFDF4CVhaVayiEb4wkAy7zBHxBwsJyt0Y5U6MLro= github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jhump/protoreflect v1.12.1-0.20220721211354-060cc04fc18b h1:izTof8BKh/nE1wrKOrloNA5q4odOarjf+Xpe+4qow98= @@ -984,11 +986,12 @@ github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw= -github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4= +github.com/klauspost/compress v1.16.3 h1:XuJt9zzcnaz6a16/OU53ZjWp/v7/42WcR5t2a0PcNQY= +github.com/klauspost/compress v1.16.3/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.3 h1:sxCkb+qR91z4vsqw4vGGZlDgPz3G7gjaLyK3V8y70BU= +github.com/klauspost/cpuid/v2 v2.2.3/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -1009,10 +1012,12 @@ github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= -github.com/libp2p/go-libp2p-core v0.15.1 h1:0RY+Mi/ARK9DgG1g9xVQLb8dDaaU8tCePMtGALEfBnM= -github.com/libp2p/go-libp2p-core v0.15.1/go.mod h1:agSaboYM4hzB1cWekgVReqV5M4g5M+2eNNejV+1EEhs= -github.com/libp2p/go-openssl v0.0.7 h1:eCAzdLejcNVBzP/iZM9vqHnQm+XyCEbSSIheIPRGNsw= -github.com/libp2p/go-openssl v0.0.7/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= +github.com/libp2p/go-libp2p v0.22.0 h1:2Tce0kHOp5zASFKJbNzRElvh0iZwdtG5uZheNW8chIw= +github.com/libp2p/go-libp2p v0.22.0/go.mod h1:UDolmweypBSjQb2f7xutPnwZ/fxioLbMBxSjRksxxU4= +github.com/libp2p/go-libp2p-core v0.20.1 h1:fQz4BJyIFmSZAiTbKV8qoYhEH5Dtv/cVhZbG3Ib/+Cw= +github.com/libp2p/go-libp2p-core v0.20.1/go.mod h1:6zR8H7CvQWgYLsbG4on6oLNSGcyKaYFSEYyDt51+bIY= +github.com/libp2p/go-openssl v0.1.0 h1:LBkKEcUv6vtZIQLVTegAil8jbNpJErQ9AnT+bWV+Ooo= +github.com/libp2p/go-openssl v0.1.0/go.mod h1:OiOxwPpL3n4xlenjx2h7AwSGaFSC/KZvf6gNdOBQMtc= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo= @@ -1033,13 +1038,14 @@ github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-pointer v0.0.1 h1:n+XhsuGeVO6MEAp7xyEukFINEa+Quek5psIR/ylA6o0= +github.com/mattn/go-pointer v0.0.1/go.mod h1:2zXcozF6qYGgmsG+SeTZz3oAbFLdD3OWqnUbNvJZAlc= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= +github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= github.com/mattn/go-shellwords v1.0.6/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= -github.com/mattn/go-sqlite3 v1.14.12 h1:TJ1bhYJPV44phC+IMu1u2K/i5RriLTPe+yc68XDJ1Z0= -github.com/mattn/go-sqlite3 v1.14.12/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= @@ -1050,11 +1056,8 @@ github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WT github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/mimoo/StrobeGo v0.0.0-20220103164710-9a04d6ca976b h1:QrHweqAtyJ9EwCaGHBu1fghwxIPiopAHV06JlXrMHjk= github.com/mimoo/StrobeGo v0.0.0-20220103164710-9a04d6ca976b/go.mod h1:xxLb2ip6sSUts3g1irPVHyk/DGslwQsNOo9I7smJfNU= -github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 h1:lYpkrQH5ajf0OXOcUbGjvZxxijuBwbbmlSxLiuofa+g= -github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= -github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g= github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= @@ -1094,28 +1097,23 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= -github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= -github.com/multiformats/go-base32 v0.0.3 h1:tw5+NhuwaOjJCC5Pp82QuXbrmLzWg7uxlMFp8Nq/kkI= -github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA= +github.com/multiformats/go-base32 v0.0.4 h1:+qMh4a2f37b4xTNs6mqitDinryCI+tfO2dRVMN9mjSE= +github.com/multiformats/go-base32 v0.0.4/go.mod h1:jNLFzjPZtp3aIARHbJRZIaPuspdH0J6q39uUM5pnABM= github.com/multiformats/go-base36 v0.1.0 h1:JR6TyF7JjGd3m6FbLU2cOxhC0Li8z8dLNGQ89tUg4F4= github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM= -github.com/multiformats/go-multiaddr v0.4.1 h1:Pq37uLx3hsyNlTDir7FZyU8+cFCTqd5y1KiM2IzOutI= -github.com/multiformats/go-multiaddr v0.4.1/go.mod h1:3afI9HfVW8csiF8UZqtpYRiDyew8pRX7qLIGHu9FLuM= -github.com/multiformats/go-multibase v0.0.3 h1:l/B6bJDQjvQ5G52jw4QGSYeOTZoAwIO77RblWplfIqk= -github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= -github.com/multiformats/go-multicodec v0.4.1 h1:BSJbf+zpghcZMZrwTYBGwy0CPcVZGWiC72Cp8bBd4R4= -github.com/multiformats/go-multicodec v0.4.1/go.mod h1:1Hj/eHRaVWSXiSNNfcEPcwZleTmdNP81xlxDLnWU9GQ= -github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= -github.com/multiformats/go-multihash v0.0.14/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= -github.com/multiformats/go-multihash v0.1.0 h1:CgAgwqk3//SVEw3T+6DqI4mWMyRuDwZtOWcJT0q9+EA= -github.com/multiformats/go-multihash v0.1.0/go.mod h1:RJlXsxt6vHGaia+S8We0ErjhojtKzPP2AH4+kYM7k84= -github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= +github.com/multiformats/go-multiaddr v0.6.0 h1:qMnoOPj2s8xxPU5kZ57Cqdr0hHhARz7mFsPMIiYNqzg= +github.com/multiformats/go-multiaddr v0.6.0/go.mod h1:F4IpaKZuPP360tOMn2Tpyu0At8w23aRyVqeK0DbFeGM= +github.com/multiformats/go-multibase v0.1.1 h1:3ASCDsuLX8+j4kx58qnJ4YFq/JWTJpCyDW27ztsVTOI= +github.com/multiformats/go-multibase v0.1.1/go.mod h1:ZEjHE+IsUrgp5mhlEAYjMtZwK1k4haNkcaPg9aoe1a8= +github.com/multiformats/go-multicodec v0.5.0 h1:EgU6cBe/D7WRwQb1KmnBvU7lrcFGMggZVTPtOW9dDHs= +github.com/multiformats/go-multicodec v0.5.0/go.mod h1:DiY2HFaEp5EhEXb/iYzVAunmyX/aSFMxq2KMKfWEues= +github.com/multiformats/go-multihash v0.2.1 h1:aem8ZT0VA2nCHHk7bPJ1BjUbHNciqZC/d16Vve9l108= +github.com/multiformats/go-multihash v0.2.1/go.mod h1:WxoMcYG85AZVQUyRyo9s4wULvW5qrI9vb2Lt6evduFc= github.com/multiformats/go-varint v0.0.6 h1:gk85QWKxh3TazbLxED/NlDVv8+q+ReFJk7Y2W/KhfNY= github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= @@ -1185,8 +1183,8 @@ github.com/opencontainers/runc v1.0.0-rc8.0.20190926000215-3e425f80a8c9/go.mod h github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84SM2ImC1fxBuqJ/H0= github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= -github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= -github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= +github.com/opencontainers/runc v1.1.5 h1:L44KXEpKmfWDcS02aeGm8QNTFXTo2D+8MYGDIJ/GDEs= +github.com/opencontainers/runc v1.1.5/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.2-0.20190207185410-29686dbc5559/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= @@ -1295,9 +1293,10 @@ github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqn github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M= github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= -github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/rivo/uniseg v0.4.3 h1:utMvzDsuh3suAEnhH0RdHmoPbU648o6CvXxTx4SBMOw= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -1369,8 +1368,8 @@ github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jH github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= github.com/strangelove-ventures/go-subkey v1.0.7 h1:cOP/Lajg3uxV/tvspu0m6+0Cu+DJgygkEAbx/s+f35I= github.com/strangelove-ventures/go-subkey v1.0.7/go.mod h1:E34izOIEm+sZ1YmYawYRquqBQWeZBjVB4pF7bMuhc1c= -github.com/strangelove-ventures/interchaintest/v7 v7.0.0-20230309210425-6f04be9aab19 h1:myDhIC75y5Kycqke0Go3PeRnsXvGW6fynHDGds2dKFk= -github.com/strangelove-ventures/interchaintest/v7 v7.0.0-20230309210425-6f04be9aab19/go.mod h1:DTYkHkPDFjGE0jGLSG3elpgngb9fhaCHdmM0ERRd/T4= +github.com/strangelove-ventures/interchaintest/v7 v7.0.0-20230405184655-2e6d60073e71 h1:bbhg6Iol/5UR65+4kPaki+3mNUgyvcQe+ZHrleorKKY= +github.com/strangelove-ventures/interchaintest/v7 v7.0.0-20230405184655-2e6d60073e71/go.mod h1:tkBlI3o0Z1jgkZIkckOLIHJuR+S0LbGoBEGg4NQ4Aa8= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= @@ -1459,8 +1458,9 @@ github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2f go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= -go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= +go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk= @@ -1509,13 +1509,12 @@ golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1527,8 +1526,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb h1:PaBZQdo+iSDyHT053FjUCgZQ/9uqVwPOcl7KSWhKn6w= -golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug= +golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1555,8 +1554,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= +golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1624,8 +1623,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1751,7 +1750,6 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1771,7 +1769,6 @@ golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1790,6 +1787,7 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1797,14 +1795,13 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1815,8 +1812,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1879,7 +1876,6 @@ golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20200916195026-c9a70fc28ce3/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -1893,8 +1889,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= +golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2124,8 +2120,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc= -google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= +google.golang.org/grpc v1.54.0 h1:EhTqbhiYeixwWQtAEZAxmV9MGqcjEU2mFx52xCzNyag= +google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -2142,8 +2138,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.28.2-0.20230208135220-49eaa78c6c9c h1:gDe3xeLH/W6iv5d9xQBo6IwJbCdVcZRiV8xuix6FJW8= -google.golang.org/protobuf v1.28.2-0.20230208135220-49eaa78c6c9c/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.29.1 h1:7QBf+IK2gx70Ap/hDsOmam3GE0v9HicjfEdAxE62UoM= +google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -2229,43 +2225,32 @@ k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -lukechampine.com/blake3 v1.1.6 h1:H3cROdztr7RCfoaTpGZFQsrqvweFLrqS73j7L7cmR5c= -lukechampine.com/blake3 v1.1.6/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= -lukechampine.com/uint128 v1.1.1 h1:pnxCASz787iMf+02ssImqk6OLt+Z5QHMoZyUXR4z6JU= -lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= -modernc.org/cc/v3 v3.36.0 h1:0kmRkTmqNidmu3c7BNDSdVHCxXCkWLmWmCIVX4LUboo= -modernc.org/cc/v3 v3.36.0/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= -modernc.org/ccgo/v3 v3.0.0-20220428102840-41399a37e894/go.mod h1:eI31LL8EwEBKPpNpA4bU1/i+sKOwOrQy8D87zWUcRZc= -modernc.org/ccgo/v3 v3.0.0-20220430103911-bc99d88307be/go.mod h1:bwdAnOoaIt8Ax9YdWGjxWsdkPcZyRPHqrOvJxaKAKGw= -modernc.org/ccgo/v3 v3.16.4/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= -modernc.org/ccgo/v3 v3.16.6 h1:3l18poV+iUemQ98O3X5OMr97LOqlzis+ytivU4NqGhA= -modernc.org/ccgo/v3 v3.16.6/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= +lukechampine.com/blake3 v1.1.7 h1:GgRMhmdsuK8+ii6UZFDL8Nb+VyMwadAgcJyfYHxG6n0= +lukechampine.com/blake3 v1.1.7/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= +lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI= +lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +modernc.org/cc/v3 v3.40.0 h1:P3g79IUS/93SYhtoeaHW+kRCIrYaxJ27MFPv+7kaTOw= +modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0= +modernc.org/ccgo/v3 v3.16.13 h1:Mkgdzl46i5F/CNR/Kj80Ri59hC8TKAhZrYSaqvkwzUw= +modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY= modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk= -modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM= -modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= -modernc.org/libc v0.0.0-20220428101251-2d5f3daf273b/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= -modernc.org/libc v1.16.0/go.mod h1:N4LD6DBE9cf+Dzf9buBlzVJndKr/iJHG97vGLHYnb5A= -modernc.org/libc v1.16.1/go.mod h1:JjJE0eu4yeK7tab2n4S1w8tlWd9MxXLRzheaRnAKymU= -modernc.org/libc v1.16.7 h1:qzQtHhsZNpVPpeCu+aMIQldXeV1P0vRhSqCL0nOIJOA= -modernc.org/libc v1.16.7/go.mod h1:hYIV5VZczAmGZAnG15Vdngn5HSF5cSkbvfz2B7GRuVU= -modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/mathutil v1.4.1 h1:ij3fYGe8zBF4Vu+g0oT7mB06r8sqGWKuJu1yXeR4by8= -modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/memory v1.1.1 h1:bDOL0DIDLQv7bWhP3gMvIrnoFw+Eo6F7a2QK9HPDiFU= -modernc.org/memory v1.1.1/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= -modernc.org/opt v0.1.1 h1:/0RX92k9vwVeDXj+Xn23DKp2VJubL7k8qNffND6qn3A= -modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/sqlite v1.17.3 h1:iE+coC5g17LtByDYDWKpR6m2Z9022YrSh3bumwOnIrI= -modernc.org/sqlite v1.17.3/go.mod h1:10hPVYar9C0kfXuTWGz8s0XtB8uAGymUy51ZzStYe3k= -modernc.org/strutil v1.1.1 h1:xv+J1BXY3Opl2ALrBwyfEikFAj8pmqcpnfmuwUwcozs= -modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= -modernc.org/tcl v1.13.1 h1:npxzTwFTZYM8ghWicVIX1cRWzj7Nd8i6AqqX2p+IYao= -modernc.org/tcl v1.13.1/go.mod h1:XOLfOwzhkljL4itZkK6T72ckMgvj0BDsnKNdZVUOecw= -modernc.org/token v1.0.0 h1:a0jaWiNMDhDUtqOj09wvjWWAqd3q7WpBulmL9H2egsk= -modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= -modernc.org/z v1.5.1 h1:RTNHdsrOpeoSeOF4FbzTo8gBYByaJ5xT7NgZ9ZqRiJM= -modernc.org/z v1.5.1/go.mod h1:eWFB510QWW5Th9YGZT81s+LwvaAs3Q2yr4sP0rmLkv8= +modernc.org/libc v1.22.3 h1:D/g6O5ftAfavceqlLOFwaZuA5KYafKwmr30A6iSqoyY= +modernc.org/libc v1.22.3/go.mod h1:MQrloYP209xa2zHome2a8HLiLm6k0UT8CoHpV74tOFw= +modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= +modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/memory v1.5.0 h1:N+/8c5rE6EqugZwHii4IFsaJ7MUhoWX07J5tC/iI5Ds= +modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/sqlite v1.21.1 h1:GyDFqNnESLOhwwDRaHGdp2jKLDzpyT/rNLglX3ZkMSU= +modernc.org/sqlite v1.21.1/go.mod h1:XwQ0wZPIh1iKb5mkvCJ3szzbhk+tykC8ZWqTRTgYRwI= +modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY= +modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= +modernc.org/tcl v1.15.1 h1:mOQwiEK4p7HruMZcwKTZPw/aqtGM4aY00uzWhlKKYws= +modernc.org/token v1.0.1 h1:A3qvTqOwexpfZZeyI0FeGPDlSWX5pjZu9hF4lU+EKWg= +modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/z v1.7.0 h1:xkDw/KepgEjeizO2sNco+hqYkU12taxQFqPEmgm1GWE= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= pgregory.net/rapid v0.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA= diff --git a/interchaintest/ica_channel_close_test.go b/interchaintest/ica_channel_close_test.go new file mode 100644 index 000000000..b21a41c32 --- /dev/null +++ b/interchaintest/ica_channel_close_test.go @@ -0,0 +1,334 @@ +package interchaintest_test + +import ( + "context" + "encoding/json" + "strconv" + "testing" + "time" + + "github.com/cosmos/cosmos-sdk/crypto/keyring" + chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + relayerinterchaintest "github.com/cosmos/relayer/v2/interchaintest" + interchaintest "github.com/strangelove-ventures/interchaintest/v7" + "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" + "github.com/strangelove-ventures/interchaintest/v7/ibc" + "github.com/strangelove-ventures/interchaintest/v7/testreporter" + "github.com/strangelove-ventures/interchaintest/v7/testutil" + "github.com/stretchr/testify/require" + "go.uber.org/zap/zaptest" +) + +// TestScenarioICAChannelClose is very similar to the TestScenarioInterchainAccounts, +// but instead it tests manually closing the channel using the relayer CLI. +func TestScenarioICAChannelClose(t *testing.T) { + if testing.Short() { + t.Skip("skipping in short mode") + } + + t.Parallel() + + client, network := interchaintest.DockerSetup(t) + + rep := testreporter.NewNopReporter() + eRep := rep.RelayerExecReporter(t) + + ctx := context.Background() + + // Get both chains + nf := 0 + nv := 1 + cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ + { + Name: "icad", + NumValidators: &nv, + NumFullNodes: &nf, + ChainConfig: ibc.ChainConfig{ + Images: []ibc.DockerImage{{Repository: "ghcr.io/cosmos/ibc-go-icad", Version: "v0.5.0"}}, + UsingNewGenesisCommand: true, + }, + }, + { + Name: "icad", + NumValidators: &nv, + NumFullNodes: &nf, + ChainConfig: ibc.ChainConfig{ + Images: []ibc.DockerImage{{Repository: "ghcr.io/cosmos/ibc-go-icad", Version: "v0.5.0"}}, + UsingNewGenesisCommand: true, + }, + }, + }) + + chains, err := cf.Chains(t.Name()) + require.NoError(t, err) + + chain1, chain2 := chains[0].(*cosmos.CosmosChain), chains[1].(*cosmos.CosmosChain) + + // Get a relayer instance + r := relayerinterchaintest. + NewRelayerFactory(relayerinterchaintest.RelayerConfig{}). + Build(t, client, network) + + // Build the network; spin up the chains and configure the relayer + const pathName = "test-path" + const relayerName = "relayer" + + ic := interchaintest.NewInterchain(). + AddChain(chain1). + AddChain(chain2). + AddRelayer(r, relayerName). + AddLink(interchaintest.InterchainLink{ + Chain1: chain1, + Chain2: chain2, + Relayer: r, + Path: pathName, + }) + + require.NoError(t, ic.Build(ctx, eRep, interchaintest.InterchainBuildOptions{ + TestName: t.Name(), + Client: client, + NetworkID: network, + SkipPathCreation: true, + // Uncomment this to load blocks, txs, msgs, and events into sqlite db as test runs + // BlockDatabaseFile: interchaintest.DefaultBlockDatabaseFilepath(), + })) + + // Fund a user account on chain1 and chain2 + const userFunds = int64(10_000_000_000) + users := interchaintest.GetAndFundTestUsers(t, ctx, t.Name(), userFunds, chain1, chain2) + chain1User := users[0] + chain2User := users[1] + + // Generate a new IBC path + err = r.GeneratePath(ctx, eRep, chain1.Config().ChainID, chain2.Config().ChainID, pathName) + require.NoError(t, err) + + // Create new clients + err = r.CreateClients(ctx, eRep, pathName, ibc.CreateClientOptions{TrustingPeriod: "330h"}) + require.NoError(t, err) + + err = testutil.WaitForBlocks(ctx, 2, chain1, chain2) + require.NoError(t, err) + + // Create a new connection + err = r.CreateConnections(ctx, eRep, pathName) + require.NoError(t, err) + + err = testutil.WaitForBlocks(ctx, 2, chain1, chain2) + require.NoError(t, err) + + // Query for the newly created connection + connections, err := r.GetConnections(ctx, eRep, chain1.Config().ChainID) + require.NoError(t, err) + require.Equal(t, 1, len(connections)) + + // Start the relayer and set the cleanup function. + err = r.StartRelayer(ctx, eRep, pathName) + require.NoError(t, err) + + t.Cleanup( + func() { + err := r.StopRelayer(ctx, eRep) + if err != nil { + t.Logf("an error occurred while stopping the relayer: %s", err) + } + }, + ) + + // Register a new interchain account on chain2, on behalf of the user acc on chain1 + chain1Addr := chain1User.(*cosmos.CosmosWallet).FormattedAddressWithPrefix(chain1.Config().Bech32Prefix) + + registerICA := []string{ + chain1.Config().Bin, "tx", "intertx", "register", + "--from", chain1Addr, + "--connection-id", connections[0].ID, + "--chain-id", chain1.Config().ChainID, + "--home", chain1.HomeDir(), + "--node", chain1.GetRPCAddress(), + "--keyring-backend", keyring.BackendTest, + "-y", + } + _, _, err = chain1.Exec(ctx, registerICA, nil) + require.NoError(t, err) + + ir := cosmos.DefaultEncoding().InterfaceRegistry + + c2h, err := chain2.Height(ctx) + require.NoError(t, err) + + channelFound := func(found *chantypes.MsgChannelOpenConfirm) bool { + return found.PortId == "icahost" + } + + // Wait for channel open confirm + _, err = cosmos.PollForMessage(ctx, chain2, ir, + c2h, c2h+30, channelFound) + require.NoError(t, err) + + // Query for the newly registered interchain account + queryICA := []string{ + chain1.Config().Bin, "query", "intertx", "interchainaccounts", connections[0].ID, chain1Addr, + "--chain-id", chain1.Config().ChainID, + "--home", chain1.HomeDir(), + "--node", chain1.GetRPCAddress(), + } + stdout, _, err := chain1.Exec(ctx, queryICA, nil) + require.NoError(t, err) + + icaAddr := parseInterchainAccountField(stdout) + require.NotEmpty(t, icaAddr) + + // Get initial account balances + chain2Addr := chain2User.(*cosmos.CosmosWallet).FormattedAddressWithPrefix(chain2.Config().Bech32Prefix) + + chain2OrigBal, err := chain2.GetBalance(ctx, chain2Addr, chain2.Config().Denom) + require.NoError(t, err) + + icaOrigBal, err := chain2.GetBalance(ctx, icaAddr, chain2.Config().Denom) + require.NoError(t, err) + + // Send funds to ICA from user account on chain2 + const transferAmount = 10000 + transfer := ibc.WalletAmount{ + Address: icaAddr, + Denom: chain2.Config().Denom, + Amount: transferAmount, + } + err = chain2.SendFunds(ctx, chain2User.KeyName(), transfer) + require.NoError(t, err) + + chain2Bal, err := chain2.GetBalance(ctx, chain2Addr, chain2.Config().Denom) + require.NoError(t, err) + require.Equal(t, chain2OrigBal-transferAmount, chain2Bal) + + icaBal, err := chain2.GetBalance(ctx, icaAddr, chain2.Config().Denom) + require.NoError(t, err) + require.Equal(t, icaOrigBal+transferAmount, icaBal) + + // Build bank transfer msg + rawMsg, err := json.Marshal(map[string]any{ + "@type": "/cosmos.bank.v1beta1.MsgSend", + "from_address": icaAddr, + "to_address": chain2Addr, + "amount": []map[string]any{ + { + "denom": chain2.Config().Denom, + "amount": strconv.Itoa(transferAmount), + }, + }, + }) + require.NoError(t, err) + + // Send bank transfer msg to ICA on chain2 from the user account on chain1 + sendICATransfer := []string{ + chain1.Config().Bin, "tx", "intertx", "submit", string(rawMsg), + "--connection-id", connections[0].ID, + "--from", chain1Addr, + "--chain-id", chain1.Config().ChainID, + "--home", chain1.HomeDir(), + "--node", chain1.GetRPCAddress(), + "--keyring-backend", keyring.BackendTest, + "-y", + } + _, _, err = chain1.Exec(ctx, sendICATransfer, nil) + require.NoError(t, err) + + c1h, err := chain1.Height(ctx) + require.NoError(t, err) + + ackFound := func(found *chantypes.MsgAcknowledgement) bool { + return found.Packet.Sequence == 1 && + found.Packet.SourcePort == "icacontroller-"+chain1Addr && + found.Packet.DestinationPort == "icahost" + } + + // Wait for ack + _, err = cosmos.PollForMessage(ctx, chain1, ir, + c1h, c1h+10, ackFound) + require.NoError(t, err) + + // Assert that the funds have been received by the user account on chain2 + chain2Bal, err = chain2.GetBalance(ctx, chain2Addr, chain2.Config().Denom) + require.NoError(t, err) + require.Equal(t, chain2OrigBal, chain2Bal) + + // Assert that the funds have been removed from the ICA on chain2 + icaBal, err = chain2.GetBalance(ctx, icaAddr, chain2.Config().Denom) + require.NoError(t, err) + require.Equal(t, icaOrigBal, icaBal) + + // Stop the relayer and wait for the process to terminate + err = r.StopRelayer(ctx, eRep) + require.NoError(t, err) + + // Send another bank transfer msg to ICA on chain2 from the user account on chain1. + // This message should timeout and the channel will be closed when we re-start the relayer. + _, _, err = chain1.Exec(ctx, sendICATransfer, nil) + require.NoError(t, err) + + // Wait for approximately one minute to allow packet timeout threshold to be hit + time.Sleep(70 * time.Second) + + chain1Chans, err := r.GetChannels(ctx, eRep, chain1.Config().ChainID) + require.NoError(t, err) + require.Equal(t, 1, len(chain1Chans)) + + // Close the channel using the channel close CLI method + res := r.Exec(ctx, eRep, []string{"tx", "channel-close", pathName, chain1Chans[0].ChannelID, chain1Chans[0].PortID}, nil) + require.NoError(t, res.Err) + require.Zero(t, res.ExitCode) + + // Assert that the packet timed out and that the acc balances are correct + chain2Bal, err = chain2.GetBalance(ctx, chain2Addr, chain2.Config().Denom) + require.NoError(t, err) + require.Equal(t, chain2OrigBal, chain2Bal) + + icaBal, err = chain2.GetBalance(ctx, icaAddr, chain2.Config().Denom) + require.NoError(t, err) + require.Equal(t, icaOrigBal, icaBal) + + // Assert that the channel ends are both closed + chain1Chans, err = r.GetChannels(ctx, eRep, chain1.Config().ChainID) + require.NoError(t, err) + require.Equal(t, 1, len(chain1Chans)) + require.Subset(t, []string{"STATE_CLOSED", "Closed"}, []string{chain1Chans[0].State}) + + chain2Chans, err := r.GetChannels(ctx, eRep, chain2.Config().ChainID) + require.NoError(t, err) + require.Equal(t, 1, len(chain2Chans)) + require.Subset(t, []string{"STATE_CLOSED", "Closed"}, []string{chain2Chans[0].State}) + + // Restart the relayer for the next channel handshake + err = r.StartRelayer(ctx, eRep, pathName) + require.NoError(t, err) + + // Attempt to open another channel for the same ICA + _, _, err = chain1.Exec(ctx, registerICA, nil) + require.NoError(t, err) + + c2h, err = chain2.Height(ctx) + require.NoError(t, err) + + // Wait for channel open confirm + _, err = cosmos.PollForMessage(ctx, chain2, ir, + c2h, c2h+30, channelFound) + require.NoError(t, err) + + // Assert that a new channel has been opened and the same ICA is in use + stdout, _, err = chain1.Exec(ctx, queryICA, nil) + require.NoError(t, err) + + newICA := parseInterchainAccountField(stdout) + require.NotEmpty(t, newICA) + require.Equal(t, icaAddr, newICA) + + chain1Chans, err = r.GetChannels(ctx, eRep, chain1.Config().ChainID) + require.NoError(t, err) + require.Equal(t, 2, len(chain1Chans)) + require.Subset(t, []string{"STATE_OPEN", "Open"}, []string{chain1Chans[1].State}) + + chain2Chans, err = r.GetChannels(ctx, eRep, chain2.Config().ChainID) + require.NoError(t, err) + require.Equal(t, 2, len(chain2Chans)) + require.Subset(t, []string{"STATE_OPEN", "Open"}, []string{chain2Chans[1].State}) +} diff --git a/interchaintest/interchain_accounts_test.go b/interchaintest/interchain_accounts_test.go new file mode 100644 index 000000000..0185b2bc2 --- /dev/null +++ b/interchaintest/interchain_accounts_test.go @@ -0,0 +1,349 @@ +package interchaintest_test + +import ( + "context" + "encoding/json" + "strconv" + "strings" + "testing" + "time" + + "github.com/cosmos/cosmos-sdk/crypto/keyring" + chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + relayerinterchaintest "github.com/cosmos/relayer/v2/interchaintest" + interchaintest "github.com/strangelove-ventures/interchaintest/v7" + "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" + "github.com/strangelove-ventures/interchaintest/v7/ibc" + "github.com/strangelove-ventures/interchaintest/v7/testreporter" + "github.com/strangelove-ventures/interchaintest/v7/testutil" + "github.com/stretchr/testify/require" + "go.uber.org/zap/zaptest" +) + +// TestScenarioInterchainAccounts is a test case that performs simulations and assertions around some basic +// features and packet flows surrounding interchain accounts. See: https://github.com/cosmos/interchain-accounts-demo +func TestScenarioInterchainAccounts(t *testing.T) { + if testing.Short() { + t.Skip("skipping in short mode") + } + + t.Parallel() + + client, network := interchaintest.DockerSetup(t) + + rep := testreporter.NewNopReporter() + eRep := rep.RelayerExecReporter(t) + + ctx := context.Background() + + // Get both chains + nf := 0 + nv := 1 + cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ + { + Name: "icad", + NumValidators: &nv, + NumFullNodes: &nf, + ChainConfig: ibc.ChainConfig{ + Images: []ibc.DockerImage{{Repository: "ghcr.io/cosmos/ibc-go-icad", Version: "v0.5.0"}}, + UsingNewGenesisCommand: true, + }, + }, + { + Name: "icad", + NumValidators: &nv, + NumFullNodes: &nf, + ChainConfig: ibc.ChainConfig{ + Images: []ibc.DockerImage{{Repository: "ghcr.io/cosmos/ibc-go-icad", Version: "v0.5.0"}}, + UsingNewGenesisCommand: true, + }, + }, + }) + + chains, err := cf.Chains(t.Name()) + require.NoError(t, err) + + chain1, chain2 := chains[0].(*cosmos.CosmosChain), chains[1].(*cosmos.CosmosChain) + + // Get a relayer instance + r := relayerinterchaintest. + NewRelayerFactory(relayerinterchaintest.RelayerConfig{}). + Build(t, client, network) + + // Build the network; spin up the chains and configure the relayer + const pathName = "test-path" + const relayerName = "relayer" + + ic := interchaintest.NewInterchain(). + AddChain(chain1). + AddChain(chain2). + AddRelayer(r, relayerName). + AddLink(interchaintest.InterchainLink{ + Chain1: chain1, + Chain2: chain2, + Relayer: r, + Path: pathName, + }) + + require.NoError(t, ic.Build(ctx, eRep, interchaintest.InterchainBuildOptions{ + TestName: t.Name(), + Client: client, + NetworkID: network, + SkipPathCreation: true, + // Uncomment this to load blocks, txs, msgs, and events into sqlite db as test runs + // BlockDatabaseFile: interchaintest.DefaultBlockDatabaseFilepath(), + })) + + // Fund a user account on chain1 and chain2 + const userFunds = int64(10_000_000_000) + users := interchaintest.GetAndFundTestUsers(t, ctx, t.Name(), userFunds, chain1, chain2) + chain1User := users[0] + chain2User := users[1] + + // Generate a new IBC path + err = r.GeneratePath(ctx, eRep, chain1.Config().ChainID, chain2.Config().ChainID, pathName) + require.NoError(t, err) + + // Create new clients + err = r.CreateClients(ctx, eRep, pathName, ibc.CreateClientOptions{TrustingPeriod: "330h"}) + require.NoError(t, err) + + err = testutil.WaitForBlocks(ctx, 2, chain1, chain2) + require.NoError(t, err) + + // Create a new connection + err = r.CreateConnections(ctx, eRep, pathName) + require.NoError(t, err) + + err = testutil.WaitForBlocks(ctx, 2, chain1, chain2) + require.NoError(t, err) + + // Query for the newly created connection + connections, err := r.GetConnections(ctx, eRep, chain1.Config().ChainID) + require.NoError(t, err) + require.Equal(t, 1, len(connections)) + + // Start the relayer and set the cleanup function. + err = r.StartRelayer(ctx, eRep, pathName) + require.NoError(t, err) + + t.Cleanup( + func() { + err := r.StopRelayer(ctx, eRep) + if err != nil { + t.Logf("an error occured while stopping the relayer: %s", err) + } + }, + ) + + // Register a new interchain account on chain2, on behalf of the user acc on chain1 + chain1Addr := chain1User.(*cosmos.CosmosWallet).FormattedAddressWithPrefix(chain1.Config().Bech32Prefix) + + registerICA := []string{ + chain1.Config().Bin, "tx", "intertx", "register", + "--from", chain1Addr, + "--connection-id", connections[0].ID, + "--chain-id", chain1.Config().ChainID, + "--home", chain1.HomeDir(), + "--node", chain1.GetRPCAddress(), + "--keyring-backend", keyring.BackendTest, + "-y", + } + _, _, err = chain1.Exec(ctx, registerICA, nil) + require.NoError(t, err) + + ir := cosmos.DefaultEncoding().InterfaceRegistry + + c2h, err := chain2.Height(ctx) + require.NoError(t, err) + + channelFound := func(found *chantypes.MsgChannelOpenConfirm) bool { + return found.PortId == "icahost" + } + + // Wait for channel open confirm + _, err = cosmos.PollForMessage(ctx, chain2, ir, + c2h, c2h+30, channelFound) + require.NoError(t, err) + + // Query for the newly registered interchain account + queryICA := []string{ + chain1.Config().Bin, "query", "intertx", "interchainaccounts", connections[0].ID, chain1Addr, + "--chain-id", chain1.Config().ChainID, + "--home", chain1.HomeDir(), + "--node", chain1.GetRPCAddress(), + } + stdout, _, err := chain1.Exec(ctx, queryICA, nil) + require.NoError(t, err) + + icaAddr := parseInterchainAccountField(stdout) + require.NotEmpty(t, icaAddr) + + // Get initial account balances + chain2Addr := chain2User.(*cosmos.CosmosWallet).FormattedAddressWithPrefix(chain2.Config().Bech32Prefix) + + chain2OrigBal, err := chain2.GetBalance(ctx, chain2Addr, chain2.Config().Denom) + require.NoError(t, err) + + icaOrigBal, err := chain2.GetBalance(ctx, icaAddr, chain2.Config().Denom) + require.NoError(t, err) + + // Send funds to ICA from user account on chain2 + const transferAmount = 10000 + transfer := ibc.WalletAmount{ + Address: icaAddr, + Denom: chain2.Config().Denom, + Amount: transferAmount, + } + err = chain2.SendFunds(ctx, chain2User.KeyName(), transfer) + require.NoError(t, err) + + chain2Bal, err := chain2.GetBalance(ctx, chain2Addr, chain2.Config().Denom) + require.NoError(t, err) + require.Equal(t, chain2OrigBal-transferAmount, chain2Bal) + + icaBal, err := chain2.GetBalance(ctx, icaAddr, chain2.Config().Denom) + require.NoError(t, err) + require.Equal(t, icaOrigBal+transferAmount, icaBal) + + // Build bank transfer msg + rawMsg, err := json.Marshal(map[string]any{ + "@type": "/cosmos.bank.v1beta1.MsgSend", + "from_address": icaAddr, + "to_address": chain2Addr, + "amount": []map[string]any{ + { + "denom": chain2.Config().Denom, + "amount": strconv.Itoa(transferAmount), + }, + }, + }) + require.NoError(t, err) + + // Send bank transfer msg to ICA on chain2 from the user account on chain1 + sendICATransfer := []string{ + chain1.Config().Bin, "tx", "intertx", "submit", string(rawMsg), + "--connection-id", connections[0].ID, + "--from", chain1Addr, + "--chain-id", chain1.Config().ChainID, + "--home", chain1.HomeDir(), + "--node", chain1.GetRPCAddress(), + "--keyring-backend", keyring.BackendTest, + "-y", + } + _, _, err = chain1.Exec(ctx, sendICATransfer, nil) + require.NoError(t, err) + + c1h, err := chain1.Height(ctx) + require.NoError(t, err) + + ackFound := func(found *chantypes.MsgAcknowledgement) bool { + return found.Packet.Sequence == 1 && + found.Packet.SourcePort == "icacontroller-"+chain1Addr && + found.Packet.DestinationPort == "icahost" + } + + // Wait for ack + _, err = cosmos.PollForMessage(ctx, chain1, ir, + c1h, c1h+10, ackFound) + require.NoError(t, err) + + // Assert that the funds have been received by the user account on chain2 + chain2Bal, err = chain2.GetBalance(ctx, chain2Addr, chain2.Config().Denom) + require.NoError(t, err) + require.Equal(t, chain2OrigBal, chain2Bal) + + // Assert that the funds have been removed from the ICA on chain2 + icaBal, err = chain2.GetBalance(ctx, icaAddr, chain2.Config().Denom) + require.NoError(t, err) + require.Equal(t, icaOrigBal, icaBal) + + // Stop the relayer and wait for the process to terminate + err = r.StopRelayer(ctx, eRep) + require.NoError(t, err) + + // Send another bank transfer msg to ICA on chain2 from the user account on chain1. + // This message should timeout and the channel will be closed when we re-start the relayer. + _, _, err = chain1.Exec(ctx, sendICATransfer, nil) + require.NoError(t, err) + + // Wait for approximately one minute to allow packet timeout threshold to be hit + time.Sleep(70 * time.Second) + + // Restart the relayer and wait for NextSeqRecv proof to be delivered and packet timed out + err = r.StartRelayer(ctx, eRep, pathName) + require.NoError(t, err) + + c2h, err = chain2.Height(ctx) + require.NoError(t, err) + + chanCloseFound := func(found *chantypes.MsgChannelCloseConfirm) bool { + return found.PortId == "icahost" + } + + // Wait for channel close confirm + _, err = cosmos.PollForMessage(ctx, chain2, ir, c2h, c2h+30, chanCloseFound) + require.NoError(t, err) + + // Assert that the packet timed out and that the acc balances are correct + chain2Bal, err = chain2.GetBalance(ctx, chain2Addr, chain2.Config().Denom) + require.NoError(t, err) + require.Equal(t, chain2OrigBal, chain2Bal) + + icaBal, err = chain2.GetBalance(ctx, icaAddr, chain2.Config().Denom) + require.NoError(t, err) + require.Equal(t, icaOrigBal, icaBal) + + // Assert that the channel ends are both closed + chain1Chans, err := r.GetChannels(ctx, eRep, chain1.Config().ChainID) + require.NoError(t, err) + require.Equal(t, 1, len(chain1Chans)) + require.Subset(t, []string{"STATE_CLOSED", "Closed"}, []string{chain1Chans[0].State}) + + chain2Chans, err := r.GetChannels(ctx, eRep, chain2.Config().ChainID) + require.NoError(t, err) + require.Equal(t, 1, len(chain2Chans)) + require.Subset(t, []string{"STATE_CLOSED", "Closed"}, []string{chain2Chans[0].State}) + + // Attempt to open another channel for the same ICA + _, _, err = chain1.Exec(ctx, registerICA, nil) + require.NoError(t, err) + + // Wait for channel handshake to finish + c2h, err = chain2.Height(ctx) + require.NoError(t, err) + + // Wait for channel open confirm + _, err = cosmos.PollForMessage(ctx, chain2, ir, + c2h, c2h+30, channelFound) + require.NoError(t, err) + + // Assert that a new channel has been opened and the same ICA is in use + stdout, _, err = chain1.Exec(ctx, queryICA, nil) + require.NoError(t, err) + + newICA := parseInterchainAccountField(stdout) + require.NotEmpty(t, newICA) + require.Equal(t, icaAddr, newICA) + + chain1Chans, err = r.GetChannels(ctx, eRep, chain1.Config().ChainID) + require.NoError(t, err) + require.Equal(t, 2, len(chain1Chans)) + require.Subset(t, []string{"STATE_OPEN", "Open"}, []string{chain1Chans[1].State}) + + chain2Chans, err = r.GetChannels(ctx, eRep, chain2.Config().ChainID) + require.NoError(t, err) + require.Equal(t, 2, len(chain2Chans)) + require.Subset(t, []string{"STATE_OPEN", "Open"}, []string{chain2Chans[1].State}) +} + +// parseInterchainAccountField takes a slice of bytes which should be returned when querying for an ICA via +// the 'intertx interchainaccounts' cmd and splices out the actual address portion. +func parseInterchainAccountField(stdout []byte) string { + // After querying an ICA the stdout should look like the following, + // interchain_account_address: cosmos1p76n3mnanllea4d3av0v0e42tjj03cae06xq8fwn9at587rqp23qvxsv0j + // So we split the string at the : and then grab the address and return. + parts := strings.SplitN(string(stdout), ":", 2) + icaAddr := strings.TrimSpace(parts[1]) + return icaAddr +} diff --git a/interchaintest/relay_many_test.go b/interchaintest/relay_many_test.go index 49bb530ca..65859f487 100644 --- a/interchaintest/relay_many_test.go +++ b/interchaintest/relay_many_test.go @@ -86,10 +86,11 @@ func TestRelayerMultiplePathsSingleProcess(t *testing.T) { client, network := interchaintest.DockerSetup(t) require.NoError(t, ic.Build(ctx, eRep, interchaintest.InterchainBuildOptions{ - TestName: t.Name(), - Client: client, - NetworkID: network, - BlockDatabaseFile: interchaintest.DefaultBlockDatabaseFilepath(), + TestName: t.Name(), + Client: client, + NetworkID: network, + // Uncomment this to load blocks, txs, msgs, and events into sqlite db as test runs + // BlockDatabaseFile: interchaintest.DefaultBlockDatabaseFilepath(), SkipPathCreation: false, })) diff --git a/interchaintest/relayer.go b/interchaintest/relayer.go index 7c5a0e81c..1283ac9a8 100644 --- a/interchaintest/relayer.go +++ b/interchaintest/relayer.go @@ -9,7 +9,6 @@ import ( "testing" "github.com/cosmos/cosmos-sdk/crypto/keyring" - "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/relayer/v2/cmd" "github.com/cosmos/relayer/v2/internal/relayertest" "github.com/cosmos/relayer/v2/relayer" @@ -17,7 +16,7 @@ import ( "github.com/cosmos/relayer/v2/relayer/provider" interchaintestcosmos "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" "github.com/strangelove-ventures/interchaintest/v7/ibc" - "github.com/stretchr/testify/require" + "github.com/strangelove-ventures/interchaintest/v7/relayer/rly" "go.uber.org/zap" "go.uber.org/zap/zaptest" ) @@ -85,8 +84,8 @@ func (r *Relayer) AddChainConfiguration(ctx context.Context, _ ibc.RelayerExecRe return nil } -func (r *Relayer) AddKey(ctx context.Context, _ ibc.RelayerExecReporter, chainID, keyName string, coinType string) (ibc.Wallet, error) { - res := r.sys().RunC(ctx, r.log(), "keys", "add", chainID, keyName, "--coin-type", coinType) +func (r *Relayer) AddKey(ctx context.Context, _ ibc.RelayerExecReporter, chainID, keyName, coinType, signingAlgorithm string) (ibc.Wallet, error) { + res := r.sys().RunC(ctx, r.log(), "keys", "add", chainID, keyName, "--coin-type", coinType, "--signing-algorithm", signingAlgorithm) if res.Err != nil { return nil, res.Err } @@ -99,8 +98,8 @@ func (r *Relayer) AddKey(ctx context.Context, _ ibc.RelayerExecReporter, chainID return w, nil } -func (r *Relayer) RestoreKey(ctx context.Context, _ ibc.RelayerExecReporter, chainID, keyName, coinType, mnemonic string) error { - res := r.sys().RunC(ctx, r.log(), "keys", "restore", chainID, keyName, mnemonic, "--coin-type", coinType) +func (r *Relayer) RestoreKey(ctx context.Context, _ ibc.RelayerExecReporter, chainID, keyName, coinType, signingAlgorithm, mnemonic string) error { + res := r.sys().RunC(ctx, r.log(), "keys", "restore", chainID, keyName, mnemonic, "--coin-type", coinType, "--signing-algorithm", signingAlgorithm) if res.Err != nil { return res.Err } @@ -158,7 +157,7 @@ func (r *Relayer) GetClients(ctx context.Context, _ ibc.RelayerExecReporter, cha if strings.TrimSpace(client) == "" { continue } - var clientOutput *ibc.ClientOutput + clientOutput := &ibc.ClientOutput{} if err := json.Unmarshal([]byte(client), clientOutput); err != nil { return nil, fmt.Errorf("failed to parse client %q: %w", client, err) } @@ -338,26 +337,14 @@ func (r *Relayer) GetWallet(chainID string) (ibc.Wallet, bool) { } address := strings.TrimSpace(res.Stdout.String()) - var chainCfg ibc.ChainConfig var keyName string config := r.sys().MustGetConfig(r.t) for _, v := range config.ProviderConfigs { if c, ok := v.Value.(cosmos.CosmosProviderConfig); ok { if c.ChainID == chainID { keyName = c.Key - chainCfg = ibc.ChainConfig{ - Type: v.Type, - Name: c.ChainName, - ChainID: c.ChainID, - Bech32Prefix: c.AccountPrefix, - GasPrices: c.GasPrices, - GasAdjustment: c.GasAdjustment, - } } } } - - addressBz, err := types.GetFromBech32(address, chainCfg.Bech32Prefix) - require.NoError(r.t, err, "failed to decode bech32 wallet") - return interchaintestcosmos.NewWallet(keyName, addressBz, "", chainCfg), true + return rly.NewWallet(keyName, address, ""), true } diff --git a/interchaintest/relayer_override_test.go b/interchaintest/relayer_override_test.go index 4774ce5a6..2885c21ff 100644 --- a/interchaintest/relayer_override_test.go +++ b/interchaintest/relayer_override_test.go @@ -73,10 +73,11 @@ func TestClientOverrideFlag(t *testing.T) { }) require.NoError(t, ic.Build(ctx, eRep, interchaintest.InterchainBuildOptions{ - TestName: t.Name(), - Client: client, - NetworkID: network, - BlockDatabaseFile: interchaintest.DefaultBlockDatabaseFilepath(), + TestName: t.Name(), + Client: client, + NetworkID: network, + // Uncomment this to load blocks, txs, msgs, and events into sqlite db as test runs + // BlockDatabaseFile: interchaintest.DefaultBlockDatabaseFilepath(), SkipPathCreation: true, })) diff --git a/interchaintest/tendermint_v0.37_boundary_test.go b/interchaintest/tendermint_v0.37_boundary_test.go index 7833eb489..c7972c1ac 100644 --- a/interchaintest/tendermint_v0.37_boundary_test.go +++ b/interchaintest/tendermint_v0.37_boundary_test.go @@ -74,11 +74,12 @@ func TestScenarioTendermint37Boundary(t *testing.T) { rep := testreporter.NewNopReporter() require.NoError(t, ic.Build(ctx, rep.RelayerExecReporter(t), interchaintest.InterchainBuildOptions{ - TestName: t.Name(), - Client: client, - NetworkID: network, - BlockDatabaseFile: interchaintest.DefaultBlockDatabaseFilepath(), - SkipPathCreation: false, + TestName: t.Name(), + Client: client, + NetworkID: network, + // Uncomment this to load blocks, txs, msgs, and events into sqlite db as test runs + // BlockDatabaseFile: interchaintest.DefaultBlockDatabaseFilepath(), + SkipPathCreation: false, })) t.Cleanup(func() { _ = ic.Close() diff --git a/internal/relayertest/system.go b/internal/relayertest/system.go index 0e1641b34..6b917b653 100644 --- a/internal/relayertest/system.go +++ b/internal/relayertest/system.go @@ -15,6 +15,7 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/zap" "go.uber.org/zap/zaptest" + "gopkg.in/yaml.v3" ) // System is a system under test. @@ -129,10 +130,10 @@ func (s *System) MustAddChain(t *testing.T, chainName string, pcw cmd.ProviderCo func (s *System) MustGetConfig(t *testing.T) (config cmd.ConfigInputWrapper) { t.Helper() - configBz, err := os.ReadFile(filepath.Join(s.HomeDir, "config.yaml")) + configBz, err := os.ReadFile(filepath.Join(s.HomeDir, "config", "config.yaml")) require.NoError(t, err, "failed to read config file") - err = json.Unmarshal(configBz, &config) + err = yaml.Unmarshal(configBz, &config) require.NoError(t, err, "failed to unmarshal config file") return config diff --git a/local.Dockerfile b/local.Dockerfile index 9a66c5a6e..42e30e564 100644 --- a/local.Dockerfile +++ b/local.Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.19-alpine3.16 AS build-env +FROM golang:1.20-alpine3.16 AS build-env RUN apk add --update --no-cache curl make git libc-dev bash gcc linux-headers eudev-dev diff --git a/proto/buf.gen.gogo.yaml b/proto/buf.gen.gogo.yaml index fc6e4fc51..b071dd1bb 100644 --- a/proto/buf.gen.gogo.yaml +++ b/proto/buf.gen.gogo.yaml @@ -2,3 +2,7 @@ version: v1 plugins: - name: gocosmos out: . + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + - name: grpc-gateway + out: . + opt: logtostderr=true,allow_colon_final_segments=true diff --git a/proto/buf.gen.penumbra.yaml b/proto/buf.gen.penumbra.yaml new file mode 100644 index 000000000..781eea262 --- /dev/null +++ b/proto/buf.gen.penumbra.yaml @@ -0,0 +1,13 @@ +version: v1 +managed: + enabled: true + go_package_prefix: + default: github.com/cosmos/relayer/v2/relayer/chains + except: + - buf.build/cosmos/ibc + - github.com/cometbft/cometbft + - buf.build/cosmos/cosmos-sdk +plugins: + - name: gocosmos + out: . + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types diff --git a/proto/buf.lock b/proto/buf.lock new file mode 100644 index 000000000..40983632a --- /dev/null +++ b/proto/buf.lock @@ -0,0 +1,31 @@ +# Generated by buf. DO NOT EDIT. +version: v1 +deps: + - remote: buf.build + owner: cosmos + repository: cosmos-proto + commit: 1935555c206d4afb9e94615dfd0fad31 + - remote: buf.build + owner: cosmos + repository: cosmos-sdk + commit: 7c06e7f6f43c406185136100bfd7b848 + - remote: buf.build + owner: cosmos + repository: gogo-proto + commit: 34d970b699f84aa382f3c29773a60836 + - remote: buf.build + owner: cosmos + repository: ibc + commit: 6e966f8dba714d108a52ffabbcb0e5c3 + - remote: buf.build + owner: cosmos + repository: ics23 + commit: 55085f7c710a45f58fa09947208eb70b + - remote: buf.build + owner: googleapis + repository: googleapis + commit: 75b4300737fb4efca0831636be94e517 + - remote: buf.build + owner: penumbra-zone + repository: penumbra + commit: 42619f653f4d470291f3d8b68d7ae7ae diff --git a/proto/buf.yaml b/proto/buf.yaml new file mode 100644 index 000000000..008d82060 --- /dev/null +++ b/proto/buf.yaml @@ -0,0 +1,7 @@ +version: v1 +deps: + - buf.build/penumbra-zone/penumbra + - buf.build/cosmos/cosmos-sdk + - buf.build/cosmos/cosmos-proto + - buf.build/cosmos/gogo-proto + - buf.build/googleapis/googleapis \ No newline at end of file diff --git a/proto/cosmos/crypto/sr25519/keys.proto b/proto/cosmos/crypto/sr25519/keys.proto new file mode 100644 index 000000000..eed481375 --- /dev/null +++ b/proto/cosmos/crypto/sr25519/keys.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +// buf:lint:ignore PACKAGE_VERSION_SUFFIX +package cosmos.crypto.sr25519; + +import "gogoproto/gogo.proto"; + +// Originally github.com/cosmos/cosmos-sdk/crypto/keys/sr25519 +option go_package = "github.com/cosmos/relayer/v2/relayer/chains/cosmos/keys/sr25519"; + +option (gogoproto.messagename_all) = true; +option (gogoproto.goproto_stringer_all) = false; +option (gogoproto.goproto_getters_all) = false; + +// PubKey defines a sr25519 ECDSA public key. +message PubKey { + option (gogoproto.goproto_stringer) = false; + + bytes key = 1 [(gogoproto.casttype) = "github.com/cometbft/cometbft/crypto/sr25519.PubKey"]; +} diff --git a/relayer/chain.go b/relayer/chain.go index a5652e7c7..bb0195fb8 100644 --- a/relayer/chain.go +++ b/relayer/chain.go @@ -8,6 +8,7 @@ import ( "time" "github.com/avast/retry-go/v4" + "github.com/cosmos/cosmos-sdk/crypto/hd" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" "github.com/cosmos/relayer/v2/relayer/provider" "go.uber.org/zap" @@ -20,6 +21,7 @@ var ( RtyErr = retry.LastErrorOnly(true) defaultCoinType uint32 = 118 + defaultAlgo string = string(hd.Secp256k1Type) ) // Chain represents the necessary data for connecting to and identifying a chain and its counterparties @@ -147,7 +149,7 @@ func (c *Chain) CreateTestKey() error { if c.ChainProvider.KeyExists(c.ChainProvider.Key()) { return fmt.Errorf("key {%s} exists for chain {%s}", c.ChainProvider.Key(), c.ChainID()) } - _, err := c.ChainProvider.AddKey(c.ChainProvider.Key(), defaultCoinType) + _, err := c.ChainProvider.AddKey(c.ChainProvider.Key(), defaultCoinType, defaultAlgo) return err } diff --git a/relayer/chains/archway/helper_debug_msg.go b/relayer/chains/archway/helper_debug_msg.go index 953a8fb12..6b56179de 100644 --- a/relayer/chains/archway/helper_debug_msg.go +++ b/relayer/chains/archway/helper_debug_msg.go @@ -29,7 +29,6 @@ func jsonDumpDataFile(filename string, bufs interface{}) { os.Exit(1) } - fmt.Printf("Successfully created or appended JSON in %s \n", filename) } func readExistingData(filename string, opPointer interface{}) error { diff --git a/relayer/chains/archway/keys.go b/relayer/chains/archway/keys.go index 0bb844d6c..061a6434c 100644 --- a/relayer/chains/archway/keys.go +++ b/relayer/chains/archway/keys.go @@ -58,8 +58,8 @@ func (cc *ArchwayProvider) KeystoreCreated(path string) bool { // AddKey generates a new mnemonic which is then converted to a private key and BIP-39 HD Path and persists it to the keystore. // It fails if there is an existing key with the same address. -func (cc *ArchwayProvider) AddKey(name string, coinType uint32) (output *provider.KeyOutput, err error) { - ko, err := cc.KeyAddOrRestore(name, coinType) +func (cc *ArchwayProvider) AddKey(name string, coinType uint32, signingAlgorithm string) (output *provider.KeyOutput, err error) { + ko, err := cc.KeyAddOrRestore(name, coinType, signingAlgorithm) if err != nil { return nil, err } @@ -68,7 +68,7 @@ func (cc *ArchwayProvider) AddKey(name string, coinType uint32) (output *provide // RestoreKey converts a mnemonic to a private key and BIP-39 HD Path and persists it to the keystore. // It fails if there is an existing key with the same address. -func (cc *ArchwayProvider) RestoreKey(name, mnemonic string, coinType uint32) (address string, err error) { +func (cc *ArchwayProvider) RestoreKey(name, mnemonic string, coinType uint32, signingAlgorithm string) (address string, err error) { ko, err := cc.KeyAddOrRestore(name, coinType, mnemonic) if err != nil { return "", err diff --git a/relayer/chains/archway/provider.go b/relayer/chains/archway/provider.go index d37894f03..c4faf750a 100644 --- a/relayer/chains/archway/provider.go +++ b/relayer/chains/archway/provider.go @@ -191,11 +191,6 @@ func (pp *ArchwayProviderConfig) Validate() error { return nil } -func (pp *ArchwayProviderConfig) Set(field string, value interface{}) error { - // TODO: implement - return nil -} - func (pp *ArchwayProviderConfig) getRPCAddr() string { return pp.RPCAddr } @@ -452,6 +447,10 @@ func (ap *ArchwayProvider) updateNextAccountSequence(seq uint64) { } } +func (app *ArchwayProvider) MsgRegisterCounterpartyPayee(portID, channelID, relayerAddr, counterpartyPayeeAddr string) (provider.RelayerMessage, error) { + return nil, fmt.Errorf("Not implemented for Icon") +} + // keysDir returns a string representing the path on the local filesystem where the keystore will be initialized. func keysDir(home, chainID string) string { return path.Join(home, "keys", chainID) diff --git a/relayer/chains/archway/query.go b/relayer/chains/archway/query.go index 9aacf27e4..e6185c103 100644 --- a/relayer/chains/archway/query.go +++ b/relayer/chains/archway/query.go @@ -765,7 +765,7 @@ func (ap *ArchwayProvider) QueryPacketReceipt(ctx context.Context, height int64, } pktReceipt, err := ap.QueryIBCHandlerContract(ctx, pktReceiptParams) - if err != nil && !strings.Contains(err.Error(), "PacketCommitmentNotFound") { + if err != nil && !strings.Contains(err.Error(), "PacketReceiptNotFound") { return nil, err } diff --git a/relayer/chains/archway/tx.go b/relayer/chains/archway/tx.go index 0b1895774..bf09b55d5 100644 --- a/relayer/chains/archway/tx.go +++ b/relayer/chains/archway/tx.go @@ -763,6 +763,9 @@ func (ap *ArchwayProvider) SendMessagesToMempool( ap.BroadcastTx(cliCtx, txBytes, []provider.RelayerMessage{msg}, asyncCtx, defaultBroadcastWaitTimeout, asyncCallback, false) } + //uncomment for saving msg + SaveMsgToFile(ArchwayDebugMessagePath, msgs) + return nil } @@ -1004,6 +1007,8 @@ func (ap *ArchwayProvider) BroadcastTx( ap.log.Info("Submitted transaction", zap.String("chain_id", ap.PCfg.ChainID), zap.String("txHash", res.TxHash), + zap.Int64("Height", res.Height), + zap.Any("Methods called", msgTypesField(msgs)), ) if shouldWait { @@ -1046,9 +1051,6 @@ func (ap *ArchwayProvider) waitForTx( return } - //uncomment for saving msg - SaveMsgToFile(ArchwayDebugMessagePath, msgs) - rlyResp := &provider.RelayerTxResponse{ Height: res.Height, TxHash: res.TxHash, diff --git a/relayer/chains/cosmos/codec.go b/relayer/chains/cosmos/codec.go index 38f6d3d72..bfeb42425 100644 --- a/relayer/chains/cosmos/codec.go +++ b/relayer/chains/cosmos/codec.go @@ -11,7 +11,6 @@ import ( authz "github.com/cosmos/cosmos-sdk/x/authz/module" "github.com/cosmos/cosmos-sdk/x/bank" "github.com/cosmos/cosmos-sdk/x/capability" - "github.com/cosmos/cosmos-sdk/x/crisis" "github.com/cosmos/cosmos-sdk/x/distribution" feegrant "github.com/cosmos/cosmos-sdk/x/feegrant/module" "github.com/cosmos/cosmos-sdk/x/gov" @@ -21,8 +20,8 @@ import ( paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" "github.com/cosmos/cosmos-sdk/x/slashing" "github.com/cosmos/cosmos-sdk/x/staking" - "github.com/cosmos/cosmos-sdk/x/upgrade" upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" + ibcfee "github.com/cosmos/ibc-go/v7/modules/apps/29-fee" "github.com/cosmos/ibc-go/v7/modules/apps/transfer" ibc "github.com/cosmos/ibc-go/v7/modules/core" @@ -46,18 +45,19 @@ var ModuleBasics = []module.AppModuleBasic{ upgradeclient.LegacyCancelProposalHandler, }, ), - crisis.AppModuleBasic{}, + // crisis.AppModuleBasic{}, distribution.AppModuleBasic{}, feegrant.AppModuleBasic{}, mint.AppModuleBasic{}, params.AppModuleBasic{}, slashing.AppModuleBasic{}, staking.AppModuleBasic{}, - upgrade.AppModuleBasic{}, + // upgrade.AppModuleBasic{}, transfer.AppModuleBasic{}, ibc.AppModuleBasic{}, cosmosmodule.AppModuleBasic{}, stride.AppModuleBasic{}, + ibcfee.AppModuleBasic{}, } type Codec struct { diff --git a/relayer/chains/cosmos/cosmos_chain_processor.go b/relayer/chains/cosmos/cosmos_chain_processor.go index bf594165b..6a428d55c 100644 --- a/relayer/chains/cosmos/cosmos_chain_processor.go +++ b/relayer/chains/cosmos/cosmos_chain_processor.go @@ -77,6 +77,7 @@ const ( defaultMinQueryLoopDuration = 1 * time.Second defaultBalanceUpdateWaitDuration = 60 * time.Second inSyncNumBlocksThreshold = 2 + blockMaxRetries = 5 ) // latestClientState is a map of clientID to the latest clientInfo for that client. @@ -180,20 +181,26 @@ func (ccp *CosmosChainProcessor) clientState(ctx context.Context, clientID strin // queryCyclePersistence hold the variables that should be retained across queryCycles. type queryCyclePersistence struct { - latestHeight int64 - latestQueriedBlock int64 - minQueryLoopDuration time.Duration - lastBalanceUpdate time.Time - balanceUpdateWaitDuration time.Duration + latestHeight int64 + latestQueriedBlock int64 + retriesAtLatestQueriedBlock int + minQueryLoopDuration time.Duration + lastBalanceUpdate time.Time + balanceUpdateWaitDuration time.Duration } // Run starts the query loop for the chain which will gather applicable ibc messages and push events out to the relevant PathProcessors. // The initialBlockHistory parameter determines how many historical blocks should be fetched and processed before continuing with current blocks. // ChainProcessors should obey the context and return upon context cancellation. func (ccp *CosmosChainProcessor) Run(ctx context.Context, initialBlockHistory uint64) error { + minQueryLoopDuration := ccp.chainProvider.PCfg.MinLoopDuration + if minQueryLoopDuration == 0 { + minQueryLoopDuration = defaultMinQueryLoopDuration + } + // this will be used for persistence across query cycle loop executions persistence := queryCyclePersistence{ - minQueryLoopDuration: defaultMinQueryLoopDuration, + minQueryLoopDuration: minQueryLoopDuration, lastBalanceUpdate: time.Unix(0, 0), balanceUpdateWaitDuration: defaultBalanceUpdateWaitDuration, } @@ -318,9 +325,10 @@ func (ccp *CosmosChainProcessor) queryCycle(ctx context.Context, persistence *qu persistence.latestHeight = status.SyncInfo.LatestBlockHeight ccp.chainProvider.setCometVersion(ccp.log, status.NodeInfo.Version) - ccp.log.Debug("Queried latest height", - zap.Int64("latest_height", persistence.latestHeight), - ) + // This debug log is very noisy, but is helpful when debugging new chains. + // ccp.log.Debug("Queried latest height", + // zap.Int64("latest_height", persistence.latestHeight), + // ) if ccp.metrics != nil { ccp.CollectMetrics(ctx, persistence) @@ -373,10 +381,32 @@ func (ccp *CosmosChainProcessor) queryCycle(ctx context.Context, persistence *qu }) if err := eg.Wait(); err != nil { - ccp.log.Warn("Error querying block data", zap.Error(err)) + ccp.log.Warn( + "Could not query block data. Consider checking if your RPC node is online, and that transaction indexing is enabled.", + zap.Int64("height", i), + ) + ccp.log.Debug("Error querying block data", zap.Error(err)) + + persistence.retriesAtLatestQueriedBlock++ + if persistence.retriesAtLatestQueriedBlock >= blockMaxRetries { + ccp.log.Warn("Reached max retries querying for block, skipping", zap.Int64("height", i)) + // skip this block. now depends on flush to pickup anything missed in the block. + persistence.latestQueriedBlock = i + persistence.retriesAtLatestQueriedBlock = 0 + continue + } break } + ccp.log.Debug( + "Queried block", + zap.Int64("height", i), + zap.Int64("latest", persistence.latestHeight), + zap.Int64("delta", persistence.latestHeight-i), + ) + + persistence.retriesAtLatestQueriedBlock = 0 + latestHeader = ibcHeader.(provider.TendermintIBCHeader) heightUint64 := uint64(i) @@ -486,22 +516,25 @@ func (ccp *CosmosChainProcessor) CurrentRelayerBalance(ctx context.Context) { } // Get the balance for the chain provider's key - relayerWalletBalance, err := ccp.chainProvider.QueryBalance(ctx, ccp.chainProvider.Key()) + relayerWalletBalances, err := ccp.chainProvider.QueryBalance(ctx, ccp.chainProvider.Key()) if err != nil { ccp.log.Error( "Failed to query relayer balance", zap.Error(err), ) } - + address, err := ccp.chainProvider.Address() + if err != nil { + ccp.log.Error( + "Failed to get relayer bech32 wallet addresss", + zap.Error(err), + ) + } // Print the relevant gas prices for _, gasDenom := range *ccp.parsedGasPrices { - for _, balance := range relayerWalletBalance { - if balance.Denom == gasDenom.Denom { - // Convert to a big float to get a float64 for metrics - f, _ := big.NewFloat(0.0).SetInt(balance.Amount.BigInt()).Float64() - ccp.metrics.SetWalletBalance(ccp.chainProvider.ChainId(), ccp.chainProvider.Key(), balance.Denom, f) - } - } + bal := relayerWalletBalances.AmountOf(gasDenom.Denom) + // Convert to a big float to get a float64 for metrics + f, _ := big.NewFloat(0.0).SetInt(bal.BigInt()).Float64() + ccp.metrics.SetWalletBalance(ccp.chainProvider.ChainId(), ccp.chainProvider.Key(), address, gasDenom.Denom, f) } } diff --git a/relayer/chains/cosmos/keys.go b/relayer/chains/cosmos/keys.go index 272c96b30..0ccdd0938 100644 --- a/relayer/chains/cosmos/keys.go +++ b/relayer/chains/cosmos/keys.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/go-bip39" + "github.com/cosmos/relayer/v2/relayer/chains/cosmos/keys/sr25519" "github.com/cosmos/relayer/v2/relayer/codecs/ethermint" "github.com/cosmos/relayer/v2/relayer/codecs/injective" "github.com/cosmos/relayer/v2/relayer/provider" @@ -19,12 +20,14 @@ const ethereumCoinType = uint32(60) var ( // SupportedAlgorithms defines the list of signing algorithms used on Evmos: // - secp256k1 (Cosmos) - // - eth_secp256k1 (Ethereum) - SupportedAlgorithms = keyring.SigningAlgoList{hd.Secp256k1, ethermint.EthSecp256k1, injective.EthSecp256k1} + // - sr25519 (Cosmos) + // - eth_secp256k1 (Ethereum, Injective) + SupportedAlgorithms = keyring.SigningAlgoList{hd.Secp256k1, sr25519.Sr25519, ethermint.EthSecp256k1, injective.EthSecp256k1} // SupportedAlgorithmsLedger defines the list of signing algorithms used on Evmos for the Ledger device: // - secp256k1 (Cosmos) - // - eth_secp256k1 (Ethereum) - SupportedAlgorithmsLedger = keyring.SigningAlgoList{hd.Secp256k1, ethermint.EthSecp256k1, injective.EthSecp256k1} + // - sr25519 (Cosmos) + // - eth_secp256k1 (Ethereum, Injective) + SupportedAlgorithmsLedger = keyring.SigningAlgoList{hd.Secp256k1, sr25519.Sr25519, ethermint.EthSecp256k1, injective.EthSecp256k1} ) // KeyringAlgoOptions defines a function keys options for the ethereum Secp256k1 curve. @@ -58,8 +61,8 @@ func (cc *CosmosProvider) KeystoreCreated(path string) bool { // AddKey generates a new mnemonic which is then converted to a private key and BIP-39 HD Path and persists it to the keystore. // It fails if there is an existing key with the same address. -func (cc *CosmosProvider) AddKey(name string, coinType uint32) (output *provider.KeyOutput, err error) { - ko, err := cc.KeyAddOrRestore(name, coinType) +func (cc *CosmosProvider) AddKey(name string, coinType uint32, signingAlgorithm string) (output *provider.KeyOutput, err error) { + ko, err := cc.KeyAddOrRestore(name, coinType, signingAlgorithm) if err != nil { return nil, err } @@ -68,8 +71,8 @@ func (cc *CosmosProvider) AddKey(name string, coinType uint32) (output *provider // RestoreKey converts a mnemonic to a private key and BIP-39 HD Path and persists it to the keystore. // It fails if there is an existing key with the same address. -func (cc *CosmosProvider) RestoreKey(name, mnemonic string, coinType uint32) (address string, err error) { - ko, err := cc.KeyAddOrRestore(name, coinType, mnemonic) +func (cc *CosmosProvider) RestoreKey(name, mnemonic string, coinType uint32, signingAlgorithm string) (address string, err error) { + ko, err := cc.KeyAddOrRestore(name, coinType, signingAlgorithm, mnemonic) if err != nil { return "", err } @@ -78,10 +81,17 @@ func (cc *CosmosProvider) RestoreKey(name, mnemonic string, coinType uint32) (ad // KeyAddOrRestore either generates a new mnemonic or uses the specified mnemonic and converts it to a private key // and BIP-39 HD Path which is then persisted to the keystore. It fails if there is an existing key with the same address. -func (cc *CosmosProvider) KeyAddOrRestore(keyName string, coinType uint32, mnemonic ...string) (*provider.KeyOutput, error) { +func (cc *CosmosProvider) KeyAddOrRestore(keyName string, coinType uint32, signingAlgorithm string, mnemonic ...string) (*provider.KeyOutput, error) { var mnemonicStr string var err error - algo := keyring.SignatureAlgo(hd.Secp256k1) + + var algo keyring.SignatureAlgo + switch signingAlgorithm { + case string(hd.Sr25519Type): + algo = sr25519.Sr25519 + default: + algo = hd.Secp256k1 + } if len(mnemonic) > 0 { mnemonicStr = mnemonic[0] diff --git a/relayer/chains/cosmos/keys/sr25519/algo.go b/relayer/chains/cosmos/keys/sr25519/algo.go new file mode 100644 index 000000000..d0c0eca96 --- /dev/null +++ b/relayer/chains/cosmos/keys/sr25519/algo.go @@ -0,0 +1,46 @@ +package sr25519 + +import ( + bip39 "github.com/cosmos/go-bip39" + + tmsr25519 "github.com/cometbft/cometbft/crypto/sr25519" + "github.com/cosmos/cosmos-sdk/crypto/hd" + "github.com/cosmos/cosmos-sdk/crypto/types" +) + +var Sr25519 = sr25519Algo{} + +type sr25519Algo struct { +} + +func (s sr25519Algo) Name() hd.PubKeyType { + return hd.Sr25519Type +} + +// Derive derives and returns the sr25519 private key for the given seed and HD path. +func (s sr25519Algo) Derive() hd.DeriveFn { + return func(mnemonic string, bip39Passphrase, hdPath string) ([]byte, error) { + seed, err := bip39.NewSeedWithErrorChecking(mnemonic, bip39Passphrase) + if err != nil { + return nil, err + } + + masterPriv, ch := hd.ComputeMastersFromSeed(seed) + if len(hdPath) == 0 { + return masterPriv[:], nil + } + derivedKey, err := hd.DerivePrivateKeyForPath(masterPriv, ch, hdPath) + + return derivedKey, err + } +} + +// Generate generates a sr25519 private key from the given bytes. +func (s sr25519Algo) Generate() hd.GenerateFn { + return func(bz []byte) types.PrivKey { + var bzArr = make([]byte, 32) + copy(bzArr, bz) + + return &PrivKey{PrivKey: tmsr25519.GenPrivKeyFromSecret(bzArr)} + } +} diff --git a/relayer/chains/cosmos/keys/sr25519/keys.pb.go b/relayer/chains/cosmos/keys/sr25519/keys.pb.go new file mode 100644 index 000000000..49a3599b7 --- /dev/null +++ b/relayer/chains/cosmos/keys/sr25519/keys.pb.go @@ -0,0 +1,320 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/crypto/sr25519/keys.proto + +// buf:lint:ignore PACKAGE_VERSION_SUFFIX + +package sr25519 + +import ( + fmt "fmt" + github_com_cometbft_cometbft_crypto_sr25519 "github.com/cometbft/cometbft/crypto/sr25519" + proto "github.com/cosmos/gogoproto/proto" + _ "github.com/gogo/protobuf/gogoproto" + 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 + +// PubKey defines a sr25519 ECDSA public key. +type PubKey struct { + Key github_com_cometbft_cometbft_crypto_sr25519.PubKey `protobuf:"bytes,1,opt,name=key,proto3,casttype=github.com/cometbft/cometbft/crypto/sr25519.PubKey" json:"key,omitempty"` +} + +func (m *PubKey) Reset() { *m = PubKey{} } +func (*PubKey) ProtoMessage() {} +func (*PubKey) Descriptor() ([]byte, []int) { + return fileDescriptor_daddabaf35039fbd, []int{0} +} +func (m *PubKey) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PubKey.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 *PubKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_PubKey.Merge(m, src) +} +func (m *PubKey) XXX_Size() int { + return m.Size() +} +func (m *PubKey) XXX_DiscardUnknown() { + xxx_messageInfo_PubKey.DiscardUnknown(m) +} + +var xxx_messageInfo_PubKey proto.InternalMessageInfo + +func (*PubKey) XXX_MessageName() string { + return "cosmos.crypto.sr25519.PubKey" +} +func init() { + proto.RegisterType((*PubKey)(nil), "cosmos.crypto.sr25519.PubKey") +} + +func init() { proto.RegisterFile("cosmos/crypto/sr25519/keys.proto", fileDescriptor_daddabaf35039fbd) } + +var fileDescriptor_daddabaf35039fbd = []byte{ + // 222 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x2e, 0xaa, 0x2c, 0x28, 0xc9, 0xd7, 0x2f, 0x2e, 0x32, 0x32, 0x35, 0x35, + 0xb4, 0xd4, 0xcf, 0x4e, 0xad, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x85, 0xa8, + 0xd0, 0x83, 0xa8, 0xd0, 0x83, 0xaa, 0x90, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab, 0xd0, 0x07, + 0xb1, 0x20, 0x8a, 0x95, 0x22, 0xb8, 0xd8, 0x02, 0x4a, 0x93, 0xbc, 0x53, 0x2b, 0x85, 0x3c, 0xb8, + 0x98, 0xb3, 0x53, 0x2b, 0x25, 0x18, 0x15, 0x18, 0x35, 0x78, 0x9c, 0xcc, 0x7e, 0xdd, 0x93, 0x37, + 0x4a, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x4d, 0x2d, + 0x49, 0x4a, 0x2b, 0x41, 0x62, 0xa0, 0xd8, 0xaf, 0x07, 0x31, 0x24, 0x08, 0x64, 0x84, 0x15, 0xcb, + 0x8c, 0x05, 0xf2, 0x0c, 0x4e, 0xa9, 0x27, 0x1e, 0xca, 0x31, 0xdc, 0x78, 0x28, 0xc7, 0x70, 0xe2, + 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, + 0xe2, 0xb1, 0x1c, 0xe3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xd9, 0xa3, 0x58, + 0x02, 0xf6, 0x59, 0x51, 0x6a, 0x4e, 0x62, 0x65, 0x6a, 0x91, 0x7e, 0x99, 0x11, 0x9c, 0x99, 0x9c, + 0x91, 0x98, 0x99, 0x57, 0x0c, 0x53, 0x00, 0xf2, 0x2b, 0xcc, 0xe2, 0x24, 0x36, 0xb0, 0x3f, 0x8c, + 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x24, 0xfd, 0x40, 0x0e, 0x18, 0x01, 0x00, 0x00, +} + +func (m *PubKey) 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 *PubKey) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PubKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintKeys(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintKeys(dAtA []byte, offset int, v uint64) int { + offset -= sovKeys(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *PubKey) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovKeys(uint64(l)) + } + return n +} + +func sovKeys(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozKeys(x uint64) (n int) { + return sovKeys(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *PubKey) 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 ErrIntOverflowKeys + } + 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: PubKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PubKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKeys + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthKeys + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthKeys + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipKeys(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthKeys + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipKeys(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, ErrIntOverflowKeys + } + 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, ErrIntOverflowKeys + } + 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, ErrIntOverflowKeys + } + 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, ErrInvalidLengthKeys + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupKeys + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthKeys + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthKeys = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowKeys = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupKeys = fmt.Errorf("proto: unexpected end of group") +) diff --git a/relayer/chains/cosmos/keys/sr25519/privkey.go b/relayer/chains/cosmos/keys/sr25519/privkey.go new file mode 100644 index 000000000..b7b6efae3 --- /dev/null +++ b/relayer/chains/cosmos/keys/sr25519/privkey.go @@ -0,0 +1,47 @@ +package sr25519 + +import ( + tmsr25519 "github.com/cometbft/cometbft/crypto/sr25519" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" +) + +const ( + PrivKeySize = 32 + PrivKeyName = "tendermint/PrivKeySr25519" +) + +type PrivKey struct { + tmsr25519.PrivKey +} + +// type conversion +func (m *PrivKey) PubKey() cryptotypes.PubKey { + pk, ok := m.PrivKey.PubKey().(tmsr25519.PubKey) + if !ok { + panic("invalid public key type for sr25519 private key") + } + return &PubKey{Key: pk} +} + +// type conversion +func (m *PrivKey) Equals(other cryptotypes.LedgerPrivKey) bool { + sk2, ok := other.(*PrivKey) + if !ok { + return false + } + return m.PrivKey.Equals(sk2.PrivKey) +} + +func (m *PrivKey) ProtoMessage() {} + +func (m *PrivKey) Reset() { + m.PrivKey = tmsr25519.PrivKey{} +} + +func (m *PrivKey) String() string { + return string(m.Bytes()) +} + +func GenPrivKey() *PrivKey { + return &PrivKey{tmsr25519.GenPrivKey()} +} diff --git a/relayer/chains/cosmos/keys/sr25519/pubkey.go b/relayer/chains/cosmos/keys/sr25519/pubkey.go new file mode 100644 index 000000000..6325f9960 --- /dev/null +++ b/relayer/chains/cosmos/keys/sr25519/pubkey.go @@ -0,0 +1,38 @@ +package sr25519 + +import ( + "bytes" + + "github.com/cometbft/cometbft/crypto" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" +) + +const PubKeyName = "tendermint/PubKeySr25519" + +func (m *PubKey) Equals(other cryptotypes.PubKey) bool { + pk2, ok := other.(*PubKey) + if !ok { + return false + } + return bytes.Equal(m.Key, pk2.Key) +} + +func (m *PubKey) Address() crypto.Address { + return m.Key.Address() +} + +func (m PubKey) Bytes() []byte { + return m.Key.Bytes() +} + +func (m PubKey) String() string { + return m.Key.String() +} + +func (m PubKey) Type() string { + return "sr25519" +} + +func (m PubKey) VerifySignature(msg []byte, sigBytes []byte) bool { + return m.Key.VerifySignature(msg, sigBytes) +} diff --git a/relayer/chains/cosmos/keys_test.go b/relayer/chains/cosmos/keys_test.go new file mode 100644 index 000000000..987931041 --- /dev/null +++ b/relayer/chains/cosmos/keys_test.go @@ -0,0 +1,104 @@ +package cosmos_test + +import ( + "path/filepath" + "testing" + + "github.com/cosmos/relayer/v2/relayer/chains/cosmos" + "github.com/cosmos/relayer/v2/relayer/provider" + "github.com/stretchr/testify/require" + "go.uber.org/zap" +) + +func testProviderWithKeystore(t *testing.T, accountPrefix string, extraCodecs []string) provider.ChainProvider { + homePath := t.TempDir() + cfg := cosmos.CosmosProviderConfig{ + ChainID: "test", + KeyDirectory: filepath.Join(homePath, "keys"), + KeyringBackend: "test", + Timeout: "10s", + AccountPrefix: accountPrefix, + ExtraCodecs: extraCodecs, + } + p, err := cfg.NewProvider(zap.NewNop(), homePath, true, "test_chain") + if err != nil { + t.Fatalf("Error creating provider: %v", err) + } + err = p.CreateKeystore(homePath) + if err != nil { + t.Fatalf("Error creating keystore: %v", err) + } + return p +} + +// TestKeyRestore restores a test mnemonic +func TestKeyRestore(t *testing.T) { + const ( + keyName = "test_key" + signatureAlgorithm = "secp256k1" + mnemonic = "blind master acoustic speak victory lend kiss grab glad help demand hood roast zone lend sponsor level cheap truck kingdom apology token hover reunion" + accountPrefix = "cosmos" + expectedAddress = "cosmos15cw268ckjj2hgq8q3jf68slwjjcjlvxy57je2u" + coinType = uint32(118) + ) + + p := testProviderWithKeystore(t, accountPrefix, nil) + + address, err := p.RestoreKey(keyName, mnemonic, coinType, signatureAlgorithm) + require.NoError(t, err) + require.Equal(t, expectedAddress, address) +} + +// TestKeyRestoreEth restores a test mnemonic +func TestKeyRestoreEth(t *testing.T) { + const ( + keyName = "test_key" + signatureAlgorithm = "secp256k1" + mnemonic = "three elevator silk family street child flip also leaf inmate call frame shock little legal october vivid enable fetch siege sell burger dolphin green" + accountPrefix = "evmos" + expectedAddress = "evmos1dea7vlekr9e34vugwkvesulglt8fx4e457vk9z" + coinType = uint32(60) + ) + + p := testProviderWithKeystore(t, accountPrefix, []string{"ethermint"}) + + address, err := p.RestoreKey(keyName, mnemonic, coinType, signatureAlgorithm) + require.NoError(t, err) + require.Equal(t, expectedAddress, address) +} + +// TestKeyRestoreInj restores a test mnemonic +func TestKeyRestoreInj(t *testing.T) { + const ( + keyName = "inj_key" + signatureAlgorithm = "secp256k1" + mnemonic = "three elevator silk family street child flip also leaf inmate call frame shock little legal october vivid enable fetch siege sell burger dolphin green" + accountPrefix = "inj" + expectedAddress = "inj1dea7vlekr9e34vugwkvesulglt8fx4e4uk2udj" + coinType = uint32(60) + ) + + p := testProviderWithKeystore(t, accountPrefix, []string{"injective"}) + + address, err := p.RestoreKey(keyName, mnemonic, coinType, signatureAlgorithm) + require.NoError(t, err) + require.Equal(t, expectedAddress, address) +} + +// TestKeyRestoreSr25519 restores a test mnemonic +func TestKeyRestoreSr25519(t *testing.T) { + const ( + keyName = "sei_key" + signatureAlgorithm = "sr25519" + mnemonic = "three elevator silk family street child flip also leaf inmate call frame shock little legal october vivid enable fetch siege sell burger dolphin green" + accountPrefix = "sei" + expectedAddress = "sei1nmlj0guznnt0qyfj4yl6q5g4xuvgly4qw0w026" + coinType = uint32(118) + ) + + p := testProviderWithKeystore(t, accountPrefix, nil) + + address, err := p.RestoreKey(keyName, mnemonic, coinType, signatureAlgorithm) + require.NoError(t, err) + require.Equal(t, expectedAddress, address) +} diff --git a/relayer/chains/cosmos/message_handlers.go b/relayer/chains/cosmos/message_handlers.go index f9a9bd0f9..1e6a811c0 100644 --- a/relayer/chains/cosmos/message_handlers.go +++ b/relayer/chains/cosmos/message_handlers.go @@ -86,6 +86,7 @@ func (ccp *CosmosChainProcessor) handleChannelMessage(eventType string, ci provi ccp.channelStateCache[channelKey] = false case chantypes.EventTypeChannelOpenAck, chantypes.EventTypeChannelOpenConfirm: ccp.channelStateCache[channelKey] = true + ccp.logChannelOpenMessage(eventType, ci) case chantypes.EventTypeChannelCloseConfirm: for k := range ccp.channelStateCache { if k.PortID == ci.PortID && k.ChannelID == ci.ChannelID { @@ -182,6 +183,16 @@ func (ccp *CosmosChainProcessor) logChannelMessage(message string, ci provider.C ) } +func (ccp *CosmosChainProcessor) logChannelOpenMessage(message string, ci provider.ChannelInfo) { + fields := []zap.Field{ + + zap.String("channel_id", ci.ChannelID), + zap.String("connection_id", ci.ConnID), + zap.String("port_id", ci.PortID), + } + ccp.log.Info("Successfully created new channel", fields...) +} + func (ccp *CosmosChainProcessor) logConnectionMessage(message string, ci provider.ConnectionInfo) { ccp.logObservedIBCMessage(message, zap.String("client_id", ci.ClientID), diff --git a/relayer/chains/cosmos/module/app_module.go b/relayer/chains/cosmos/module/app_module.go index 94119092a..6a2d45f15 100644 --- a/relayer/chains/cosmos/module/app_module.go +++ b/relayer/chains/cosmos/module/app_module.go @@ -26,7 +26,6 @@ func (AppModuleBasic) RegisterLegacyAminoCodec(*codec.LegacyAmino) {} func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { tmlightclient.RegisterInterfaces(registry) solomachine.RegisterInterfaces(registry) - // TODO: add the localhost light client when ibc-go v7.1.0 is available } // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the ibc module. diff --git a/relayer/chains/cosmos/msg.go b/relayer/chains/cosmos/msg.go index 9f994032a..f685768ac 100644 --- a/relayer/chains/cosmos/msg.go +++ b/relayer/chains/cosmos/msg.go @@ -8,7 +8,6 @@ import ( "go.uber.org/zap/zapcore" ) -var _ provider.RelayerMessage = &CosmosMessage{} type CosmosMessage struct { Msg sdk.Msg diff --git a/relayer/chains/cosmos/provider.go b/relayer/chains/cosmos/provider.go index aa8374921..4fbea4d0e 100644 --- a/relayer/chains/cosmos/provider.go +++ b/relayer/chains/cosmos/provider.go @@ -35,25 +35,28 @@ var ( const cometEncodingThreshold = "v0.37.0-alpha" type CosmosProviderConfig struct { - KeyDirectory string `json:"key-directory" yaml:"key-directory"` - Key string `json:"key" yaml:"key"` - ChainName string `json:"-" yaml:"-"` - ChainID string `json:"chain-id" yaml:"chain-id"` - RPCAddr string `json:"rpc-addr" yaml:"rpc-addr"` - AccountPrefix string `json:"account-prefix" yaml:"account-prefix"` - KeyringBackend string `json:"keyring-backend" yaml:"keyring-backend"` - GasAdjustment float64 `json:"gas-adjustment" yaml:"gas-adjustment"` - GasPrices string `json:"gas-prices" yaml:"gas-prices"` - MinGasAmount uint64 `json:"min-gas-amount" yaml:"min-gas-amount"` - Debug bool `json:"debug" yaml:"debug"` - Timeout string `json:"timeout" yaml:"timeout"` - BlockTimeout string `json:"block-timeout" yaml:"block-timeout"` - OutputFormat string `json:"output-format" yaml:"output-format"` - SignModeStr string `json:"sign-mode" yaml:"sign-mode"` - ExtraCodecs []string `json:"extra-codecs" yaml:"extra-codecs"` - Modules []module.AppModuleBasic `json:"-" yaml:"-"` - Slip44 int `json:"coin-type" yaml:"coin-type"` - Broadcast provider.BroadcastMode `json:"broadcast-mode" yaml:"broadcast-mode"` + KeyDirectory string `json:"key-directory" yaml:"key-directory"` + Key string `json:"key" yaml:"key"` + ChainName string `json:"-" yaml:"-"` + ChainID string `json:"chain-id" yaml:"chain-id"` + RPCAddr string `json:"rpc-addr" yaml:"rpc-addr"` + AccountPrefix string `json:"account-prefix" yaml:"account-prefix"` + KeyringBackend string `json:"keyring-backend" yaml:"keyring-backend"` + GasAdjustment float64 `json:"gas-adjustment" yaml:"gas-adjustment"` + GasPrices string `json:"gas-prices" yaml:"gas-prices"` + MinGasAmount uint64 `json:"min-gas-amount" yaml:"min-gas-amount"` + MaxGasAmount uint64 `json:"max-gas-amount" yaml:"max-gas-amount"` + Debug bool `json:"debug" yaml:"debug"` + Timeout string `json:"timeout" yaml:"timeout"` + BlockTimeout string `json:"block-timeout" yaml:"block-timeout"` + OutputFormat string `json:"output-format" yaml:"output-format"` + SignModeStr string `json:"sign-mode" yaml:"sign-mode"` + ExtraCodecs []string `json:"extra-codecs" yaml:"extra-codecs"` + Modules []module.AppModuleBasic `json:"-" yaml:"-"` + Slip44 *int `json:"coin-type" yaml:"coin-type"` + SigningAlgorithm string `json:"signing-algorithm" yaml:"signing-algorithm"` + Broadcast provider.BroadcastMode `json:"broadcast-mode" yaml:"broadcast-mode"` + MinLoopDuration time.Duration `json:"min-loop-duration" yaml:"min-loop-duration"` } func (pc CosmosProviderConfig) Validate() error { @@ -63,11 +66,6 @@ func (pc CosmosProviderConfig) Validate() error { return nil } -func (pc CosmosProviderConfig) Set(field string, value interface{}) error { - // TODO: - return nil -} - func (pc CosmosProviderConfig) BroadcastMode() provider.BroadcastMode { return pc.Broadcast } diff --git a/relayer/chains/cosmos/query.go b/relayer/chains/cosmos/query.go index c4690f6b3..6e438727f 100644 --- a/relayer/chains/cosmos/query.go +++ b/relayer/chains/cosmos/query.go @@ -8,6 +8,7 @@ import ( "fmt" "strconv" "strings" + "sync" "time" abci "github.com/cometbft/cometbft/abci/types" @@ -52,14 +53,55 @@ func (cc *CosmosProvider) queryIBCMessages(ctx context.Context, log *zap.Logger, return nil, errors.New("limit must greater than 0") } - res, err := cc.RPCClient.TxSearch(ctx, query, true, &page, &limit, "") - if err != nil { - return nil, err - } - var ibcMsgs []ibcMessage + var eg errgroup.Group chainID := cc.ChainId() - for _, tx := range res.Txs { - ibcMsgs = append(ibcMsgs, ibcMessagesFromEvents(log, tx.TxResult.Events, chainID, 0, base64Encoded)...) + var ibcMsgs []ibcMessage + var mu sync.Mutex + + eg.Go(func() error { + res, err := cc.RPCClient.BlockSearch(ctx, query, &page, &limit, "") + if err != nil { + return err + } + + var nestedEg errgroup.Group + + for _, b := range res.Blocks { + b := b + nestedEg.Go(func() error { + block, err := cc.RPCClient.BlockResults(ctx, &b.Block.Height) + if err != nil { + return err + } + + mu.Lock() + defer mu.Unlock() + ibcMsgs = append(ibcMsgs, ibcMessagesFromEvents(log, block.BeginBlockEvents, chainID, 0, base64Encoded)...) + ibcMsgs = append(ibcMsgs, ibcMessagesFromEvents(log, block.EndBlockEvents, chainID, 0, base64Encoded)...) + + return nil + }) + } + return nestedEg.Wait() + }) + + eg.Go(func() error { + res, err := cc.RPCClient.TxSearch(ctx, query, true, &page, &limit, "") + if err != nil { + return err + } + + mu.Lock() + defer mu.Unlock() + for _, tx := range res.Txs { + ibcMsgs = append(ibcMsgs, ibcMessagesFromEvents(log, tx.TxResult.Events, chainID, 0, base64Encoded)...) + } + + return nil + }) + + if err := eg.Wait(); err != nil { + return nil, err } return ibcMsgs, nil @@ -587,7 +629,12 @@ func (cc *CosmosProvider) QueryConnectionsUsingClient(ctx context.Context, heigh return nil, err } - connections.Connections = append(connections.Connections, res.Connections...) + for _, conn := range res.Connections { + if conn.ClientId == clientid { + connections.Connections = append(connections.Connections, conn) + } + } + next := res.GetPagination().GetNextKey() if len(next) == 0 { break @@ -642,7 +689,6 @@ func (cc *CosmosProvider) GenerateConnHandshakeProof(ctx context.Context, height func (cc *CosmosProvider) QueryChannel(ctx context.Context, height int64, channelid, portid string) (chanRes *chantypes.QueryChannelResponse, err error) { res, err := cc.queryChannelABCI(ctx, height, portid, channelid) if err != nil && strings.Contains(err.Error(), "not found") { - return &chantypes.QueryChannelResponse{ Channel: &chantypes.Channel{ State: chantypes.UNINITIALIZED, @@ -851,7 +897,6 @@ func (cc *CosmosProvider) QueryUnreceivedPackets(ctx context.Context, height uin func sendPacketQuery(channelID string, portID string, seq uint64) string { x := []string{ fmt.Sprintf("%s.packet_src_channel='%s'", spTag, channelID), - fmt.Sprintf("%s.packet_src_port='%s'", spTag, portID), fmt.Sprintf("%s.packet_sequence='%d'", spTag, seq), } return strings.Join(x, " AND ") @@ -860,7 +905,6 @@ func sendPacketQuery(channelID string, portID string, seq uint64) string { func writeAcknowledgementQuery(channelID string, portID string, seq uint64) string { x := []string{ fmt.Sprintf("%s.packet_dst_channel='%s'", waTag, channelID), - fmt.Sprintf("%s.packet_dst_port='%s'", waTag, portID), fmt.Sprintf("%s.packet_sequence='%d'", waTag, seq), } return strings.Join(x, " AND ") diff --git a/relayer/chains/cosmos/tx.go b/relayer/chains/cosmos/tx.go index c9fea2103..91c1c5bb3 100644 --- a/relayer/chains/cosmos/tx.go +++ b/relayer/chains/cosmos/tx.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "math" "math/big" "regexp" "strconv" @@ -27,6 +28,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" txtypes "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/types/tx/signing" + feetypes "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/types" transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" @@ -211,8 +213,14 @@ func (cc *CosmosProvider) broadcastTx( cc.LogFailedTx(rlyResp, err, msgs) return err } - - cc.UpdateFeesSpent(cc.ChainId(), cc.Key(), fees) + address, err := cc.Address() + if err != nil { + cc.log.Error( + "failed to get relayer bech32 wallet addresss", + zap.Error(err), + ) + } + cc.UpdateFeesSpent(cc.ChainId(), cc.Key(), address, fees) // TODO: maybe we need to check if the node has tx indexing enabled? // if not, we need to find a new way to block until inclusion in a block @@ -1271,7 +1279,7 @@ func (cc *CosmosProvider) NewClientState( }, nil } -func (cc *CosmosProvider) UpdateFeesSpent(chain, key string, fees sdk.Coins) { +func (cc *CosmosProvider) UpdateFeesSpent(chain, key, address string, fees sdk.Coins) { // Don't set the metrics in testing if cc.metrics == nil { return @@ -1284,10 +1292,16 @@ func (cc *CosmosProvider) UpdateFeesSpent(chain, key string, fees sdk.Coins) { for _, fee := range cc.TotalFees { // Convert to a big float to get a float64 for metrics f, _ := big.NewFloat(0.0).SetInt(fee.Amount.BigInt()).Float64() - cc.metrics.SetFeesSpent(chain, key, fee.GetDenom(), f) + cc.metrics.SetFeesSpent(chain, key, address, fee.GetDenom(), f) } } +// MsgRegisterCounterpartyPayee creates an sdk.Msg to broadcast the counterparty address +func (cc *CosmosProvider) MsgRegisterCounterpartyPayee(portID, channelID, relayerAddr, counterpartyPayee string) (provider.RelayerMessage, error) { + msg := feetypes.NewMsgRegisterCounterpartyPayee(portID, channelID, relayerAddr, counterpartyPayee) + return NewCosmosMessage(msg), nil +} + // PrepareFactory mutates the tx factory with the appropriate account number, sequence number, and min gas settings. func (cc *CosmosProvider) PrepareFactory(txf tx.Factory) (tx.Factory, error) { var ( @@ -1351,6 +1365,25 @@ func (cc *CosmosProvider) PrepareFactory(txf tx.Factory) (tx.Factory, error) { return txf, nil } +// AdjustEstimatedGas adjusts the estimated gas usage by multiplying it by the gas adjustment factor +// and bounding the result by the maximum gas amount option. If the gas usage is zero, the adjusted gas +// is also zero. If the gas adjustment factor produces an infinite result, an error is returned. +// max-gas-amount is enforced. +func (cc *CosmosProvider) AdjustEstimatedGas(gasUsed uint64) (uint64, error) { + if gasUsed == 0 { + return gasUsed, nil + } + gas := cc.PCfg.GasAdjustment * float64(gasUsed) + if math.IsInf(gas, 1) { + return 0, fmt.Errorf("infinite gas used") + } + // Bound the gas estimate by the max_gas option + if cc.PCfg.MaxGasAmount > 0 { + gas = math.Min(gas, float64(cc.PCfg.MaxGasAmount)) + } + return uint64(gas), nil +} + // CalculateGas simulates a tx to generate the appropriate gas settings before broadcasting a tx. func (cc *CosmosProvider) CalculateGas(ctx context.Context, txf tx.Factory, msgs ...sdk.Msg) (txtypes.SimulateResponse, uint64, error) { keyInfo, err := cc.Keybase.Key(cc.PCfg.Key) @@ -1391,8 +1424,8 @@ func (cc *CosmosProvider) CalculateGas(ctx context.Context, txf tx.Factory, msgs if err := simRes.Unmarshal(res.Value); err != nil { return txtypes.SimulateResponse{}, 0, err } - - return simRes, uint64(txf.GasAdjustment() * float64(simRes.GasInfo.GasUsed)), nil + gas, err := cc.AdjustEstimatedGas(simRes.GasInfo.GasUsed) + return simRes, gas, err } // TxFactory instantiates a new tx factory with the appropriate configuration settings for this chain. diff --git a/relayer/chains/icon/keys.go b/relayer/chains/icon/keys.go index dff67ab1e..9bfda64a6 100644 --- a/relayer/chains/icon/keys.go +++ b/relayer/chains/icon/keys.go @@ -20,11 +20,11 @@ func (cp *IconProvider) KeystoreCreated(path string) bool { return false } -func (cp *IconProvider) AddKey(name string, coinType uint32) (output *provider.KeyOutput, err error) { +func (cp *IconProvider) AddKey(name string, coinType uint32, signingAlgorithm string) (output *provider.KeyOutput, err error) { return nil, fmt.Errorf("Not implemented on icon") } -func (cp *IconProvider) RestoreKey(name, mnemonic string, coinType uint32) (address string, err error) { +func (cp *IconProvider) RestoreKey(name, mnemonic string, coinType uint32, signingAlgorithm string) (address string, err error) { return "", fmt.Errorf("Not implemented on icon") } diff --git a/relayer/chains/icon/provider.go b/relayer/chains/icon/provider.go index 941699388..d1afed8f7 100644 --- a/relayer/chains/icon/provider.go +++ b/relayer/chains/icon/provider.go @@ -77,17 +77,6 @@ func (pp *IconProviderConfig) Validate() error { return nil } -func (pp *IconProviderConfig) Set(field string, value interface{}) error { - switch field { - case "btpHeight": - pp.BTPHeight = value.(int64) - default: - return fmt.Errorf("unknown field or not allowed to set %s", field) - } - return nil - -} - // NewProvider should provide a new Icon provider // NewProvider should provide a new Icon provider func (pp *IconProviderConfig) NewProvider(log *zap.Logger, homepath string, debug bool, chainName string) (provider.ChainProvider, error) { @@ -578,3 +567,7 @@ func (icp *IconProvider) GetCurrentBtpNetworkStartHeight() (int64, error) { } return info.StartHeight.Value() } + +func (icp *IconProvider) MsgRegisterCounterpartyPayee(portID, channelID, relayerAddr, counterpartyPayeeAddr string) (provider.RelayerMessage, error) { + return nil, fmt.Errorf("Not implemented for Icon") +} diff --git a/relayer/chains/icon/provider_test.go b/relayer/chains/icon/provider_test.go index d10e7fab1..7bc8d94be 100644 --- a/relayer/chains/icon/provider_test.go +++ b/relayer/chains/icon/provider_test.go @@ -55,6 +55,7 @@ func GetMockIconProvider(network_id int, contractAddress string) *IconProvider { iconProvider, _ := p.(*IconProvider) return iconProvider + } func TestNetworkSectionHashCheck(t *testing.T) { diff --git a/relayer/chains/mock/message_handlers.go b/relayer/chains/mock/message_handlers.go index 01d2ff24b..263f50d71 100644 --- a/relayer/chains/mock/message_handlers.go +++ b/relayer/chains/mock/message_handlers.go @@ -11,6 +11,7 @@ import ( type msgHandlerParams struct { mcp *MockChainProcessor + height int64 packetInfo *chantypes.Packet ibcMessagesCache processor.IBCMessagesCache } @@ -31,9 +32,14 @@ func handleMsgTransfer(p msgHandlerParams) { CounterpartyPortID: p.packetInfo.DestinationPort, } p.ibcMessagesCache.PacketFlow.Retain(channelKey, chantypes.EventTypeSendPacket, provider.PacketInfo{ + Height: uint64(p.height), Sequence: p.packetInfo.Sequence, Data: p.packetInfo.Data, TimeoutHeight: p.packetInfo.TimeoutHeight, + SourcePort: p.packetInfo.SourcePort, + SourceChannel: p.packetInfo.SourceChannel, + DestPort: p.packetInfo.DestinationPort, + DestChannel: p.packetInfo.DestinationChannel, }) p.mcp.log.Debug("observed MsgTransfer", zap.String("chain_id", p.mcp.chainID), @@ -53,8 +59,13 @@ func handleMsgRecvPacket(p msgHandlerParams) { CounterpartyPortID: p.packetInfo.SourcePort, } p.ibcMessagesCache.PacketFlow.Retain(channelKey, chantypes.EventTypeRecvPacket, provider.PacketInfo{ - Sequence: p.packetInfo.Sequence, - Data: p.packetInfo.Data, + Height: uint64(p.height), + Sequence: p.packetInfo.Sequence, + Data: p.packetInfo.Data, + SourcePort: p.packetInfo.SourcePort, + SourceChannel: p.packetInfo.SourceChannel, + DestPort: p.packetInfo.DestinationPort, + DestChannel: p.packetInfo.DestinationChannel, }) p.mcp.log.Debug("observed MsgRecvPacket", zap.String("chain_id", p.mcp.chainID), @@ -74,8 +85,13 @@ func handleMsgAcknowledgement(p msgHandlerParams) { CounterpartyPortID: p.packetInfo.DestinationPort, } p.ibcMessagesCache.PacketFlow.Retain(channelKey, chantypes.EventTypeAcknowledgePacket, provider.PacketInfo{ - Sequence: p.packetInfo.Sequence, - Data: p.packetInfo.Data, + Height: uint64(p.height), + Sequence: p.packetInfo.Sequence, + Data: p.packetInfo.Data, + SourcePort: p.packetInfo.SourcePort, + SourceChannel: p.packetInfo.SourceChannel, + DestPort: p.packetInfo.DestinationPort, + DestChannel: p.packetInfo.DestinationChannel, }) p.mcp.log.Debug("observed MsgAcknowledgement", zap.String("chain_id", p.mcp.chainID), diff --git a/relayer/chains/mock/mock_chain_processor.go b/relayer/chains/mock/mock_chain_processor.go index 329c4215b..4faf1fe3c 100644 --- a/relayer/chains/mock/mock_chain_processor.go +++ b/relayer/chains/mock/mock_chain_processor.go @@ -4,6 +4,7 @@ import ( "context" "time" + "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/relayer/v2/relayer/chains/cosmos" "github.com/cosmos/relayer/v2/relayer/processor" "github.com/cosmos/relayer/v2/relayer/provider" @@ -49,7 +50,7 @@ func NewMockChainProcessor(ctx context.Context, log *zap.Logger, chainID string, } chainProvider, _ := chainProviderCfg.NewProvider(zap.NewNop(), "/tmp", true, "mock-chain-name-"+chainID) _ = chainProvider.Init(ctx) - _, _ = chainProvider.AddKey(chainProvider.Key(), 118) + _, _ = chainProvider.AddKey(chainProvider.Key(), 118, string(hd.Secp256k1Type)) return &MockChainProcessor{ log: log, chainID: chainID, @@ -156,6 +157,7 @@ func (mcp *MockChainProcessor) queryCycle(ctx context.Context, persistence *quer for _, m := range messages { if handler, ok := messageHandlers[m.EventType]; ok { handler(msgHandlerParams{ + height: i, mcp: mcp, packetInfo: m.PacketInfo, ibcMessagesCache: ibcMessagesCache, @@ -175,6 +177,10 @@ func (mcp *MockChainProcessor) queryCycle(ctx context.Context, persistence *quer for _, pp := range mcp.pathProcessors { mcp.log.Info("sending messages to path processor", zap.String("chain_id", mcp.chainID)) pp.HandleNewData(mcp.chainID, processor.ChainProcessorCacheData{ + LatestBlock: provider.LatestBlock{ + Height: uint64(i), + Time: time.Now(), + }, IBCMessagesCache: ibcMessagesCache, InSync: mcp.inSync, ChannelStateCache: channelStateCache, diff --git a/relayer/chains/mock/mock_chain_processor_test.go b/relayer/chains/mock/mock_chain_processor_test.go index 505fa87db..718826917 100644 --- a/relayer/chains/mock/mock_chain_processor_test.go +++ b/relayer/chains/mock/mock_chain_processor_test.go @@ -9,6 +9,7 @@ import ( clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + "github.com/cosmos/relayer/v2/relayer" "github.com/cosmos/relayer/v2/relayer/chains/mock" "github.com/cosmos/relayer/v2/relayer/processor" "github.com/prometheus/client_golang/prometheus/testutil" @@ -61,7 +62,8 @@ func TestMockChainAndPathProcessors(t *testing.T) { clientUpdateThresholdTime := 6 * time.Hour flushInterval := 6 * time.Hour - pathProcessor := processor.NewPathProcessor(log, pathEnd1, pathEnd2, metrics, "", clientUpdateThresholdTime, flushInterval) + pathProcessor := processor.NewPathProcessor(log, pathEnd1, pathEnd2, metrics, "", + clientUpdateThresholdTime, flushInterval, relayer.DefaultMaxMsgLength) eventProcessor := processor.NewEventProcessor(). WithChainProcessors( diff --git a/relayer/chains/penumbra/codec.go b/relayer/chains/penumbra/codec.go new file mode 100644 index 000000000..5f6911696 --- /dev/null +++ b/relayer/chains/penumbra/codec.go @@ -0,0 +1,98 @@ +package penumbra + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/std" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/x/auth" + "github.com/cosmos/cosmos-sdk/x/auth/tx" + authz "github.com/cosmos/cosmos-sdk/x/authz/module" + "github.com/cosmos/cosmos-sdk/x/bank" + "github.com/cosmos/cosmos-sdk/x/capability" + "github.com/cosmos/cosmos-sdk/x/distribution" + feegrant "github.com/cosmos/cosmos-sdk/x/feegrant/module" + "github.com/cosmos/cosmos-sdk/x/gov" + govclient "github.com/cosmos/cosmos-sdk/x/gov/client" + "github.com/cosmos/cosmos-sdk/x/mint" + "github.com/cosmos/cosmos-sdk/x/params" + paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" + "github.com/cosmos/cosmos-sdk/x/slashing" + "github.com/cosmos/cosmos-sdk/x/staking" + upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" + "github.com/cosmos/ibc-go/v7/modules/apps/transfer" + ibc "github.com/cosmos/ibc-go/v7/modules/core" + + cosmosmodule "github.com/cosmos/relayer/v2/relayer/chains/cosmos/module" + "github.com/cosmos/relayer/v2/relayer/chains/cosmos/stride" + ethermintcodecs "github.com/cosmos/relayer/v2/relayer/codecs/ethermint" + injectivecodecs "github.com/cosmos/relayer/v2/relayer/codecs/injective" +) + +var moduleBasics = []module.AppModuleBasic{ + auth.AppModuleBasic{}, + authz.AppModuleBasic{}, + bank.AppModuleBasic{}, + capability.AppModuleBasic{}, + gov.NewAppModuleBasic( + []govclient.ProposalHandler{ + paramsclient.ProposalHandler, + upgradeclient.LegacyProposalHandler, + upgradeclient.LegacyCancelProposalHandler, + }, + ), + // crisis.AppModuleBasic{}, + distribution.AppModuleBasic{}, + feegrant.AppModuleBasic{}, + mint.AppModuleBasic{}, + params.AppModuleBasic{}, + slashing.AppModuleBasic{}, + staking.AppModuleBasic{}, + // upgrade.AppModuleBasic{}, + transfer.AppModuleBasic{}, + ibc.AppModuleBasic{}, + cosmosmodule.AppModuleBasic{}, + stride.AppModuleBasic{}, +} + +type Codec struct { + InterfaceRegistry types.InterfaceRegistry + Marshaler codec.Codec + TxConfig client.TxConfig + Amino *codec.LegacyAmino +} + +func makeCodec(moduleBasics []module.AppModuleBasic, extraCodecs []string) Codec { + modBasic := module.NewBasicManager(moduleBasics...) + encodingConfig := makeCodecConfig() + std.RegisterLegacyAminoCodec(encodingConfig.Amino) + std.RegisterInterfaces(encodingConfig.InterfaceRegistry) + modBasic.RegisterLegacyAminoCodec(encodingConfig.Amino) + modBasic.RegisterInterfaces(encodingConfig.InterfaceRegistry) + for _, c := range extraCodecs { + switch c { + case "ethermint": + ethermintcodecs.RegisterInterfaces(encodingConfig.InterfaceRegistry) + encodingConfig.Amino.RegisterConcrete(ðermintcodecs.PubKey{}, ethermintcodecs.PubKeyName, nil) + encodingConfig.Amino.RegisterConcrete(ðermintcodecs.PrivKey{}, ethermintcodecs.PrivKeyName, nil) + case "injective": + injectivecodecs.RegisterInterfaces(encodingConfig.InterfaceRegistry) + encodingConfig.Amino.RegisterConcrete(&injectivecodecs.PubKey{}, injectivecodecs.PubKeyName, nil) + encodingConfig.Amino.RegisterConcrete(&injectivecodecs.PrivKey{}, injectivecodecs.PrivKeyName, nil) + } + } + + return encodingConfig +} + +func makeCodecConfig() Codec { + interfaceRegistry := types.NewInterfaceRegistry() + marshaler := codec.NewProtoCodec(interfaceRegistry) + return Codec{ + InterfaceRegistry: interfaceRegistry, + Marshaler: marshaler, + TxConfig: tx.NewTxConfig(marshaler, tx.DefaultSignModes), + Amino: codec.NewLegacyAmino(), + } +} diff --git a/relayer/chains/penumbra/core/chain/v1alpha1/chain.pb.go b/relayer/chains/penumbra/core/chain/v1alpha1/chain.pb.go new file mode 100644 index 000000000..1a6f00258 --- /dev/null +++ b/relayer/chains/penumbra/core/chain/v1alpha1/chain.pb.go @@ -0,0 +1,4867 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: penumbra/core/chain/v1alpha1/chain.proto + +package chainv1alpha1 + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + v1alpha1 "github.com/cosmos/relayer/v2/relayer/chains/penumbra/core/crypto/v1alpha1" + v1alpha11 "github.com/cosmos/relayer/v2/relayer/chains/penumbra/core/dex/v1alpha1" + v1alpha12 "github.com/cosmos/relayer/v2/relayer/chains/penumbra/core/stake/v1alpha1" + 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 + +// Global chain configuration data, such as chain ID, epoch duration, etc. +type ChainParameters struct { + // The identifier of the chain. + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // The duration of each epoch, in number of blocks. + EpochDuration uint64 `protobuf:"varint,2,opt,name=epoch_duration,json=epochDuration,proto3" json:"epoch_duration,omitempty"` + // The number of epochs an unbonding note for before being released. + UnbondingEpochs uint64 `protobuf:"varint,3,opt,name=unbonding_epochs,json=unbondingEpochs,proto3" json:"unbonding_epochs,omitempty"` + // The maximum number of validators in the consensus set. + ActiveValidatorLimit uint64 `protobuf:"varint,4,opt,name=active_validator_limit,json=activeValidatorLimit,proto3" json:"active_validator_limit,omitempty"` + // The base reward rate, expressed in basis points of basis points + BaseRewardRate uint64 `protobuf:"varint,9,opt,name=base_reward_rate,json=baseRewardRate,proto3" json:"base_reward_rate,omitempty"` + // The penalty for slashing due to misbehavior. + SlashingPenaltyMisbehavior uint64 `protobuf:"varint,5,opt,name=slashing_penalty_misbehavior,json=slashingPenaltyMisbehavior,proto3" json:"slashing_penalty_misbehavior,omitempty"` + // The penalty for slashing due to downtime. + SlashingPenaltyDowntime uint64 `protobuf:"varint,10,opt,name=slashing_penalty_downtime,json=slashingPenaltyDowntime,proto3" json:"slashing_penalty_downtime,omitempty"` + // The number of blocks in the window to check for downtime. + SignedBlocksWindowLen uint64 `protobuf:"varint,11,opt,name=signed_blocks_window_len,json=signedBlocksWindowLen,proto3" json:"signed_blocks_window_len,omitempty"` + // The maximum number of blocks in the window each validator can miss signing without slashing. + MissedBlocksMaximum uint64 `protobuf:"varint,12,opt,name=missed_blocks_maximum,json=missedBlocksMaximum,proto3" json:"missed_blocks_maximum,omitempty"` + // Whether IBC (forming connections, processing IBC packets) is enabled. + IbcEnabled bool `protobuf:"varint,6,opt,name=ibc_enabled,json=ibcEnabled,proto3" json:"ibc_enabled,omitempty"` + // Whether inbound ICS-20 transfers are enabled + InboundIcs20TransfersEnabled bool `protobuf:"varint,7,opt,name=inbound_ics20_transfers_enabled,json=inboundIcs20TransfersEnabled,proto3" json:"inbound_ics20_transfers_enabled,omitempty"` + // Whether outbound ICS-20 transfers are enabled + OutboundIcs20TransfersEnabled bool `protobuf:"varint,8,opt,name=outbound_ics20_transfers_enabled,json=outboundIcs20TransfersEnabled,proto3" json:"outbound_ics20_transfers_enabled,omitempty"` + // The number of blocks during which a proposal is voted on. + ProposalVotingBlocks uint64 `protobuf:"varint,20,opt,name=proposal_voting_blocks,json=proposalVotingBlocks,proto3" json:"proposal_voting_blocks,omitempty"` + // The deposit required to create a proposal. + ProposalDepositAmount *v1alpha1.Amount `protobuf:"bytes,21,opt,name=proposal_deposit_amount,json=proposalDepositAmount,proto3" json:"proposal_deposit_amount,omitempty"` + // The quorum required for a proposal to be considered valid, as a fraction of the total stake + // weight of the network. + ProposalValidQuorum string `protobuf:"bytes,22,opt,name=proposal_valid_quorum,json=proposalValidQuorum,proto3" json:"proposal_valid_quorum,omitempty"` + // The threshold for a proposal to pass voting, as a ratio of "yes" votes over "no" votes. + ProposalPassThreshold string `protobuf:"bytes,23,opt,name=proposal_pass_threshold,json=proposalPassThreshold,proto3" json:"proposal_pass_threshold,omitempty"` + // The threshold for a proposal to be slashed, regardless of whether the "yes" and "no" votes + // would have passed it, as a ratio of "no" votes over all total votes. + ProposalSlashThreshold string `protobuf:"bytes,24,opt,name=proposal_slash_threshold,json=proposalSlashThreshold,proto3" json:"proposal_slash_threshold,omitempty"` + // Whether DAO spend proposals are enabled. + DaoSpendProposalsEnabled bool `protobuf:"varint,25,opt,name=dao_spend_proposals_enabled,json=daoSpendProposalsEnabled,proto3" json:"dao_spend_proposals_enabled,omitempty"` +} + +func (m *ChainParameters) Reset() { *m = ChainParameters{} } +func (m *ChainParameters) String() string { return proto.CompactTextString(m) } +func (*ChainParameters) ProtoMessage() {} +func (*ChainParameters) Descriptor() ([]byte, []int) { + return fileDescriptor_b0cedb8b84ba3224, []int{0} +} +func (m *ChainParameters) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ChainParameters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ChainParameters.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 *ChainParameters) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChainParameters.Merge(m, src) +} +func (m *ChainParameters) XXX_Size() int { + return m.Size() +} +func (m *ChainParameters) XXX_DiscardUnknown() { + xxx_messageInfo_ChainParameters.DiscardUnknown(m) +} + +var xxx_messageInfo_ChainParameters proto.InternalMessageInfo + +func (m *ChainParameters) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + +func (m *ChainParameters) GetEpochDuration() uint64 { + if m != nil { + return m.EpochDuration + } + return 0 +} + +func (m *ChainParameters) GetUnbondingEpochs() uint64 { + if m != nil { + return m.UnbondingEpochs + } + return 0 +} + +func (m *ChainParameters) GetActiveValidatorLimit() uint64 { + if m != nil { + return m.ActiveValidatorLimit + } + return 0 +} + +func (m *ChainParameters) GetBaseRewardRate() uint64 { + if m != nil { + return m.BaseRewardRate + } + return 0 +} + +func (m *ChainParameters) GetSlashingPenaltyMisbehavior() uint64 { + if m != nil { + return m.SlashingPenaltyMisbehavior + } + return 0 +} + +func (m *ChainParameters) GetSlashingPenaltyDowntime() uint64 { + if m != nil { + return m.SlashingPenaltyDowntime + } + return 0 +} + +func (m *ChainParameters) GetSignedBlocksWindowLen() uint64 { + if m != nil { + return m.SignedBlocksWindowLen + } + return 0 +} + +func (m *ChainParameters) GetMissedBlocksMaximum() uint64 { + if m != nil { + return m.MissedBlocksMaximum + } + return 0 +} + +func (m *ChainParameters) GetIbcEnabled() bool { + if m != nil { + return m.IbcEnabled + } + return false +} + +func (m *ChainParameters) GetInboundIcs20TransfersEnabled() bool { + if m != nil { + return m.InboundIcs20TransfersEnabled + } + return false +} + +func (m *ChainParameters) GetOutboundIcs20TransfersEnabled() bool { + if m != nil { + return m.OutboundIcs20TransfersEnabled + } + return false +} + +func (m *ChainParameters) GetProposalVotingBlocks() uint64 { + if m != nil { + return m.ProposalVotingBlocks + } + return 0 +} + +func (m *ChainParameters) GetProposalDepositAmount() *v1alpha1.Amount { + if m != nil { + return m.ProposalDepositAmount + } + return nil +} + +func (m *ChainParameters) GetProposalValidQuorum() string { + if m != nil { + return m.ProposalValidQuorum + } + return "" +} + +func (m *ChainParameters) GetProposalPassThreshold() string { + if m != nil { + return m.ProposalPassThreshold + } + return "" +} + +func (m *ChainParameters) GetProposalSlashThreshold() string { + if m != nil { + return m.ProposalSlashThreshold + } + return "" +} + +func (m *ChainParameters) GetDaoSpendProposalsEnabled() bool { + if m != nil { + return m.DaoSpendProposalsEnabled + } + return false +} + +// The ratio between two numbers, used in governance to describe vote thresholds and quorums. +type Ratio struct { + // The numerator. + Numerator uint64 `protobuf:"varint,1,opt,name=numerator,proto3" json:"numerator,omitempty"` + // The denominator. + Denominator uint64 `protobuf:"varint,2,opt,name=denominator,proto3" json:"denominator,omitempty"` +} + +func (m *Ratio) Reset() { *m = Ratio{} } +func (m *Ratio) String() string { return proto.CompactTextString(m) } +func (*Ratio) ProtoMessage() {} +func (*Ratio) Descriptor() ([]byte, []int) { + return fileDescriptor_b0cedb8b84ba3224, []int{1} +} +func (m *Ratio) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Ratio) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Ratio.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 *Ratio) XXX_Merge(src proto.Message) { + xxx_messageInfo_Ratio.Merge(m, src) +} +func (m *Ratio) XXX_Size() int { + return m.Size() +} +func (m *Ratio) XXX_DiscardUnknown() { + xxx_messageInfo_Ratio.DiscardUnknown(m) +} + +var xxx_messageInfo_Ratio proto.InternalMessageInfo + +func (m *Ratio) GetNumerator() uint64 { + if m != nil { + return m.Numerator + } + return 0 +} + +func (m *Ratio) GetDenominator() uint64 { + if m != nil { + return m.Denominator + } + return 0 +} + +// Parameters for Fuzzy Message Detection +type FmdParameters struct { + PrecisionBits uint32 `protobuf:"varint,1,opt,name=precision_bits,json=precisionBits,proto3" json:"precision_bits,omitempty"` + AsOfBlockHeight uint64 `protobuf:"varint,2,opt,name=as_of_block_height,json=asOfBlockHeight,proto3" json:"as_of_block_height,omitempty"` +} + +func (m *FmdParameters) Reset() { *m = FmdParameters{} } +func (m *FmdParameters) String() string { return proto.CompactTextString(m) } +func (*FmdParameters) ProtoMessage() {} +func (*FmdParameters) Descriptor() ([]byte, []int) { + return fileDescriptor_b0cedb8b84ba3224, []int{2} +} +func (m *FmdParameters) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FmdParameters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FmdParameters.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 *FmdParameters) XXX_Merge(src proto.Message) { + xxx_messageInfo_FmdParameters.Merge(m, src) +} +func (m *FmdParameters) XXX_Size() int { + return m.Size() +} +func (m *FmdParameters) XXX_DiscardUnknown() { + xxx_messageInfo_FmdParameters.DiscardUnknown(m) +} + +var xxx_messageInfo_FmdParameters proto.InternalMessageInfo + +func (m *FmdParameters) GetPrecisionBits() uint32 { + if m != nil { + return m.PrecisionBits + } + return 0 +} + +func (m *FmdParameters) GetAsOfBlockHeight() uint64 { + if m != nil { + return m.AsOfBlockHeight + } + return 0 +} + +// TODO: delete with legacy code +// Information about a given asset at a given time (as specified by block +// height). Currently this only contains the total supply. +type AssetInfo struct { + AssetId *v1alpha1.AssetId `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + Denom *v1alpha1.Denom `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` + AsOfBlockHeight uint64 `protobuf:"varint,3,opt,name=as_of_block_height,json=asOfBlockHeight,proto3" json:"as_of_block_height,omitempty"` + TotalSupply uint64 `protobuf:"varint,4,opt,name=total_supply,json=totalSupply,proto3" json:"total_supply,omitempty"` +} + +func (m *AssetInfo) Reset() { *m = AssetInfo{} } +func (m *AssetInfo) String() string { return proto.CompactTextString(m) } +func (*AssetInfo) ProtoMessage() {} +func (*AssetInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_b0cedb8b84ba3224, []int{3} +} +func (m *AssetInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AssetInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AssetInfo.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 *AssetInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_AssetInfo.Merge(m, src) +} +func (m *AssetInfo) XXX_Size() int { + return m.Size() +} +func (m *AssetInfo) XXX_DiscardUnknown() { + xxx_messageInfo_AssetInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_AssetInfo proto.InternalMessageInfo + +func (m *AssetInfo) GetAssetId() *v1alpha1.AssetId { + if m != nil { + return m.AssetId + } + return nil +} + +func (m *AssetInfo) GetDenom() *v1alpha1.Denom { + if m != nil { + return m.Denom + } + return nil +} + +func (m *AssetInfo) GetAsOfBlockHeight() uint64 { + if m != nil { + return m.AsOfBlockHeight + } + return 0 +} + +func (m *AssetInfo) GetTotalSupply() uint64 { + if m != nil { + return m.TotalSupply + } + return 0 +} + +// Contains the minimum data needed to update client state. +type CompactBlock struct { + Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + // State payloads describing new state fragments. + StatePayloads []*StatePayload `protobuf:"bytes,2,rep,name=state_payloads,json=statePayloads,proto3" json:"state_payloads,omitempty"` + // Nullifiers identifying spent notes. + Nullifiers []*v1alpha1.Nullifier `protobuf:"bytes,3,rep,name=nullifiers,proto3" json:"nullifiers,omitempty"` + // The block root of this block. + BlockRoot *v1alpha1.MerkleRoot `protobuf:"bytes,4,opt,name=block_root,json=blockRoot,proto3" json:"block_root,omitempty"` + // The epoch root of this epoch (only present when the block is the last in an epoch). + EpochRoot *v1alpha1.MerkleRoot `protobuf:"bytes,17,opt,name=epoch_root,json=epochRoot,proto3" json:"epoch_root,omitempty"` + // If a proposal started voting in this block, this is set to `true`. + ProposalStarted bool `protobuf:"varint,20,opt,name=proposal_started,json=proposalStarted,proto3" json:"proposal_started,omitempty"` + // Latest Fuzzy Message Detection parameters. + FmdParameters *FmdParameters `protobuf:"bytes,100,opt,name=fmd_parameters,json=fmdParameters,proto3" json:"fmd_parameters,omitempty"` + // Price data for swaps executed in this block. + SwapOutputs []*v1alpha11.BatchSwapOutputData `protobuf:"bytes,5,rep,name=swap_outputs,json=swapOutputs,proto3" json:"swap_outputs,omitempty"` + // Updated chain parameters, if they have changed. + ChainParameters *ChainParameters `protobuf:"bytes,6,opt,name=chain_parameters,json=chainParameters,proto3" json:"chain_parameters,omitempty"` +} + +func (m *CompactBlock) Reset() { *m = CompactBlock{} } +func (m *CompactBlock) String() string { return proto.CompactTextString(m) } +func (*CompactBlock) ProtoMessage() {} +func (*CompactBlock) Descriptor() ([]byte, []int) { + return fileDescriptor_b0cedb8b84ba3224, []int{4} +} +func (m *CompactBlock) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CompactBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CompactBlock.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 *CompactBlock) XXX_Merge(src proto.Message) { + xxx_messageInfo_CompactBlock.Merge(m, src) +} +func (m *CompactBlock) XXX_Size() int { + return m.Size() +} +func (m *CompactBlock) XXX_DiscardUnknown() { + xxx_messageInfo_CompactBlock.DiscardUnknown(m) +} + +var xxx_messageInfo_CompactBlock proto.InternalMessageInfo + +func (m *CompactBlock) GetHeight() uint64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *CompactBlock) GetStatePayloads() []*StatePayload { + if m != nil { + return m.StatePayloads + } + return nil +} + +func (m *CompactBlock) GetNullifiers() []*v1alpha1.Nullifier { + if m != nil { + return m.Nullifiers + } + return nil +} + +func (m *CompactBlock) GetBlockRoot() *v1alpha1.MerkleRoot { + if m != nil { + return m.BlockRoot + } + return nil +} + +func (m *CompactBlock) GetEpochRoot() *v1alpha1.MerkleRoot { + if m != nil { + return m.EpochRoot + } + return nil +} + +func (m *CompactBlock) GetProposalStarted() bool { + if m != nil { + return m.ProposalStarted + } + return false +} + +func (m *CompactBlock) GetFmdParameters() *FmdParameters { + if m != nil { + return m.FmdParameters + } + return nil +} + +func (m *CompactBlock) GetSwapOutputs() []*v1alpha11.BatchSwapOutputData { + if m != nil { + return m.SwapOutputs + } + return nil +} + +func (m *CompactBlock) GetChainParameters() *ChainParameters { + if m != nil { + return m.ChainParameters + } + return nil +} + +type StatePayload struct { + // Types that are valid to be assigned to StatePayload: + // *StatePayload_RolledUp_ + // *StatePayload_Note_ + // *StatePayload_Swap_ + StatePayload isStatePayload_StatePayload `protobuf_oneof:"state_payload"` +} + +func (m *StatePayload) Reset() { *m = StatePayload{} } +func (m *StatePayload) String() string { return proto.CompactTextString(m) } +func (*StatePayload) ProtoMessage() {} +func (*StatePayload) Descriptor() ([]byte, []int) { + return fileDescriptor_b0cedb8b84ba3224, []int{5} +} +func (m *StatePayload) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StatePayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StatePayload.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 *StatePayload) XXX_Merge(src proto.Message) { + xxx_messageInfo_StatePayload.Merge(m, src) +} +func (m *StatePayload) XXX_Size() int { + return m.Size() +} +func (m *StatePayload) XXX_DiscardUnknown() { + xxx_messageInfo_StatePayload.DiscardUnknown(m) +} + +var xxx_messageInfo_StatePayload proto.InternalMessageInfo + +type isStatePayload_StatePayload interface { + isStatePayload_StatePayload() + MarshalTo([]byte) (int, error) + Size() int +} + +type StatePayload_RolledUp_ struct { + RolledUp *StatePayload_RolledUp `protobuf:"bytes,1,opt,name=rolled_up,json=rolledUp,proto3,oneof" json:"rolled_up,omitempty"` +} +type StatePayload_Note_ struct { + Note *StatePayload_Note `protobuf:"bytes,2,opt,name=note,proto3,oneof" json:"note,omitempty"` +} +type StatePayload_Swap_ struct { + Swap *StatePayload_Swap `protobuf:"bytes,3,opt,name=swap,proto3,oneof" json:"swap,omitempty"` +} + +func (*StatePayload_RolledUp_) isStatePayload_StatePayload() {} +func (*StatePayload_Note_) isStatePayload_StatePayload() {} +func (*StatePayload_Swap_) isStatePayload_StatePayload() {} + +func (m *StatePayload) GetStatePayload() isStatePayload_StatePayload { + if m != nil { + return m.StatePayload + } + return nil +} + +func (m *StatePayload) GetRolledUp() *StatePayload_RolledUp { + if x, ok := m.GetStatePayload().(*StatePayload_RolledUp_); ok { + return x.RolledUp + } + return nil +} + +func (m *StatePayload) GetNote() *StatePayload_Note { + if x, ok := m.GetStatePayload().(*StatePayload_Note_); ok { + return x.Note + } + return nil +} + +func (m *StatePayload) GetSwap() *StatePayload_Swap { + if x, ok := m.GetStatePayload().(*StatePayload_Swap_); ok { + return x.Swap + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*StatePayload) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*StatePayload_RolledUp_)(nil), + (*StatePayload_Note_)(nil), + (*StatePayload_Swap_)(nil), + } +} + +type StatePayload_RolledUp struct { + Commitment *v1alpha1.StateCommitment `protobuf:"bytes,1,opt,name=commitment,proto3" json:"commitment,omitempty"` +} + +func (m *StatePayload_RolledUp) Reset() { *m = StatePayload_RolledUp{} } +func (m *StatePayload_RolledUp) String() string { return proto.CompactTextString(m) } +func (*StatePayload_RolledUp) ProtoMessage() {} +func (*StatePayload_RolledUp) Descriptor() ([]byte, []int) { + return fileDescriptor_b0cedb8b84ba3224, []int{5, 0} +} +func (m *StatePayload_RolledUp) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StatePayload_RolledUp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StatePayload_RolledUp.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 *StatePayload_RolledUp) XXX_Merge(src proto.Message) { + xxx_messageInfo_StatePayload_RolledUp.Merge(m, src) +} +func (m *StatePayload_RolledUp) XXX_Size() int { + return m.Size() +} +func (m *StatePayload_RolledUp) XXX_DiscardUnknown() { + xxx_messageInfo_StatePayload_RolledUp.DiscardUnknown(m) +} + +var xxx_messageInfo_StatePayload_RolledUp proto.InternalMessageInfo + +func (m *StatePayload_RolledUp) GetCommitment() *v1alpha1.StateCommitment { + if m != nil { + return m.Commitment + } + return nil +} + +type StatePayload_Note struct { + Source *NoteSource `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"` + Note *v1alpha1.NotePayload `protobuf:"bytes,2,opt,name=note,proto3" json:"note,omitempty"` +} + +func (m *StatePayload_Note) Reset() { *m = StatePayload_Note{} } +func (m *StatePayload_Note) String() string { return proto.CompactTextString(m) } +func (*StatePayload_Note) ProtoMessage() {} +func (*StatePayload_Note) Descriptor() ([]byte, []int) { + return fileDescriptor_b0cedb8b84ba3224, []int{5, 1} +} +func (m *StatePayload_Note) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StatePayload_Note) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StatePayload_Note.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 *StatePayload_Note) XXX_Merge(src proto.Message) { + xxx_messageInfo_StatePayload_Note.Merge(m, src) +} +func (m *StatePayload_Note) XXX_Size() int { + return m.Size() +} +func (m *StatePayload_Note) XXX_DiscardUnknown() { + xxx_messageInfo_StatePayload_Note.DiscardUnknown(m) +} + +var xxx_messageInfo_StatePayload_Note proto.InternalMessageInfo + +func (m *StatePayload_Note) GetSource() *NoteSource { + if m != nil { + return m.Source + } + return nil +} + +func (m *StatePayload_Note) GetNote() *v1alpha1.NotePayload { + if m != nil { + return m.Note + } + return nil +} + +type StatePayload_Swap struct { + Source *NoteSource `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"` + Swap *v1alpha11.SwapPayload `protobuf:"bytes,2,opt,name=swap,proto3" json:"swap,omitempty"` +} + +func (m *StatePayload_Swap) Reset() { *m = StatePayload_Swap{} } +func (m *StatePayload_Swap) String() string { return proto.CompactTextString(m) } +func (*StatePayload_Swap) ProtoMessage() {} +func (*StatePayload_Swap) Descriptor() ([]byte, []int) { + return fileDescriptor_b0cedb8b84ba3224, []int{5, 2} +} +func (m *StatePayload_Swap) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StatePayload_Swap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StatePayload_Swap.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 *StatePayload_Swap) XXX_Merge(src proto.Message) { + xxx_messageInfo_StatePayload_Swap.Merge(m, src) +} +func (m *StatePayload_Swap) XXX_Size() int { + return m.Size() +} +func (m *StatePayload_Swap) XXX_DiscardUnknown() { + xxx_messageInfo_StatePayload_Swap.DiscardUnknown(m) +} + +var xxx_messageInfo_StatePayload_Swap proto.InternalMessageInfo + +func (m *StatePayload_Swap) GetSource() *NoteSource { + if m != nil { + return m.Source + } + return nil +} + +func (m *StatePayload_Swap) GetSwap() *v1alpha11.SwapPayload { + if m != nil { + return m.Swap + } + return nil +} + +type KnownAssets struct { + Assets []*v1alpha1.Asset `protobuf:"bytes,1,rep,name=assets,proto3" json:"assets,omitempty"` +} + +func (m *KnownAssets) Reset() { *m = KnownAssets{} } +func (m *KnownAssets) String() string { return proto.CompactTextString(m) } +func (*KnownAssets) ProtoMessage() {} +func (*KnownAssets) Descriptor() ([]byte, []int) { + return fileDescriptor_b0cedb8b84ba3224, []int{6} +} +func (m *KnownAssets) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *KnownAssets) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_KnownAssets.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 *KnownAssets) XXX_Merge(src proto.Message) { + xxx_messageInfo_KnownAssets.Merge(m, src) +} +func (m *KnownAssets) XXX_Size() int { + return m.Size() +} +func (m *KnownAssets) XXX_DiscardUnknown() { + xxx_messageInfo_KnownAssets.DiscardUnknown(m) +} + +var xxx_messageInfo_KnownAssets proto.InternalMessageInfo + +func (m *KnownAssets) GetAssets() []*v1alpha1.Asset { + if m != nil { + return m.Assets + } + return nil +} + +// A spicy transaction ID +type NoteSource struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *NoteSource) Reset() { *m = NoteSource{} } +func (m *NoteSource) String() string { return proto.CompactTextString(m) } +func (*NoteSource) ProtoMessage() {} +func (*NoteSource) Descriptor() ([]byte, []int) { + return fileDescriptor_b0cedb8b84ba3224, []int{7} +} +func (m *NoteSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NoteSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NoteSource.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 *NoteSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_NoteSource.Merge(m, src) +} +func (m *NoteSource) XXX_Size() int { + return m.Size() +} +func (m *NoteSource) XXX_DiscardUnknown() { + xxx_messageInfo_NoteSource.DiscardUnknown(m) +} + +var xxx_messageInfo_NoteSource proto.InternalMessageInfo + +func (m *NoteSource) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +// A NoteSource paired with the height at which the note was spent +type SpendInfo struct { + NoteSource *NoteSource `protobuf:"bytes,1,opt,name=note_source,json=noteSource,proto3" json:"note_source,omitempty"` + SpendHeight uint64 `protobuf:"varint,2,opt,name=spend_height,json=spendHeight,proto3" json:"spend_height,omitempty"` +} + +func (m *SpendInfo) Reset() { *m = SpendInfo{} } +func (m *SpendInfo) String() string { return proto.CompactTextString(m) } +func (*SpendInfo) ProtoMessage() {} +func (*SpendInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_b0cedb8b84ba3224, []int{8} +} +func (m *SpendInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SpendInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SpendInfo.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 *SpendInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpendInfo.Merge(m, src) +} +func (m *SpendInfo) XXX_Size() int { + return m.Size() +} +func (m *SpendInfo) XXX_DiscardUnknown() { + xxx_messageInfo_SpendInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_SpendInfo proto.InternalMessageInfo + +func (m *SpendInfo) GetNoteSource() *NoteSource { + if m != nil { + return m.NoteSource + } + return nil +} + +func (m *SpendInfo) GetSpendHeight() uint64 { + if m != nil { + return m.SpendHeight + } + return 0 +} + +type GenesisAppState struct { + ChainParams *ChainParameters `protobuf:"bytes,1,opt,name=chain_params,json=chainParams,proto3" json:"chain_params,omitempty"` + Validators []*v1alpha12.Validator `protobuf:"bytes,2,rep,name=validators,proto3" json:"validators,omitempty"` + Allocations []*GenesisAppState_Allocation `protobuf:"bytes,3,rep,name=allocations,proto3" json:"allocations,omitempty"` +} + +func (m *GenesisAppState) Reset() { *m = GenesisAppState{} } +func (m *GenesisAppState) String() string { return proto.CompactTextString(m) } +func (*GenesisAppState) ProtoMessage() {} +func (*GenesisAppState) Descriptor() ([]byte, []int) { + return fileDescriptor_b0cedb8b84ba3224, []int{9} +} +func (m *GenesisAppState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisAppState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisAppState.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 *GenesisAppState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisAppState.Merge(m, src) +} +func (m *GenesisAppState) XXX_Size() int { + return m.Size() +} +func (m *GenesisAppState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisAppState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisAppState proto.InternalMessageInfo + +func (m *GenesisAppState) GetChainParams() *ChainParameters { + if m != nil { + return m.ChainParams + } + return nil +} + +func (m *GenesisAppState) GetValidators() []*v1alpha12.Validator { + if m != nil { + return m.Validators + } + return nil +} + +func (m *GenesisAppState) GetAllocations() []*GenesisAppState_Allocation { + if m != nil { + return m.Allocations + } + return nil +} + +type GenesisAppState_Allocation struct { + Amount *v1alpha1.Amount `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount,omitempty"` + Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` + Address *v1alpha1.Address `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *GenesisAppState_Allocation) Reset() { *m = GenesisAppState_Allocation{} } +func (m *GenesisAppState_Allocation) String() string { return proto.CompactTextString(m) } +func (*GenesisAppState_Allocation) ProtoMessage() {} +func (*GenesisAppState_Allocation) Descriptor() ([]byte, []int) { + return fileDescriptor_b0cedb8b84ba3224, []int{9, 0} +} +func (m *GenesisAppState_Allocation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisAppState_Allocation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisAppState_Allocation.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 *GenesisAppState_Allocation) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisAppState_Allocation.Merge(m, src) +} +func (m *GenesisAppState_Allocation) XXX_Size() int { + return m.Size() +} +func (m *GenesisAppState_Allocation) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisAppState_Allocation.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisAppState_Allocation proto.InternalMessageInfo + +func (m *GenesisAppState_Allocation) GetAmount() *v1alpha1.Amount { + if m != nil { + return m.Amount + } + return nil +} + +func (m *GenesisAppState_Allocation) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *GenesisAppState_Allocation) GetAddress() *v1alpha1.Address { + if m != nil { + return m.Address + } + return nil +} + +type Epoch struct { + Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` + StartHeight uint64 `protobuf:"varint,2,opt,name=start_height,json=startHeight,proto3" json:"start_height,omitempty"` +} + +func (m *Epoch) Reset() { *m = Epoch{} } +func (m *Epoch) String() string { return proto.CompactTextString(m) } +func (*Epoch) ProtoMessage() {} +func (*Epoch) Descriptor() ([]byte, []int) { + return fileDescriptor_b0cedb8b84ba3224, []int{10} +} +func (m *Epoch) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Epoch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Epoch.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 *Epoch) XXX_Merge(src proto.Message) { + xxx_messageInfo_Epoch.Merge(m, src) +} +func (m *Epoch) XXX_Size() int { + return m.Size() +} +func (m *Epoch) XXX_DiscardUnknown() { + xxx_messageInfo_Epoch.DiscardUnknown(m) +} + +var xxx_messageInfo_Epoch proto.InternalMessageInfo + +func (m *Epoch) GetIndex() uint64 { + if m != nil { + return m.Index + } + return 0 +} + +func (m *Epoch) GetStartHeight() uint64 { + if m != nil { + return m.StartHeight + } + return 0 +} + +func init() { + proto.RegisterType((*ChainParameters)(nil), "penumbra.core.chain.v1alpha1.ChainParameters") + proto.RegisterType((*Ratio)(nil), "penumbra.core.chain.v1alpha1.Ratio") + proto.RegisterType((*FmdParameters)(nil), "penumbra.core.chain.v1alpha1.FmdParameters") + proto.RegisterType((*AssetInfo)(nil), "penumbra.core.chain.v1alpha1.AssetInfo") + proto.RegisterType((*CompactBlock)(nil), "penumbra.core.chain.v1alpha1.CompactBlock") + proto.RegisterType((*StatePayload)(nil), "penumbra.core.chain.v1alpha1.StatePayload") + proto.RegisterType((*StatePayload_RolledUp)(nil), "penumbra.core.chain.v1alpha1.StatePayload.RolledUp") + proto.RegisterType((*StatePayload_Note)(nil), "penumbra.core.chain.v1alpha1.StatePayload.Note") + proto.RegisterType((*StatePayload_Swap)(nil), "penumbra.core.chain.v1alpha1.StatePayload.Swap") + proto.RegisterType((*KnownAssets)(nil), "penumbra.core.chain.v1alpha1.KnownAssets") + proto.RegisterType((*NoteSource)(nil), "penumbra.core.chain.v1alpha1.NoteSource") + proto.RegisterType((*SpendInfo)(nil), "penumbra.core.chain.v1alpha1.SpendInfo") + proto.RegisterType((*GenesisAppState)(nil), "penumbra.core.chain.v1alpha1.GenesisAppState") + proto.RegisterType((*GenesisAppState_Allocation)(nil), "penumbra.core.chain.v1alpha1.GenesisAppState.Allocation") + proto.RegisterType((*Epoch)(nil), "penumbra.core.chain.v1alpha1.Epoch") +} + +func init() { + proto.RegisterFile("penumbra/core/chain/v1alpha1/chain.proto", fileDescriptor_b0cedb8b84ba3224) +} + +var fileDescriptor_b0cedb8b84ba3224 = []byte{ + // 1561 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x4b, 0x8f, 0x24, 0x47, + 0x11, 0x9e, 0x9e, 0x77, 0x47, 0xf7, 0xcc, 0x2c, 0xe9, 0x7d, 0xd4, 0x0e, 0xc3, 0x6c, 0xbb, 0xe5, + 0x85, 0xde, 0xb5, 0xe8, 0xc6, 0x6d, 0x0b, 0xac, 0x36, 0x46, 0x3b, 0x8f, 0x65, 0x76, 0x65, 0xef, + 0xba, 0x9d, 0x63, 0x16, 0xb4, 0x5a, 0x54, 0xca, 0xae, 0xca, 0x99, 0x4e, 0x6d, 0x55, 0x66, 0x51, + 0x99, 0x35, 0x8f, 0x3b, 0x48, 0x1c, 0xf9, 0x0d, 0x70, 0xe3, 0x80, 0xc4, 0xbf, 0x40, 0x9c, 0x7c, + 0x44, 0x9c, 0xd0, 0xec, 0x8d, 0x13, 0x07, 0x7e, 0x00, 0xca, 0xc8, 0x7a, 0xf4, 0x34, 0xa6, 0xc7, + 0x83, 0x7c, 0xab, 0x8c, 0xf8, 0xbe, 0x2f, 0xa3, 0x22, 0x32, 0x32, 0xaa, 0xa0, 0x93, 0x70, 0x99, + 0xc5, 0xa3, 0x94, 0xf5, 0x02, 0x95, 0xf2, 0x5e, 0x30, 0x66, 0x42, 0xf6, 0x4e, 0xde, 0x63, 0x51, + 0x32, 0x66, 0xef, 0xb9, 0x65, 0x37, 0x49, 0x95, 0x51, 0x64, 0xab, 0x40, 0x76, 0x2d, 0xb2, 0xeb, + 0x5c, 0x05, 0x72, 0xf3, 0xe1, 0x94, 0x4e, 0x7a, 0x9e, 0x18, 0x35, 0x21, 0x84, 0x6b, 0xa7, 0xb4, + 0x39, 0xb5, 0xa7, 0x36, 0xec, 0x35, 0xaf, 0xa0, 0xb8, 0xcc, 0x91, 0xef, 0x5c, 0x46, 0x86, 0xfc, + 0xac, 0xc2, 0x85, 0xfc, 0xcc, 0xa1, 0xda, 0xff, 0x5e, 0x81, 0x8d, 0x3d, 0x1b, 0xce, 0x90, 0xa5, + 0x2c, 0xe6, 0x86, 0xa7, 0x9a, 0xdc, 0x85, 0x55, 0x8c, 0xd0, 0x17, 0xa1, 0x57, 0x6b, 0xd5, 0x3a, + 0x75, 0xba, 0x82, 0xeb, 0xa7, 0x21, 0xb9, 0x0f, 0xeb, 0x3c, 0x51, 0xc1, 0xd8, 0x0f, 0xb3, 0x94, + 0x19, 0xa1, 0xa4, 0x37, 0xdf, 0xaa, 0x75, 0x16, 0xe9, 0x1a, 0x5a, 0xf7, 0x73, 0x23, 0x79, 0x00, + 0x37, 0x32, 0x39, 0x52, 0x32, 0x14, 0xf2, 0xd8, 0x47, 0x97, 0xf6, 0x16, 0x10, 0xb8, 0x51, 0xda, + 0x1f, 0xa3, 0x99, 0x7c, 0x00, 0xb7, 0x59, 0x60, 0xc4, 0x09, 0xf7, 0x4f, 0x58, 0x24, 0x42, 0x66, + 0x54, 0xea, 0x47, 0x22, 0x16, 0xc6, 0x5b, 0x44, 0xc2, 0x4d, 0xe7, 0x7d, 0x51, 0x38, 0x3f, 0xb5, + 0x3e, 0xd2, 0x81, 0x1b, 0x23, 0xa6, 0xb9, 0x9f, 0xf2, 0x53, 0x96, 0x86, 0x7e, 0xca, 0x0c, 0xf7, + 0xea, 0x88, 0x5f, 0xb7, 0x76, 0x8a, 0x66, 0xca, 0x0c, 0x27, 0x8f, 0x60, 0x4b, 0x47, 0x4c, 0x8f, + 0x6d, 0x24, 0x09, 0x97, 0x2c, 0x32, 0xe7, 0x7e, 0x2c, 0xf4, 0x88, 0x8f, 0xd9, 0x89, 0x50, 0xa9, + 0xb7, 0x84, 0xac, 0xcd, 0x02, 0x33, 0x74, 0x90, 0x67, 0x15, 0x82, 0x0c, 0xe0, 0xee, 0x7f, 0x29, + 0x84, 0xea, 0x54, 0x1a, 0x11, 0x73, 0x0f, 0x90, 0x7e, 0x67, 0x8a, 0xbe, 0x9f, 0xbb, 0xc9, 0x8f, + 0xc0, 0xd3, 0xe2, 0x58, 0xf2, 0xd0, 0x1f, 0x45, 0x2a, 0x78, 0xad, 0xfd, 0x53, 0x21, 0x43, 0x75, + 0xea, 0x47, 0x5c, 0x7a, 0x0d, 0xa4, 0xde, 0x72, 0xfe, 0x5d, 0x74, 0xff, 0x1c, 0xbd, 0x9f, 0x72, + 0x49, 0xfa, 0x70, 0x2b, 0x16, 0x5a, 0x57, 0xc4, 0x98, 0x9d, 0x89, 0x38, 0x8b, 0xbd, 0x26, 0xb2, + 0xde, 0x72, 0x4e, 0xc7, 0x7a, 0xe6, 0x5c, 0xe4, 0x1e, 0x34, 0xc4, 0x28, 0xf0, 0xb9, 0x64, 0xa3, + 0x88, 0x87, 0xde, 0x72, 0xab, 0xd6, 0x59, 0xa5, 0x20, 0x46, 0xc1, 0x63, 0x67, 0x21, 0x8f, 0xe1, + 0x9e, 0x90, 0x23, 0x95, 0xc9, 0xd0, 0x17, 0x81, 0xee, 0xff, 0xc0, 0x37, 0x29, 0x93, 0xfa, 0x88, + 0xa7, 0xba, 0x24, 0xad, 0x20, 0x69, 0x2b, 0x87, 0x3d, 0xb5, 0xa8, 0x2f, 0x0a, 0x50, 0x21, 0x73, + 0x00, 0x2d, 0x95, 0x99, 0xd9, 0x3a, 0xab, 0xa8, 0xf3, 0x9d, 0x02, 0xf7, 0xd5, 0x42, 0x1f, 0xc0, + 0xed, 0x24, 0x55, 0x89, 0xd2, 0x2c, 0xf2, 0x4f, 0x94, 0xb1, 0x09, 0x76, 0x6f, 0xeb, 0xdd, 0x74, + 0xb5, 0x2f, 0xbc, 0x2f, 0xd0, 0xe9, 0xde, 0x96, 0xfc, 0x12, 0xee, 0x94, 0xac, 0x90, 0x27, 0x4a, + 0x0b, 0xe3, 0xb3, 0x58, 0x65, 0xd2, 0x78, 0xb7, 0x5a, 0xb5, 0x4e, 0xa3, 0x7f, 0xbf, 0x3b, 0xd5, + 0x6e, 0xae, 0x81, 0x8a, 0xd3, 0xdf, 0xdd, 0x41, 0x30, 0xbd, 0x55, 0xa8, 0xec, 0x3b, 0x11, 0x67, + 0xb6, 0x99, 0xaf, 0x82, 0xb2, 0xa7, 0xce, 0xff, 0x55, 0xa6, 0xd2, 0x2c, 0xf6, 0x6e, 0x63, 0x2b, + 0xbc, 0x55, 0xc6, 0x64, 0x7d, 0x9f, 0xa3, 0x8b, 0xfc, 0x70, 0x22, 0xa4, 0x84, 0x69, 0xed, 0x9b, + 0x71, 0xca, 0xf5, 0x58, 0x45, 0xa1, 0x77, 0x07, 0x59, 0xa5, 0xe4, 0x90, 0x69, 0xfd, 0x45, 0xe1, + 0x24, 0x1f, 0x82, 0x57, 0xf2, 0xf0, 0x08, 0x4d, 0x10, 0x3d, 0x24, 0x96, 0x09, 0x3a, 0xb4, 0xee, + 0x8a, 0xf9, 0x31, 0x7c, 0x3b, 0x64, 0xca, 0xd7, 0x09, 0x97, 0xa1, 0x5f, 0x60, 0xaa, 0xf4, 0xdf, + 0xc5, 0xf4, 0x7b, 0x21, 0x53, 0x87, 0x16, 0x31, 0x2c, 0x00, 0x79, 0xe6, 0xdb, 0x07, 0xb0, 0x44, + 0x6d, 0xab, 0x92, 0x2d, 0xa8, 0xcb, 0x2c, 0xe6, 0xa9, 0x6d, 0x2d, 0x6c, 0xf6, 0x45, 0x5a, 0x19, + 0x48, 0x0b, 0x1a, 0x21, 0x97, 0x2a, 0x16, 0x12, 0xfd, 0xae, 0xd7, 0x27, 0x4d, 0xed, 0x00, 0xd6, + 0x7e, 0x1a, 0x87, 0x13, 0x97, 0xc7, 0x7d, 0x58, 0x4f, 0x52, 0x1e, 0x08, 0x2d, 0x94, 0xf4, 0x47, + 0xc2, 0x68, 0x54, 0x5d, 0xa3, 0x6b, 0xa5, 0x75, 0x57, 0x18, 0x4d, 0xde, 0x05, 0xc2, 0xb4, 0xaf, + 0x8e, 0x5c, 0xc1, 0xfd, 0x31, 0x17, 0xc7, 0x63, 0x93, 0x6f, 0xb0, 0xc1, 0xf4, 0x67, 0x47, 0x58, + 0xec, 0x27, 0x68, 0x6e, 0xff, 0xbd, 0x06, 0xf5, 0x1d, 0xad, 0xb9, 0x79, 0x2a, 0x8f, 0x14, 0xd9, + 0x81, 0x55, 0x66, 0x17, 0xc5, 0xf5, 0xd4, 0xe8, 0x7f, 0xf7, 0xaa, 0x82, 0x23, 0x37, 0xa4, 0x2b, + 0xcc, 0x3d, 0x90, 0x01, 0x2c, 0xe1, 0x4b, 0xe0, 0x86, 0x8d, 0xfe, 0x3b, 0x57, 0xf0, 0xf7, 0x2d, + 0x96, 0x3a, 0xca, 0xff, 0x88, 0x7c, 0xe1, 0x2b, 0x23, 0x27, 0x6f, 0x43, 0xd3, 0x28, 0x63, 0xab, + 0x9b, 0x25, 0x49, 0x74, 0x9e, 0xdf, 0x69, 0x0d, 0xb4, 0x1d, 0xa2, 0xa9, 0xfd, 0xeb, 0x25, 0x68, + 0xee, 0xa9, 0x38, 0x61, 0x81, 0x41, 0x26, 0xb9, 0x0d, 0xcb, 0xb9, 0xa8, 0xab, 0x47, 0xbe, 0x22, + 0x9f, 0xc3, 0xba, 0x36, 0xcc, 0x70, 0x3f, 0x61, 0xe7, 0x91, 0x62, 0xa1, 0xf6, 0xe6, 0x5b, 0x0b, + 0x9d, 0x46, 0xff, 0x61, 0x77, 0xd6, 0x74, 0xe9, 0x1e, 0x5a, 0xce, 0xd0, 0x51, 0xe8, 0x9a, 0x9e, + 0x58, 0x69, 0xf2, 0x04, 0x40, 0x66, 0x51, 0x24, 0x8e, 0x04, 0x4f, 0xed, 0x0d, 0x6d, 0xe5, 0x3a, + 0x57, 0x24, 0xe3, 0x79, 0x41, 0xa0, 0x13, 0x5c, 0xab, 0xe4, 0xf2, 0x91, 0x2a, 0xe5, 0xae, 0xee, + 0x46, 0xff, 0xc1, 0x15, 0x4a, 0xcf, 0x78, 0xfa, 0x3a, 0xe2, 0x54, 0x29, 0x43, 0xeb, 0x48, 0xb6, + 0x8f, 0x56, 0xc9, 0x8d, 0x18, 0x54, 0xfa, 0xd6, 0xb5, 0x95, 0x90, 0x8c, 0x4a, 0x0f, 0xe0, 0x46, + 0xd5, 0x5d, 0x86, 0xa5, 0x86, 0x87, 0x78, 0xb1, 0xac, 0xd2, 0x8d, 0xb2, 0xab, 0x9c, 0x99, 0x50, + 0x58, 0x3f, 0x8a, 0x43, 0x3f, 0x29, 0xcf, 0xb1, 0x17, 0xe2, 0xc6, 0xef, 0xce, 0xce, 0xed, 0xa5, + 0xa3, 0x4f, 0xd7, 0x8e, 0x2e, 0x75, 0x02, 0x85, 0xa6, 0x3e, 0x65, 0x89, 0xaf, 0x32, 0x93, 0x64, + 0x46, 0x7b, 0x4b, 0x98, 0xde, 0xde, 0x94, 0xa2, 0x1d, 0xc5, 0xa5, 0xde, 0x2e, 0x33, 0xc1, 0xf8, + 0xf0, 0x94, 0x25, 0x9f, 0x21, 0x67, 0x9f, 0x19, 0x46, 0x1b, 0xba, 0x5c, 0x6b, 0xf2, 0x0b, 0xb8, + 0xe1, 0x46, 0xf3, 0x44, 0xa4, 0xcb, 0x18, 0xe9, 0xf7, 0x67, 0x47, 0x3a, 0x35, 0xe3, 0xe9, 0x46, + 0x70, 0xd9, 0xd0, 0xfe, 0xd7, 0x22, 0x34, 0x27, 0x8f, 0x0a, 0xa1, 0x50, 0x4f, 0x55, 0x14, 0xf1, + 0xd0, 0xcf, 0x92, 0xbc, 0xcf, 0xde, 0xff, 0xfa, 0x27, 0xad, 0x4b, 0x91, 0xfb, 0xb3, 0xe4, 0xc9, + 0x1c, 0x5d, 0x4d, 0xf3, 0x67, 0xf2, 0x18, 0x16, 0xa5, 0x32, 0x3c, 0x6f, 0xbb, 0xde, 0x35, 0xe4, + 0x9e, 0x2b, 0xc3, 0x9f, 0xcc, 0x51, 0xa4, 0x5b, 0x19, 0x9b, 0x14, 0x6c, 0xba, 0xeb, 0xc9, 0xd8, + 0xdc, 0x5a, 0x19, 0x4b, 0xdf, 0x7c, 0x09, 0xab, 0x45, 0x94, 0xe4, 0x39, 0x40, 0xa0, 0xe2, 0x58, + 0x98, 0x98, 0x4b, 0x93, 0xbf, 0x6e, 0xf7, 0x8a, 0x53, 0x87, 0xca, 0x7b, 0x25, 0x8b, 0x4e, 0x28, + 0x6c, 0xfe, 0xb6, 0x06, 0x8b, 0x36, 0x66, 0xf2, 0x08, 0x96, 0xb5, 0xca, 0xd2, 0x80, 0xe7, 0xa2, + 0x9d, 0xd9, 0xd1, 0x5a, 0xce, 0x21, 0xe2, 0x69, 0xce, 0x23, 0x3f, 0xb9, 0x94, 0xb4, 0x87, 0x57, + 0xb5, 0xa7, 0xaa, 0xba, 0x1d, 0x79, 0x9b, 0xbf, 0xa9, 0xc1, 0xa2, 0x7d, 0xef, 0x6f, 0x20, 0x94, + 0x8f, 0xf2, 0xc4, 0xbb, 0x50, 0xbe, 0x37, 0xeb, 0x28, 0xdb, 0x1d, 0xcb, 0x38, 0x2c, 0x69, 0x77, + 0x03, 0xd6, 0x2e, 0xdd, 0x5f, 0xed, 0x4f, 0xa0, 0xf1, 0x89, 0x54, 0xa7, 0x12, 0xaf, 0x67, 0x4d, + 0x7e, 0x0c, 0xcb, 0x78, 0x3f, 0xdb, 0x89, 0xb1, 0xf0, 0x35, 0x6e, 0x65, 0xa4, 0xd1, 0x9c, 0xd3, + 0x6e, 0x03, 0x54, 0x01, 0x93, 0x9b, 0xb0, 0x24, 0xa4, 0xe4, 0x6e, 0xa4, 0x35, 0xa9, 0x5b, 0xb4, + 0xcf, 0xa1, 0x8e, 0xe3, 0x10, 0xc7, 0xc8, 0x53, 0x68, 0xd8, 0xf4, 0xf8, 0xff, 0x67, 0x4a, 0x40, + 0x56, 0xbb, 0xbd, 0x0d, 0x4d, 0x37, 0x88, 0x2f, 0x8d, 0xb1, 0x06, 0xda, 0xf2, 0x11, 0xf6, 0xa7, + 0x05, 0xd8, 0x38, 0xe0, 0x92, 0x6b, 0xa1, 0x77, 0x92, 0x04, 0x4f, 0x0e, 0x19, 0x42, 0x73, 0xa2, + 0x99, 0x75, 0x1e, 0xc2, 0x35, 0x1b, 0xb9, 0x51, 0x35, 0xb2, 0x26, 0x07, 0x00, 0xe5, 0x57, 0x74, + 0x31, 0x1e, 0xa6, 0xab, 0xe4, 0xfe, 0x11, 0x4a, 0xbd, 0xf2, 0xc3, 0x9a, 0x4e, 0x50, 0xc9, 0x4b, + 0x68, 0xb0, 0x28, 0x52, 0x01, 0x7e, 0xce, 0x17, 0x93, 0xe1, 0xc3, 0xd9, 0x91, 0x4d, 0xbd, 0x5e, + 0x77, 0xa7, 0x14, 0xa0, 0x93, 0x62, 0x9b, 0x7f, 0xa8, 0x01, 0x54, 0x3e, 0xf2, 0x31, 0x2c, 0xe7, + 0x5f, 0x6f, 0xb5, 0xeb, 0x7c, 0xbd, 0xe5, 0x24, 0x5b, 0xe9, 0x6a, 0x94, 0xd7, 0x8b, 0x21, 0xfd, + 0x08, 0x56, 0x58, 0x18, 0xa6, 0x5c, 0xeb, 0xfc, 0x92, 0xb8, 0xf2, 0x13, 0xc1, 0xa1, 0x69, 0x41, + 0x6b, 0x3f, 0x82, 0x25, 0xfc, 0x43, 0x71, 0x47, 0x29, 0xe4, 0x67, 0xf9, 0x34, 0x76, 0x0b, 0x2c, + 0xb9, 0x9d, 0x1d, 0xd3, 0x25, 0xb7, 0x36, 0x57, 0xf2, 0xdd, 0x3f, 0xcf, 0xff, 0xe5, 0x62, 0xbb, + 0xf6, 0xe5, 0xc5, 0x76, 0xed, 0x1f, 0x17, 0xdb, 0xb5, 0xdf, 0xbd, 0xd9, 0x9e, 0xfb, 0xf2, 0xcd, + 0xf6, 0xdc, 0xdf, 0xde, 0x6c, 0xcf, 0x41, 0x2b, 0x50, 0xf1, 0xcc, 0x64, 0xee, 0x82, 0xab, 0xb3, + 0xfd, 0x47, 0x1b, 0xd6, 0x5e, 0xbe, 0x38, 0x16, 0x66, 0x9c, 0x8d, 0xba, 0x81, 0x8a, 0x7b, 0x81, + 0xd2, 0xb1, 0xd2, 0xbd, 0x94, 0x47, 0xec, 0x9c, 0xa7, 0xbd, 0x93, 0x7e, 0xf9, 0x88, 0x12, 0xba, + 0x37, 0xeb, 0xaf, 0xf4, 0x23, 0x5c, 0x16, 0xab, 0xdf, 0xcf, 0x2f, 0x0c, 0xf7, 0xf6, 0xfe, 0x38, + 0xbf, 0x35, 0x2c, 0x42, 0xd9, 0xb3, 0xa1, 0xe0, 0xd6, 0xdd, 0x17, 0x39, 0xe8, 0xaf, 0x95, 0xfb, + 0x95, 0x75, 0xbf, 0x42, 0xf7, 0xab, 0xc2, 0x7d, 0x31, 0xdf, 0x99, 0xe5, 0x7e, 0x75, 0x30, 0xdc, + 0x7d, 0xc6, 0x0d, 0x0b, 0x99, 0x61, 0xff, 0x9c, 0xbf, 0x57, 0x40, 0x07, 0x03, 0x8b, 0x1d, 0x0c, + 0x10, 0x3c, 0x18, 0x14, 0xe8, 0xd1, 0x32, 0xfe, 0x95, 0xbe, 0xff, 0x9f, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x6a, 0x54, 0x2e, 0xcf, 0x5b, 0x0f, 0x00, 0x00, +} + +func (m *ChainParameters) 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 *ChainParameters) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ChainParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.DaoSpendProposalsEnabled { + i-- + if m.DaoSpendProposalsEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xc8 + } + if len(m.ProposalSlashThreshold) > 0 { + i -= len(m.ProposalSlashThreshold) + copy(dAtA[i:], m.ProposalSlashThreshold) + i = encodeVarintChain(dAtA, i, uint64(len(m.ProposalSlashThreshold))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xc2 + } + if len(m.ProposalPassThreshold) > 0 { + i -= len(m.ProposalPassThreshold) + copy(dAtA[i:], m.ProposalPassThreshold) + i = encodeVarintChain(dAtA, i, uint64(len(m.ProposalPassThreshold))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xba + } + if len(m.ProposalValidQuorum) > 0 { + i -= len(m.ProposalValidQuorum) + copy(dAtA[i:], m.ProposalValidQuorum) + i = encodeVarintChain(dAtA, i, uint64(len(m.ProposalValidQuorum))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + if m.ProposalDepositAmount != nil { + { + size, err := m.ProposalDepositAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + if m.ProposalVotingBlocks != 0 { + i = encodeVarintChain(dAtA, i, uint64(m.ProposalVotingBlocks)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa0 + } + if m.MissedBlocksMaximum != 0 { + i = encodeVarintChain(dAtA, i, uint64(m.MissedBlocksMaximum)) + i-- + dAtA[i] = 0x60 + } + if m.SignedBlocksWindowLen != 0 { + i = encodeVarintChain(dAtA, i, uint64(m.SignedBlocksWindowLen)) + i-- + dAtA[i] = 0x58 + } + if m.SlashingPenaltyDowntime != 0 { + i = encodeVarintChain(dAtA, i, uint64(m.SlashingPenaltyDowntime)) + i-- + dAtA[i] = 0x50 + } + if m.BaseRewardRate != 0 { + i = encodeVarintChain(dAtA, i, uint64(m.BaseRewardRate)) + i-- + dAtA[i] = 0x48 + } + if m.OutboundIcs20TransfersEnabled { + i-- + if m.OutboundIcs20TransfersEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + if m.InboundIcs20TransfersEnabled { + i-- + if m.InboundIcs20TransfersEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if m.IbcEnabled { + i-- + if m.IbcEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.SlashingPenaltyMisbehavior != 0 { + i = encodeVarintChain(dAtA, i, uint64(m.SlashingPenaltyMisbehavior)) + i-- + dAtA[i] = 0x28 + } + if m.ActiveValidatorLimit != 0 { + i = encodeVarintChain(dAtA, i, uint64(m.ActiveValidatorLimit)) + i-- + dAtA[i] = 0x20 + } + if m.UnbondingEpochs != 0 { + i = encodeVarintChain(dAtA, i, uint64(m.UnbondingEpochs)) + i-- + dAtA[i] = 0x18 + } + if m.EpochDuration != 0 { + i = encodeVarintChain(dAtA, i, uint64(m.EpochDuration)) + i-- + dAtA[i] = 0x10 + } + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintChain(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Ratio) 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 *Ratio) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Ratio) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Denominator != 0 { + i = encodeVarintChain(dAtA, i, uint64(m.Denominator)) + i-- + dAtA[i] = 0x10 + } + if m.Numerator != 0 { + i = encodeVarintChain(dAtA, i, uint64(m.Numerator)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *FmdParameters) 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 *FmdParameters) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FmdParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AsOfBlockHeight != 0 { + i = encodeVarintChain(dAtA, i, uint64(m.AsOfBlockHeight)) + i-- + dAtA[i] = 0x10 + } + if m.PrecisionBits != 0 { + i = encodeVarintChain(dAtA, i, uint64(m.PrecisionBits)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *AssetInfo) 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 *AssetInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AssetInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TotalSupply != 0 { + i = encodeVarintChain(dAtA, i, uint64(m.TotalSupply)) + i-- + dAtA[i] = 0x20 + } + if m.AsOfBlockHeight != 0 { + i = encodeVarintChain(dAtA, i, uint64(m.AsOfBlockHeight)) + i-- + dAtA[i] = 0x18 + } + if m.Denom != nil { + { + size, err := m.Denom.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.AssetId != nil { + { + size, err := m.AssetId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CompactBlock) 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 *CompactBlock) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CompactBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.FmdParameters != nil { + { + size, err := m.FmdParameters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6 + i-- + dAtA[i] = 0xa2 + } + if m.ProposalStarted { + i-- + if m.ProposalStarted { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa0 + } + if m.EpochRoot != nil { + { + size, err := m.EpochRoot.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if m.ChainParameters != nil { + { + size, err := m.ChainParameters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if len(m.SwapOutputs) > 0 { + for iNdEx := len(m.SwapOutputs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SwapOutputs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if m.BlockRoot != nil { + { + size, err := m.BlockRoot.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.Nullifiers) > 0 { + for iNdEx := len(m.Nullifiers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Nullifiers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.StatePayloads) > 0 { + for iNdEx := len(m.StatePayloads) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.StatePayloads[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Height != 0 { + i = encodeVarintChain(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *StatePayload) 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 *StatePayload) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatePayload) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.StatePayload != nil { + { + size := m.StatePayload.Size() + i -= size + if _, err := m.StatePayload.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *StatePayload_RolledUp_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatePayload_RolledUp_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.RolledUp != nil { + { + size, err := m.RolledUp.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *StatePayload_Note_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatePayload_Note_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Note != nil { + { + size, err := m.Note.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *StatePayload_Swap_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatePayload_Swap_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Swap != nil { + { + size, err := m.Swap.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *StatePayload_RolledUp) 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 *StatePayload_RolledUp) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatePayload_RolledUp) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Commitment != nil { + { + size, err := m.Commitment.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *StatePayload_Note) 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 *StatePayload_Note) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatePayload_Note) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Note != nil { + { + size, err := m.Note.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Source != nil { + { + size, err := m.Source.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *StatePayload_Swap) 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 *StatePayload_Swap) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatePayload_Swap) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Swap != nil { + { + size, err := m.Swap.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Source != nil { + { + size, err := m.Source.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *KnownAssets) 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 *KnownAssets) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *KnownAssets) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Assets) > 0 { + for iNdEx := len(m.Assets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Assets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *NoteSource) 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 *NoteSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NoteSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintChain(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SpendInfo) 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 *SpendInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpendInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SpendHeight != 0 { + i = encodeVarintChain(dAtA, i, uint64(m.SpendHeight)) + i-- + dAtA[i] = 0x10 + } + if m.NoteSource != nil { + { + size, err := m.NoteSource.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GenesisAppState) 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 *GenesisAppState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisAppState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Allocations) > 0 { + for iNdEx := len(m.Allocations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Allocations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Validators) > 0 { + for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.ChainParams != nil { + { + size, err := m.ChainParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GenesisAppState_Allocation) 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 *GenesisAppState_Allocation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisAppState_Allocation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Address != nil { + { + size, err := m.Address.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintChain(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x12 + } + if m.Amount != nil { + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Epoch) 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 *Epoch) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Epoch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.StartHeight != 0 { + i = encodeVarintChain(dAtA, i, uint64(m.StartHeight)) + i-- + dAtA[i] = 0x10 + } + if m.Index != 0 { + i = encodeVarintChain(dAtA, i, uint64(m.Index)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintChain(dAtA []byte, offset int, v uint64) int { + offset -= sovChain(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ChainParameters) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovChain(uint64(l)) + } + if m.EpochDuration != 0 { + n += 1 + sovChain(uint64(m.EpochDuration)) + } + if m.UnbondingEpochs != 0 { + n += 1 + sovChain(uint64(m.UnbondingEpochs)) + } + if m.ActiveValidatorLimit != 0 { + n += 1 + sovChain(uint64(m.ActiveValidatorLimit)) + } + if m.SlashingPenaltyMisbehavior != 0 { + n += 1 + sovChain(uint64(m.SlashingPenaltyMisbehavior)) + } + if m.IbcEnabled { + n += 2 + } + if m.InboundIcs20TransfersEnabled { + n += 2 + } + if m.OutboundIcs20TransfersEnabled { + n += 2 + } + if m.BaseRewardRate != 0 { + n += 1 + sovChain(uint64(m.BaseRewardRate)) + } + if m.SlashingPenaltyDowntime != 0 { + n += 1 + sovChain(uint64(m.SlashingPenaltyDowntime)) + } + if m.SignedBlocksWindowLen != 0 { + n += 1 + sovChain(uint64(m.SignedBlocksWindowLen)) + } + if m.MissedBlocksMaximum != 0 { + n += 1 + sovChain(uint64(m.MissedBlocksMaximum)) + } + if m.ProposalVotingBlocks != 0 { + n += 2 + sovChain(uint64(m.ProposalVotingBlocks)) + } + if m.ProposalDepositAmount != nil { + l = m.ProposalDepositAmount.Size() + n += 2 + l + sovChain(uint64(l)) + } + l = len(m.ProposalValidQuorum) + if l > 0 { + n += 2 + l + sovChain(uint64(l)) + } + l = len(m.ProposalPassThreshold) + if l > 0 { + n += 2 + l + sovChain(uint64(l)) + } + l = len(m.ProposalSlashThreshold) + if l > 0 { + n += 2 + l + sovChain(uint64(l)) + } + if m.DaoSpendProposalsEnabled { + n += 3 + } + return n +} + +func (m *Ratio) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Numerator != 0 { + n += 1 + sovChain(uint64(m.Numerator)) + } + if m.Denominator != 0 { + n += 1 + sovChain(uint64(m.Denominator)) + } + return n +} + +func (m *FmdParameters) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PrecisionBits != 0 { + n += 1 + sovChain(uint64(m.PrecisionBits)) + } + if m.AsOfBlockHeight != 0 { + n += 1 + sovChain(uint64(m.AsOfBlockHeight)) + } + return n +} + +func (m *AssetInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AssetId != nil { + l = m.AssetId.Size() + n += 1 + l + sovChain(uint64(l)) + } + if m.Denom != nil { + l = m.Denom.Size() + n += 1 + l + sovChain(uint64(l)) + } + if m.AsOfBlockHeight != 0 { + n += 1 + sovChain(uint64(m.AsOfBlockHeight)) + } + if m.TotalSupply != 0 { + n += 1 + sovChain(uint64(m.TotalSupply)) + } + return n +} + +func (m *CompactBlock) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Height != 0 { + n += 1 + sovChain(uint64(m.Height)) + } + if len(m.StatePayloads) > 0 { + for _, e := range m.StatePayloads { + l = e.Size() + n += 1 + l + sovChain(uint64(l)) + } + } + if len(m.Nullifiers) > 0 { + for _, e := range m.Nullifiers { + l = e.Size() + n += 1 + l + sovChain(uint64(l)) + } + } + if m.BlockRoot != nil { + l = m.BlockRoot.Size() + n += 1 + l + sovChain(uint64(l)) + } + if len(m.SwapOutputs) > 0 { + for _, e := range m.SwapOutputs { + l = e.Size() + n += 1 + l + sovChain(uint64(l)) + } + } + if m.ChainParameters != nil { + l = m.ChainParameters.Size() + n += 1 + l + sovChain(uint64(l)) + } + if m.EpochRoot != nil { + l = m.EpochRoot.Size() + n += 2 + l + sovChain(uint64(l)) + } + if m.ProposalStarted { + n += 3 + } + if m.FmdParameters != nil { + l = m.FmdParameters.Size() + n += 2 + l + sovChain(uint64(l)) + } + return n +} + +func (m *StatePayload) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StatePayload != nil { + n += m.StatePayload.Size() + } + return n +} + +func (m *StatePayload_RolledUp_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RolledUp != nil { + l = m.RolledUp.Size() + n += 1 + l + sovChain(uint64(l)) + } + return n +} +func (m *StatePayload_Note_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Note != nil { + l = m.Note.Size() + n += 1 + l + sovChain(uint64(l)) + } + return n +} +func (m *StatePayload_Swap_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Swap != nil { + l = m.Swap.Size() + n += 1 + l + sovChain(uint64(l)) + } + return n +} +func (m *StatePayload_RolledUp) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Commitment != nil { + l = m.Commitment.Size() + n += 1 + l + sovChain(uint64(l)) + } + return n +} + +func (m *StatePayload_Note) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Source != nil { + l = m.Source.Size() + n += 1 + l + sovChain(uint64(l)) + } + if m.Note != nil { + l = m.Note.Size() + n += 1 + l + sovChain(uint64(l)) + } + return n +} + +func (m *StatePayload_Swap) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Source != nil { + l = m.Source.Size() + n += 1 + l + sovChain(uint64(l)) + } + if m.Swap != nil { + l = m.Swap.Size() + n += 1 + l + sovChain(uint64(l)) + } + return n +} + +func (m *KnownAssets) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Assets) > 0 { + for _, e := range m.Assets { + l = e.Size() + n += 1 + l + sovChain(uint64(l)) + } + } + return n +} + +func (m *NoteSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovChain(uint64(l)) + } + return n +} + +func (m *SpendInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NoteSource != nil { + l = m.NoteSource.Size() + n += 1 + l + sovChain(uint64(l)) + } + if m.SpendHeight != 0 { + n += 1 + sovChain(uint64(m.SpendHeight)) + } + return n +} + +func (m *GenesisAppState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ChainParams != nil { + l = m.ChainParams.Size() + n += 1 + l + sovChain(uint64(l)) + } + if len(m.Validators) > 0 { + for _, e := range m.Validators { + l = e.Size() + n += 1 + l + sovChain(uint64(l)) + } + } + if len(m.Allocations) > 0 { + for _, e := range m.Allocations { + l = e.Size() + n += 1 + l + sovChain(uint64(l)) + } + } + return n +} + +func (m *GenesisAppState_Allocation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Amount != nil { + l = m.Amount.Size() + n += 1 + l + sovChain(uint64(l)) + } + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovChain(uint64(l)) + } + if m.Address != nil { + l = m.Address.Size() + n += 1 + l + sovChain(uint64(l)) + } + return n +} + +func (m *Epoch) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Index != 0 { + n += 1 + sovChain(uint64(m.Index)) + } + if m.StartHeight != 0 { + n += 1 + sovChain(uint64(m.StartHeight)) + } + return n +} + +func sovChain(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozChain(x uint64) (n int) { + return sovChain(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ChainParameters) 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 ErrIntOverflowChain + } + 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: ChainParameters: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChainParameters: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + 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 ErrInvalidLengthChain + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EpochDuration", wireType) + } + m.EpochDuration = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EpochDuration |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondingEpochs", wireType) + } + m.UnbondingEpochs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UnbondingEpochs |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ActiveValidatorLimit", wireType) + } + m.ActiveValidatorLimit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ActiveValidatorLimit |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SlashingPenaltyMisbehavior", wireType) + } + m.SlashingPenaltyMisbehavior = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SlashingPenaltyMisbehavior |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IbcEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IbcEnabled = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field InboundIcs20TransfersEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.InboundIcs20TransfersEnabled = bool(v != 0) + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OutboundIcs20TransfersEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.OutboundIcs20TransfersEnabled = bool(v != 0) + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseRewardRate", wireType) + } + m.BaseRewardRate = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BaseRewardRate |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SlashingPenaltyDowntime", wireType) + } + m.SlashingPenaltyDowntime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SlashingPenaltyDowntime |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SignedBlocksWindowLen", wireType) + } + m.SignedBlocksWindowLen = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SignedBlocksWindowLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MissedBlocksMaximum", wireType) + } + m.MissedBlocksMaximum = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MissedBlocksMaximum |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 20: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalVotingBlocks", wireType) + } + m.ProposalVotingBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalVotingBlocks |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalDepositAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ProposalDepositAmount == nil { + m.ProposalDepositAmount = &v1alpha1.Amount{} + } + if err := m.ProposalDepositAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 22: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalValidQuorum", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + 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 ErrInvalidLengthChain + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProposalValidQuorum = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 23: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalPassThreshold", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + 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 ErrInvalidLengthChain + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProposalPassThreshold = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 24: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalSlashThreshold", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + 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 ErrInvalidLengthChain + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProposalSlashThreshold = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 25: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DaoSpendProposalsEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DaoSpendProposalsEnabled = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipChain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthChain + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Ratio) 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 ErrIntOverflowChain + } + 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: Ratio: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Ratio: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Numerator", wireType) + } + m.Numerator = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Numerator |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Denominator", wireType) + } + m.Denominator = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Denominator |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipChain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthChain + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FmdParameters) 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 ErrIntOverflowChain + } + 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: FmdParameters: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FmdParameters: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PrecisionBits", wireType) + } + m.PrecisionBits = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PrecisionBits |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AsOfBlockHeight", wireType) + } + m.AsOfBlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AsOfBlockHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipChain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthChain + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AssetInfo) 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 ErrIntOverflowChain + } + 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: AssetInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AssetInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AssetId == nil { + m.AssetId = &v1alpha1.AssetId{} + } + if err := m.AssetId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Denom == nil { + m.Denom = &v1alpha1.Denom{} + } + if err := m.Denom.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AsOfBlockHeight", wireType) + } + m.AsOfBlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AsOfBlockHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalSupply", wireType) + } + m.TotalSupply = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalSupply |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipChain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthChain + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CompactBlock) 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 ErrIntOverflowChain + } + 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: CompactBlock: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompactBlock: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StatePayloads", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StatePayloads = append(m.StatePayloads, &StatePayload{}) + if err := m.StatePayloads[len(m.StatePayloads)-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 Nullifiers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Nullifiers = append(m.Nullifiers, &v1alpha1.Nullifier{}) + if err := m.Nullifiers[len(m.Nullifiers)-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 BlockRoot", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BlockRoot == nil { + m.BlockRoot = &v1alpha1.MerkleRoot{} + } + if err := m.BlockRoot.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SwapOutputs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SwapOutputs = append(m.SwapOutputs, &v1alpha11.BatchSwapOutputData{}) + if err := m.SwapOutputs[len(m.SwapOutputs)-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 ChainParameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ChainParameters == nil { + m.ChainParameters = &ChainParameters{} + } + if err := m.ChainParameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EpochRoot", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.EpochRoot == nil { + m.EpochRoot = &v1alpha1.MerkleRoot{} + } + if err := m.EpochRoot.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 20: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalStarted", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ProposalStarted = bool(v != 0) + case 100: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FmdParameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FmdParameters == nil { + m.FmdParameters = &FmdParameters{} + } + if err := m.FmdParameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipChain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthChain + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StatePayload) 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 ErrIntOverflowChain + } + 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: StatePayload: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StatePayload: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RolledUp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &StatePayload_RolledUp{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.StatePayload = &StatePayload_RolledUp_{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Note", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &StatePayload_Note{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.StatePayload = &StatePayload_Note_{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Swap", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &StatePayload_Swap{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.StatePayload = &StatePayload_Swap_{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipChain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthChain + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StatePayload_RolledUp) 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 ErrIntOverflowChain + } + 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: RolledUp: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RolledUp: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Commitment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Commitment == nil { + m.Commitment = &v1alpha1.StateCommitment{} + } + if err := m.Commitment.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipChain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthChain + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StatePayload_Note) 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 ErrIntOverflowChain + } + 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: Note: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Note: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Source == nil { + m.Source = &NoteSource{} + } + if err := m.Source.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Note", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Note == nil { + m.Note = &v1alpha1.NotePayload{} + } + if err := m.Note.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipChain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthChain + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StatePayload_Swap) 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 ErrIntOverflowChain + } + 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: Swap: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Swap: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Source == nil { + m.Source = &NoteSource{} + } + if err := m.Source.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Swap", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Swap == nil { + m.Swap = &v1alpha11.SwapPayload{} + } + if err := m.Swap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipChain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthChain + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *KnownAssets) 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 ErrIntOverflowChain + } + 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: KnownAssets: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: KnownAssets: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Assets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Assets = append(m.Assets, &v1alpha1.Asset{}) + if err := m.Assets[len(m.Assets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipChain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthChain + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NoteSource) 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 ErrIntOverflowChain + } + 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: NoteSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NoteSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthChain + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipChain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthChain + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SpendInfo) 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 ErrIntOverflowChain + } + 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: SpendInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SpendInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NoteSource", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NoteSource == nil { + m.NoteSource = &NoteSource{} + } + if err := m.NoteSource.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SpendHeight", wireType) + } + m.SpendHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SpendHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipChain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthChain + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GenesisAppState) 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 ErrIntOverflowChain + } + 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: GenesisAppState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisAppState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ChainParams == nil { + m.ChainParams = &ChainParameters{} + } + if err := m.ChainParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Validators = append(m.Validators, &v1alpha12.Validator{}) + if err := m.Validators[len(m.Validators)-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 Allocations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Allocations = append(m.Allocations, &GenesisAppState_Allocation{}) + if err := m.Allocations[len(m.Allocations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipChain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthChain + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GenesisAppState_Allocation) 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 ErrIntOverflowChain + } + 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: Allocation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Allocation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Amount == nil { + m.Amount = &v1alpha1.Amount{} + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + 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 ErrInvalidLengthChain + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Address == nil { + m.Address = &v1alpha1.Address{} + } + if err := m.Address.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipChain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthChain + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Epoch) 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 ErrIntOverflowChain + } + 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: Epoch: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Epoch: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + m.Index = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Index |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartHeight", wireType) + } + m.StartHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipChain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthChain + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipChain(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, ErrIntOverflowChain + } + 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, ErrIntOverflowChain + } + 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, ErrIntOverflowChain + } + 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, ErrInvalidLengthChain + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupChain + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthChain + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthChain = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowChain = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupChain = fmt.Errorf("proto: unexpected end of group") +) diff --git a/relayer/chains/penumbra/core/crypto/v1alpha1/crypto.pb.go b/relayer/chains/penumbra/core/crypto/v1alpha1/crypto.pb.go new file mode 100644 index 000000000..344a9012a --- /dev/null +++ b/relayer/chains/penumbra/core/crypto/v1alpha1/crypto.pb.go @@ -0,0 +1,9742 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: penumbra/core/crypto/v1alpha1/crypto.proto + +package cryptov1alpha1 + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/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 + +// Specifies fees paid by a transaction. +type Fee struct { + // The amount of the token used to pay fees. + Amount *Amount `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount,omitempty"` + // If present, the asset ID of the token used to pay fees. + // If absent, specifies the staking token implicitly. + AssetId *AssetId `protobuf:"bytes,2,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` +} + +func (m *Fee) Reset() { *m = Fee{} } +func (m *Fee) String() string { return proto.CompactTextString(m) } +func (*Fee) ProtoMessage() {} +func (*Fee) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{0} +} +func (m *Fee) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Fee) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Fee.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 *Fee) XXX_Merge(src proto.Message) { + xxx_messageInfo_Fee.Merge(m, src) +} +func (m *Fee) XXX_Size() int { + return m.Size() +} +func (m *Fee) XXX_DiscardUnknown() { + xxx_messageInfo_Fee.DiscardUnknown(m) +} + +var xxx_messageInfo_Fee proto.InternalMessageInfo + +func (m *Fee) GetAmount() *Amount { + if m != nil { + return m.Amount + } + return nil +} + +func (m *Fee) GetAssetId() *AssetId { + if m != nil { + return m.AssetId + } + return nil +} + +type Address struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *Address) Reset() { *m = Address{} } +func (m *Address) String() string { return proto.CompactTextString(m) } +func (*Address) ProtoMessage() {} +func (*Address) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{1} +} +func (m *Address) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Address) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Address.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 *Address) XXX_Merge(src proto.Message) { + xxx_messageInfo_Address.Merge(m, src) +} +func (m *Address) XXX_Size() int { + return m.Size() +} +func (m *Address) XXX_DiscardUnknown() { + xxx_messageInfo_Address.DiscardUnknown(m) +} + +var xxx_messageInfo_Address proto.InternalMessageInfo + +func (m *Address) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +type AddressView struct { + // Types that are valid to be assigned to AddressView: + // + // *AddressView_Visible_ + // *AddressView_Opaque_ + AddressView isAddressView_AddressView `protobuf_oneof:"address_view"` +} + +func (m *AddressView) Reset() { *m = AddressView{} } +func (m *AddressView) String() string { return proto.CompactTextString(m) } +func (*AddressView) ProtoMessage() {} +func (*AddressView) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{2} +} +func (m *AddressView) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddressView) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddressView.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 *AddressView) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddressView.Merge(m, src) +} +func (m *AddressView) XXX_Size() int { + return m.Size() +} +func (m *AddressView) XXX_DiscardUnknown() { + xxx_messageInfo_AddressView.DiscardUnknown(m) +} + +var xxx_messageInfo_AddressView proto.InternalMessageInfo + +type isAddressView_AddressView interface { + isAddressView_AddressView() + MarshalTo([]byte) (int, error) + Size() int +} + +type AddressView_Visible_ struct { + Visible *AddressView_Visible `protobuf:"bytes,1,opt,name=visible,proto3,oneof" json:"visible,omitempty"` +} +type AddressView_Opaque_ struct { + Opaque *AddressView_Opaque `protobuf:"bytes,2,opt,name=opaque,proto3,oneof" json:"opaque,omitempty"` +} + +func (*AddressView_Visible_) isAddressView_AddressView() {} +func (*AddressView_Opaque_) isAddressView_AddressView() {} + +func (m *AddressView) GetAddressView() isAddressView_AddressView { + if m != nil { + return m.AddressView + } + return nil +} + +func (m *AddressView) GetVisible() *AddressView_Visible { + if x, ok := m.GetAddressView().(*AddressView_Visible_); ok { + return x.Visible + } + return nil +} + +func (m *AddressView) GetOpaque() *AddressView_Opaque { + if x, ok := m.GetAddressView().(*AddressView_Opaque_); ok { + return x.Opaque + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*AddressView) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*AddressView_Visible_)(nil), + (*AddressView_Opaque_)(nil), + } +} + +type AddressView_Visible struct { + Address *Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Index *AddressIndex `protobuf:"bytes,2,opt,name=index,proto3" json:"index,omitempty"` + AccountGroupId *AccountGroupId `protobuf:"bytes,3,opt,name=account_group_id,json=accountGroupId,proto3" json:"account_group_id,omitempty"` +} + +func (m *AddressView_Visible) Reset() { *m = AddressView_Visible{} } +func (m *AddressView_Visible) String() string { return proto.CompactTextString(m) } +func (*AddressView_Visible) ProtoMessage() {} +func (*AddressView_Visible) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{2, 0} +} +func (m *AddressView_Visible) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddressView_Visible) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddressView_Visible.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 *AddressView_Visible) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddressView_Visible.Merge(m, src) +} +func (m *AddressView_Visible) XXX_Size() int { + return m.Size() +} +func (m *AddressView_Visible) XXX_DiscardUnknown() { + xxx_messageInfo_AddressView_Visible.DiscardUnknown(m) +} + +var xxx_messageInfo_AddressView_Visible proto.InternalMessageInfo + +func (m *AddressView_Visible) GetAddress() *Address { + if m != nil { + return m.Address + } + return nil +} + +func (m *AddressView_Visible) GetIndex() *AddressIndex { + if m != nil { + return m.Index + } + return nil +} + +func (m *AddressView_Visible) GetAccountGroupId() *AccountGroupId { + if m != nil { + return m.AccountGroupId + } + return nil +} + +type AddressView_Opaque struct { + Address *Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *AddressView_Opaque) Reset() { *m = AddressView_Opaque{} } +func (m *AddressView_Opaque) String() string { return proto.CompactTextString(m) } +func (*AddressView_Opaque) ProtoMessage() {} +func (*AddressView_Opaque) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{2, 1} +} +func (m *AddressView_Opaque) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddressView_Opaque) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddressView_Opaque.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 *AddressView_Opaque) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddressView_Opaque.Merge(m, src) +} +func (m *AddressView_Opaque) XXX_Size() int { + return m.Size() +} +func (m *AddressView_Opaque) XXX_DiscardUnknown() { + xxx_messageInfo_AddressView_Opaque.DiscardUnknown(m) +} + +var xxx_messageInfo_AddressView_Opaque proto.InternalMessageInfo + +func (m *AddressView_Opaque) GetAddress() *Address { + if m != nil { + return m.Address + } + return nil +} + +type SpendKey struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *SpendKey) Reset() { *m = SpendKey{} } +func (m *SpendKey) String() string { return proto.CompactTextString(m) } +func (*SpendKey) ProtoMessage() {} +func (*SpendKey) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{3} +} +func (m *SpendKey) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SpendKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SpendKey.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 *SpendKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpendKey.Merge(m, src) +} +func (m *SpendKey) XXX_Size() int { + return m.Size() +} +func (m *SpendKey) XXX_DiscardUnknown() { + xxx_messageInfo_SpendKey.DiscardUnknown(m) +} + +var xxx_messageInfo_SpendKey proto.InternalMessageInfo + +func (m *SpendKey) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +type SpendVerificationKey struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *SpendVerificationKey) Reset() { *m = SpendVerificationKey{} } +func (m *SpendVerificationKey) String() string { return proto.CompactTextString(m) } +func (*SpendVerificationKey) ProtoMessage() {} +func (*SpendVerificationKey) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{4} +} +func (m *SpendVerificationKey) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SpendVerificationKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SpendVerificationKey.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 *SpendVerificationKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpendVerificationKey.Merge(m, src) +} +func (m *SpendVerificationKey) XXX_Size() int { + return m.Size() +} +func (m *SpendVerificationKey) XXX_DiscardUnknown() { + xxx_messageInfo_SpendVerificationKey.DiscardUnknown(m) +} + +var xxx_messageInfo_SpendVerificationKey proto.InternalMessageInfo + +func (m *SpendVerificationKey) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +type FullViewingKey struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *FullViewingKey) Reset() { *m = FullViewingKey{} } +func (m *FullViewingKey) String() string { return proto.CompactTextString(m) } +func (*FullViewingKey) ProtoMessage() {} +func (*FullViewingKey) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{5} +} +func (m *FullViewingKey) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FullViewingKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FullViewingKey.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 *FullViewingKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_FullViewingKey.Merge(m, src) +} +func (m *FullViewingKey) XXX_Size() int { + return m.Size() +} +func (m *FullViewingKey) XXX_DiscardUnknown() { + xxx_messageInfo_FullViewingKey.DiscardUnknown(m) +} + +var xxx_messageInfo_FullViewingKey proto.InternalMessageInfo + +func (m *FullViewingKey) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +type AccountGroupId struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *AccountGroupId) Reset() { *m = AccountGroupId{} } +func (m *AccountGroupId) String() string { return proto.CompactTextString(m) } +func (*AccountGroupId) ProtoMessage() {} +func (*AccountGroupId) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{6} +} +func (m *AccountGroupId) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AccountGroupId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AccountGroupId.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 *AccountGroupId) XXX_Merge(src proto.Message) { + xxx_messageInfo_AccountGroupId.Merge(m, src) +} +func (m *AccountGroupId) XXX_Size() int { + return m.Size() +} +func (m *AccountGroupId) XXX_DiscardUnknown() { + xxx_messageInfo_AccountGroupId.DiscardUnknown(m) +} + +var xxx_messageInfo_AccountGroupId proto.InternalMessageInfo + +func (m *AccountGroupId) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +type Diversifier struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *Diversifier) Reset() { *m = Diversifier{} } +func (m *Diversifier) String() string { return proto.CompactTextString(m) } +func (*Diversifier) ProtoMessage() {} +func (*Diversifier) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{7} +} +func (m *Diversifier) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Diversifier) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Diversifier.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 *Diversifier) XXX_Merge(src proto.Message) { + xxx_messageInfo_Diversifier.Merge(m, src) +} +func (m *Diversifier) XXX_Size() int { + return m.Size() +} +func (m *Diversifier) XXX_DiscardUnknown() { + xxx_messageInfo_Diversifier.DiscardUnknown(m) +} + +var xxx_messageInfo_Diversifier proto.InternalMessageInfo + +func (m *Diversifier) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +type AddressIndex struct { + Account uint32 `protobuf:"varint,2,opt,name=account,proto3" json:"account,omitempty"` + Randomizer []byte `protobuf:"bytes,3,opt,name=randomizer,proto3" json:"randomizer,omitempty"` +} + +func (m *AddressIndex) Reset() { *m = AddressIndex{} } +func (m *AddressIndex) String() string { return proto.CompactTextString(m) } +func (*AddressIndex) ProtoMessage() {} +func (*AddressIndex) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{8} +} +func (m *AddressIndex) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddressIndex) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddressIndex.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 *AddressIndex) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddressIndex.Merge(m, src) +} +func (m *AddressIndex) XXX_Size() int { + return m.Size() +} +func (m *AddressIndex) XXX_DiscardUnknown() { + xxx_messageInfo_AddressIndex.DiscardUnknown(m) +} + +var xxx_messageInfo_AddressIndex proto.InternalMessageInfo + +func (m *AddressIndex) GetAccount() uint32 { + if m != nil { + return m.Account + } + return 0 +} + +func (m *AddressIndex) GetRandomizer() []byte { + if m != nil { + return m.Randomizer + } + return nil +} + +type StateCommitment struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *StateCommitment) Reset() { *m = StateCommitment{} } +func (m *StateCommitment) String() string { return proto.CompactTextString(m) } +func (*StateCommitment) ProtoMessage() {} +func (*StateCommitment) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{9} +} +func (m *StateCommitment) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StateCommitment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StateCommitment.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 *StateCommitment) XXX_Merge(src proto.Message) { + xxx_messageInfo_StateCommitment.Merge(m, src) +} +func (m *StateCommitment) XXX_Size() int { + return m.Size() +} +func (m *StateCommitment) XXX_DiscardUnknown() { + xxx_messageInfo_StateCommitment.DiscardUnknown(m) +} + +var xxx_messageInfo_StateCommitment proto.InternalMessageInfo + +func (m *StateCommitment) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +type BalanceCommitment struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *BalanceCommitment) Reset() { *m = BalanceCommitment{} } +func (m *BalanceCommitment) String() string { return proto.CompactTextString(m) } +func (*BalanceCommitment) ProtoMessage() {} +func (*BalanceCommitment) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{10} +} +func (m *BalanceCommitment) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BalanceCommitment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BalanceCommitment.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 *BalanceCommitment) XXX_Merge(src proto.Message) { + xxx_messageInfo_BalanceCommitment.Merge(m, src) +} +func (m *BalanceCommitment) XXX_Size() int { + return m.Size() +} +func (m *BalanceCommitment) XXX_DiscardUnknown() { + xxx_messageInfo_BalanceCommitment.DiscardUnknown(m) +} + +var xxx_messageInfo_BalanceCommitment proto.InternalMessageInfo + +func (m *BalanceCommitment) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +type AssetId struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *AssetId) Reset() { *m = AssetId{} } +func (m *AssetId) String() string { return proto.CompactTextString(m) } +func (*AssetId) ProtoMessage() {} +func (*AssetId) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{11} +} +func (m *AssetId) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AssetId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AssetId.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 *AssetId) XXX_Merge(src proto.Message) { + xxx_messageInfo_AssetId.Merge(m, src) +} +func (m *AssetId) XXX_Size() int { + return m.Size() +} +func (m *AssetId) XXX_DiscardUnknown() { + xxx_messageInfo_AssetId.DiscardUnknown(m) +} + +var xxx_messageInfo_AssetId proto.InternalMessageInfo + +func (m *AssetId) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +type Amount struct { + Lo uint64 `protobuf:"varint,1,opt,name=lo,proto3" json:"lo,omitempty"` + Hi uint64 `protobuf:"varint,2,opt,name=hi,proto3" json:"hi,omitempty"` +} + +func (m *Amount) Reset() { *m = Amount{} } +func (m *Amount) String() string { return proto.CompactTextString(m) } +func (*Amount) ProtoMessage() {} +func (*Amount) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{12} +} +func (m *Amount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Amount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Amount.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 *Amount) XXX_Merge(src proto.Message) { + xxx_messageInfo_Amount.Merge(m, src) +} +func (m *Amount) XXX_Size() int { + return m.Size() +} +func (m *Amount) XXX_DiscardUnknown() { + xxx_messageInfo_Amount.DiscardUnknown(m) +} + +var xxx_messageInfo_Amount proto.InternalMessageInfo + +func (m *Amount) GetLo() uint64 { + if m != nil { + return m.Lo + } + return 0 +} + +func (m *Amount) GetHi() uint64 { + if m != nil { + return m.Hi + } + return 0 +} + +type Denom struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` +} + +func (m *Denom) Reset() { *m = Denom{} } +func (m *Denom) String() string { return proto.CompactTextString(m) } +func (*Denom) ProtoMessage() {} +func (*Denom) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{13} +} +func (m *Denom) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Denom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Denom.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 *Denom) XXX_Merge(src proto.Message) { + xxx_messageInfo_Denom.Merge(m, src) +} +func (m *Denom) XXX_Size() int { + return m.Size() +} +func (m *Denom) XXX_DiscardUnknown() { + xxx_messageInfo_Denom.DiscardUnknown(m) +} + +var xxx_messageInfo_Denom proto.InternalMessageInfo + +func (m *Denom) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +// DenomMetadata represents a struct that describes a basic token. +type DenomMetadata struct { + Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` + // denom_units represents the list of DenomUnit's for a given coin + DenomUnits []*DenomUnit `protobuf:"bytes,2,rep,name=denom_units,json=denomUnits,proto3" json:"denom_units,omitempty"` + // base represents the base denom (should be the DenomUnit with exponent = 0). + Base string `protobuf:"bytes,3,opt,name=base,proto3" json:"base,omitempty"` + // display indicates the suggested denom that should be + // displayed in clients. + Display string `protobuf:"bytes,4,opt,name=display,proto3" json:"display,omitempty"` + // name defines the name of the token (eg: Cosmos Atom) + Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` + // symbol is the token symbol usually shown on exchanges (eg: ATOM). This can + // be the same as the display. + Symbol string `protobuf:"bytes,6,opt,name=symbol,proto3" json:"symbol,omitempty"` + // URI to a document (on or off-chain) that contains additional information. Optional. + Uri string `protobuf:"bytes,7,opt,name=uri,proto3" json:"uri,omitempty"` + // URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + // the document didn't change. Optional. + UriHash string `protobuf:"bytes,8,opt,name=uri_hash,json=uriHash,proto3" json:"uri_hash,omitempty"` + // the asset ID on Penumbra for this denomination. + PenumbraAssetId *AssetId `protobuf:"bytes,1984,opt,name=penumbra_asset_id,json=penumbraAssetId,proto3" json:"penumbra_asset_id,omitempty"` +} + +func (m *DenomMetadata) Reset() { *m = DenomMetadata{} } +func (m *DenomMetadata) String() string { return proto.CompactTextString(m) } +func (*DenomMetadata) ProtoMessage() {} +func (*DenomMetadata) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{14} +} +func (m *DenomMetadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DenomMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DenomMetadata.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 *DenomMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_DenomMetadata.Merge(m, src) +} +func (m *DenomMetadata) XXX_Size() int { + return m.Size() +} +func (m *DenomMetadata) XXX_DiscardUnknown() { + xxx_messageInfo_DenomMetadata.DiscardUnknown(m) +} + +var xxx_messageInfo_DenomMetadata proto.InternalMessageInfo + +func (m *DenomMetadata) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *DenomMetadata) GetDenomUnits() []*DenomUnit { + if m != nil { + return m.DenomUnits + } + return nil +} + +func (m *DenomMetadata) GetBase() string { + if m != nil { + return m.Base + } + return "" +} + +func (m *DenomMetadata) GetDisplay() string { + if m != nil { + return m.Display + } + return "" +} + +func (m *DenomMetadata) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *DenomMetadata) GetSymbol() string { + if m != nil { + return m.Symbol + } + return "" +} + +func (m *DenomMetadata) GetUri() string { + if m != nil { + return m.Uri + } + return "" +} + +func (m *DenomMetadata) GetUriHash() string { + if m != nil { + return m.UriHash + } + return "" +} + +func (m *DenomMetadata) GetPenumbraAssetId() *AssetId { + if m != nil { + return m.PenumbraAssetId + } + return nil +} + +// DenomUnit represents a struct that describes a given denomination unit of the basic token. +type DenomUnit struct { + // denom represents the string name of the given denom unit (e.g uatom). + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + // exponent represents power of 10 exponent that one must + // raise the base_denom to in order to equal the given DenomUnit's denom + // 1 denom = 10^exponent base_denom + // (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with + // exponent = 6, thus: 1 atom = 10^6 uatom). + Exponent uint32 `protobuf:"varint,2,opt,name=exponent,proto3" json:"exponent,omitempty"` + // aliases is a list of string aliases for the given denom + Aliases []string `protobuf:"bytes,3,rep,name=aliases,proto3" json:"aliases,omitempty"` +} + +func (m *DenomUnit) Reset() { *m = DenomUnit{} } +func (m *DenomUnit) String() string { return proto.CompactTextString(m) } +func (*DenomUnit) ProtoMessage() {} +func (*DenomUnit) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{15} +} +func (m *DenomUnit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DenomUnit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DenomUnit.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 *DenomUnit) XXX_Merge(src proto.Message) { + xxx_messageInfo_DenomUnit.Merge(m, src) +} +func (m *DenomUnit) XXX_Size() int { + return m.Size() +} +func (m *DenomUnit) XXX_DiscardUnknown() { + xxx_messageInfo_DenomUnit.DiscardUnknown(m) +} + +var xxx_messageInfo_DenomUnit proto.InternalMessageInfo + +func (m *DenomUnit) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *DenomUnit) GetExponent() uint32 { + if m != nil { + return m.Exponent + } + return 0 +} + +func (m *DenomUnit) GetAliases() []string { + if m != nil { + return m.Aliases + } + return nil +} + +type Value struct { + Amount *Amount `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount,omitempty"` + AssetId *AssetId `protobuf:"bytes,2,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` +} + +func (m *Value) Reset() { *m = Value{} } +func (m *Value) String() string { return proto.CompactTextString(m) } +func (*Value) ProtoMessage() {} +func (*Value) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{16} +} +func (m *Value) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Value.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 *Value) XXX_Merge(src proto.Message) { + xxx_messageInfo_Value.Merge(m, src) +} +func (m *Value) XXX_Size() int { + return m.Size() +} +func (m *Value) XXX_DiscardUnknown() { + xxx_messageInfo_Value.DiscardUnknown(m) +} + +var xxx_messageInfo_Value proto.InternalMessageInfo + +func (m *Value) GetAmount() *Amount { + if m != nil { + return m.Amount + } + return nil +} + +func (m *Value) GetAssetId() *AssetId { + if m != nil { + return m.AssetId + } + return nil +} + +// Represents a value of a known or unknown denomination. +// +// Note: unlike some other View types, we don't just store the underlying +// `Value` message together with an additional `Denom`. Instead, we record +// either an `Amount` and `Denom` (only) or an `Amount` and `AssetId`. This is +// because we don't want to allow a situation where the supplied `Denom` doesn't +// match the `AssetId`, and a consumer of the API that doesn't check is tricked. +// This way, the `Denom` will always match, because the consumer is forced to +// recompute it themselves if they want it. +type ValueView struct { + // Types that are valid to be assigned to ValueView: + // + // *ValueView_KnownDenom_ + // *ValueView_UnknownDenom_ + ValueView isValueView_ValueView `protobuf_oneof:"value_view"` +} + +func (m *ValueView) Reset() { *m = ValueView{} } +func (m *ValueView) String() string { return proto.CompactTextString(m) } +func (*ValueView) ProtoMessage() {} +func (*ValueView) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{17} +} +func (m *ValueView) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValueView) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValueView.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 *ValueView) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValueView.Merge(m, src) +} +func (m *ValueView) XXX_Size() int { + return m.Size() +} +func (m *ValueView) XXX_DiscardUnknown() { + xxx_messageInfo_ValueView.DiscardUnknown(m) +} + +var xxx_messageInfo_ValueView proto.InternalMessageInfo + +type isValueView_ValueView interface { + isValueView_ValueView() + MarshalTo([]byte) (int, error) + Size() int +} + +type ValueView_KnownDenom_ struct { + KnownDenom *ValueView_KnownDenom `protobuf:"bytes,1,opt,name=known_denom,json=knownDenom,proto3,oneof" json:"known_denom,omitempty"` +} +type ValueView_UnknownDenom_ struct { + UnknownDenom *ValueView_UnknownDenom `protobuf:"bytes,2,opt,name=unknown_denom,json=unknownDenom,proto3,oneof" json:"unknown_denom,omitempty"` +} + +func (*ValueView_KnownDenom_) isValueView_ValueView() {} +func (*ValueView_UnknownDenom_) isValueView_ValueView() {} + +func (m *ValueView) GetValueView() isValueView_ValueView { + if m != nil { + return m.ValueView + } + return nil +} + +func (m *ValueView) GetKnownDenom() *ValueView_KnownDenom { + if x, ok := m.GetValueView().(*ValueView_KnownDenom_); ok { + return x.KnownDenom + } + return nil +} + +func (m *ValueView) GetUnknownDenom() *ValueView_UnknownDenom { + if x, ok := m.GetValueView().(*ValueView_UnknownDenom_); ok { + return x.UnknownDenom + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*ValueView) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*ValueView_KnownDenom_)(nil), + (*ValueView_UnknownDenom_)(nil), + } +} + +// A value whose asset ID has a known denomination. +type ValueView_KnownDenom struct { + Amount *Amount `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount,omitempty"` + Denom *DenomMetadata `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` +} + +func (m *ValueView_KnownDenom) Reset() { *m = ValueView_KnownDenom{} } +func (m *ValueView_KnownDenom) String() string { return proto.CompactTextString(m) } +func (*ValueView_KnownDenom) ProtoMessage() {} +func (*ValueView_KnownDenom) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{17, 0} +} +func (m *ValueView_KnownDenom) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValueView_KnownDenom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValueView_KnownDenom.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 *ValueView_KnownDenom) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValueView_KnownDenom.Merge(m, src) +} +func (m *ValueView_KnownDenom) XXX_Size() int { + return m.Size() +} +func (m *ValueView_KnownDenom) XXX_DiscardUnknown() { + xxx_messageInfo_ValueView_KnownDenom.DiscardUnknown(m) +} + +var xxx_messageInfo_ValueView_KnownDenom proto.InternalMessageInfo + +func (m *ValueView_KnownDenom) GetAmount() *Amount { + if m != nil { + return m.Amount + } + return nil +} + +func (m *ValueView_KnownDenom) GetDenom() *DenomMetadata { + if m != nil { + return m.Denom + } + return nil +} + +type ValueView_UnknownDenom struct { + Amount *Amount `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount,omitempty"` + AssetId *AssetId `protobuf:"bytes,2,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` +} + +func (m *ValueView_UnknownDenom) Reset() { *m = ValueView_UnknownDenom{} } +func (m *ValueView_UnknownDenom) String() string { return proto.CompactTextString(m) } +func (*ValueView_UnknownDenom) ProtoMessage() {} +func (*ValueView_UnknownDenom) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{17, 1} +} +func (m *ValueView_UnknownDenom) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValueView_UnknownDenom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValueView_UnknownDenom.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 *ValueView_UnknownDenom) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValueView_UnknownDenom.Merge(m, src) +} +func (m *ValueView_UnknownDenom) XXX_Size() int { + return m.Size() +} +func (m *ValueView_UnknownDenom) XXX_DiscardUnknown() { + xxx_messageInfo_ValueView_UnknownDenom.DiscardUnknown(m) +} + +var xxx_messageInfo_ValueView_UnknownDenom proto.InternalMessageInfo + +func (m *ValueView_UnknownDenom) GetAmount() *Amount { + if m != nil { + return m.Amount + } + return nil +} + +func (m *ValueView_UnknownDenom) GetAssetId() *AssetId { + if m != nil { + return m.AssetId + } + return nil +} + +type MerkleRoot struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *MerkleRoot) Reset() { *m = MerkleRoot{} } +func (m *MerkleRoot) String() string { return proto.CompactTextString(m) } +func (*MerkleRoot) ProtoMessage() {} +func (*MerkleRoot) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{18} +} +func (m *MerkleRoot) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MerkleRoot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MerkleRoot.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 *MerkleRoot) XXX_Merge(src proto.Message) { + xxx_messageInfo_MerkleRoot.Merge(m, src) +} +func (m *MerkleRoot) XXX_Size() int { + return m.Size() +} +func (m *MerkleRoot) XXX_DiscardUnknown() { + xxx_messageInfo_MerkleRoot.DiscardUnknown(m) +} + +var xxx_messageInfo_MerkleRoot proto.InternalMessageInfo + +func (m *MerkleRoot) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +type Asset struct { + Id *AssetId `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Denom *Denom `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` +} + +func (m *Asset) Reset() { *m = Asset{} } +func (m *Asset) String() string { return proto.CompactTextString(m) } +func (*Asset) ProtoMessage() {} +func (*Asset) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{19} +} +func (m *Asset) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Asset) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Asset.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 *Asset) XXX_Merge(src proto.Message) { + xxx_messageInfo_Asset.Merge(m, src) +} +func (m *Asset) XXX_Size() int { + return m.Size() +} +func (m *Asset) XXX_DiscardUnknown() { + xxx_messageInfo_Asset.DiscardUnknown(m) +} + +var xxx_messageInfo_Asset proto.InternalMessageInfo + +func (m *Asset) GetId() *AssetId { + if m != nil { + return m.Id + } + return nil +} + +func (m *Asset) GetDenom() *Denom { + if m != nil { + return m.Denom + } + return nil +} + +// A validator's identity key (decaf377-rdsa spendauth verification key). +type IdentityKey struct { + Ik []byte `protobuf:"bytes,1,opt,name=ik,proto3" json:"ik,omitempty"` +} + +func (m *IdentityKey) Reset() { *m = IdentityKey{} } +func (m *IdentityKey) String() string { return proto.CompactTextString(m) } +func (*IdentityKey) ProtoMessage() {} +func (*IdentityKey) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{20} +} +func (m *IdentityKey) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IdentityKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IdentityKey.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 *IdentityKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_IdentityKey.Merge(m, src) +} +func (m *IdentityKey) XXX_Size() int { + return m.Size() +} +func (m *IdentityKey) XXX_DiscardUnknown() { + xxx_messageInfo_IdentityKey.DiscardUnknown(m) +} + +var xxx_messageInfo_IdentityKey proto.InternalMessageInfo + +func (m *IdentityKey) GetIk() []byte { + if m != nil { + return m.Ik + } + return nil +} + +// A validator's governance key (decaf377-rdsa spendauth verification key). +type GovernanceKey struct { + Gk []byte `protobuf:"bytes,1,opt,name=gk,proto3" json:"gk,omitempty"` +} + +func (m *GovernanceKey) Reset() { *m = GovernanceKey{} } +func (m *GovernanceKey) String() string { return proto.CompactTextString(m) } +func (*GovernanceKey) ProtoMessage() {} +func (*GovernanceKey) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{21} +} +func (m *GovernanceKey) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GovernanceKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GovernanceKey.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 *GovernanceKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_GovernanceKey.Merge(m, src) +} +func (m *GovernanceKey) XXX_Size() int { + return m.Size() +} +func (m *GovernanceKey) XXX_DiscardUnknown() { + xxx_messageInfo_GovernanceKey.DiscardUnknown(m) +} + +var xxx_messageInfo_GovernanceKey proto.InternalMessageInfo + +func (m *GovernanceKey) GetGk() []byte { + if m != nil { + return m.Gk + } + return nil +} + +type ConsensusKey struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *ConsensusKey) Reset() { *m = ConsensusKey{} } +func (m *ConsensusKey) String() string { return proto.CompactTextString(m) } +func (*ConsensusKey) ProtoMessage() {} +func (*ConsensusKey) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{22} +} +func (m *ConsensusKey) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConsensusKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConsensusKey.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 *ConsensusKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsensusKey.Merge(m, src) +} +func (m *ConsensusKey) XXX_Size() int { + return m.Size() +} +func (m *ConsensusKey) XXX_DiscardUnknown() { + xxx_messageInfo_ConsensusKey.DiscardUnknown(m) +} + +var xxx_messageInfo_ConsensusKey proto.InternalMessageInfo + +func (m *ConsensusKey) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +type Note struct { + Value *Value `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + Rseed []byte `protobuf:"bytes,2,opt,name=rseed,proto3" json:"rseed,omitempty"` + Address *Address `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *Note) Reset() { *m = Note{} } +func (m *Note) String() string { return proto.CompactTextString(m) } +func (*Note) ProtoMessage() {} +func (*Note) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{23} +} +func (m *Note) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Note) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Note.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 *Note) XXX_Merge(src proto.Message) { + xxx_messageInfo_Note.Merge(m, src) +} +func (m *Note) XXX_Size() int { + return m.Size() +} +func (m *Note) XXX_DiscardUnknown() { + xxx_messageInfo_Note.DiscardUnknown(m) +} + +var xxx_messageInfo_Note proto.InternalMessageInfo + +func (m *Note) GetValue() *Value { + if m != nil { + return m.Value + } + return nil +} + +func (m *Note) GetRseed() []byte { + if m != nil { + return m.Rseed + } + return nil +} + +func (m *Note) GetAddress() *Address { + if m != nil { + return m.Address + } + return nil +} + +type NoteView struct { + Value *ValueView `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + Rseed []byte `protobuf:"bytes,2,opt,name=rseed,proto3" json:"rseed,omitempty"` + Address *AddressView `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *NoteView) Reset() { *m = NoteView{} } +func (m *NoteView) String() string { return proto.CompactTextString(m) } +func (*NoteView) ProtoMessage() {} +func (*NoteView) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{24} +} +func (m *NoteView) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NoteView) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NoteView.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 *NoteView) XXX_Merge(src proto.Message) { + xxx_messageInfo_NoteView.Merge(m, src) +} +func (m *NoteView) XXX_Size() int { + return m.Size() +} +func (m *NoteView) XXX_DiscardUnknown() { + xxx_messageInfo_NoteView.DiscardUnknown(m) +} + +var xxx_messageInfo_NoteView proto.InternalMessageInfo + +func (m *NoteView) GetValue() *ValueView { + if m != nil { + return m.Value + } + return nil +} + +func (m *NoteView) GetRseed() []byte { + if m != nil { + return m.Rseed + } + return nil +} + +func (m *NoteView) GetAddress() *AddressView { + if m != nil { + return m.Address + } + return nil +} + +// An encrypted note. +// 132 = 1(type) + 11(d) + 8(amount) + 32(asset_id) + 32(rcm) + 32(pk_d) + 16(MAC) bytes. +type NoteCiphertext struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *NoteCiphertext) Reset() { *m = NoteCiphertext{} } +func (m *NoteCiphertext) String() string { return proto.CompactTextString(m) } +func (*NoteCiphertext) ProtoMessage() {} +func (*NoteCiphertext) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{25} +} +func (m *NoteCiphertext) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NoteCiphertext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NoteCiphertext.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 *NoteCiphertext) XXX_Merge(src proto.Message) { + xxx_messageInfo_NoteCiphertext.Merge(m, src) +} +func (m *NoteCiphertext) XXX_Size() int { + return m.Size() +} +func (m *NoteCiphertext) XXX_DiscardUnknown() { + xxx_messageInfo_NoteCiphertext.DiscardUnknown(m) +} + +var xxx_messageInfo_NoteCiphertext proto.InternalMessageInfo + +func (m *NoteCiphertext) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +type Nullifier struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *Nullifier) Reset() { *m = Nullifier{} } +func (m *Nullifier) String() string { return proto.CompactTextString(m) } +func (*Nullifier) ProtoMessage() {} +func (*Nullifier) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{26} +} +func (m *Nullifier) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Nullifier) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Nullifier.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 *Nullifier) XXX_Merge(src proto.Message) { + xxx_messageInfo_Nullifier.Merge(m, src) +} +func (m *Nullifier) XXX_Size() int { + return m.Size() +} +func (m *Nullifier) XXX_DiscardUnknown() { + xxx_messageInfo_Nullifier.DiscardUnknown(m) +} + +var xxx_messageInfo_Nullifier proto.InternalMessageInfo + +func (m *Nullifier) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +type SpendAuthSignature struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *SpendAuthSignature) Reset() { *m = SpendAuthSignature{} } +func (m *SpendAuthSignature) String() string { return proto.CompactTextString(m) } +func (*SpendAuthSignature) ProtoMessage() {} +func (*SpendAuthSignature) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{27} +} +func (m *SpendAuthSignature) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SpendAuthSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SpendAuthSignature.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 *SpendAuthSignature) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpendAuthSignature.Merge(m, src) +} +func (m *SpendAuthSignature) XXX_Size() int { + return m.Size() +} +func (m *SpendAuthSignature) XXX_DiscardUnknown() { + xxx_messageInfo_SpendAuthSignature.DiscardUnknown(m) +} + +var xxx_messageInfo_SpendAuthSignature proto.InternalMessageInfo + +func (m *SpendAuthSignature) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +type BindingSignature struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *BindingSignature) Reset() { *m = BindingSignature{} } +func (m *BindingSignature) String() string { return proto.CompactTextString(m) } +func (*BindingSignature) ProtoMessage() {} +func (*BindingSignature) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{28} +} +func (m *BindingSignature) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BindingSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BindingSignature.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 *BindingSignature) XXX_Merge(src proto.Message) { + xxx_messageInfo_BindingSignature.Merge(m, src) +} +func (m *BindingSignature) XXX_Size() int { + return m.Size() +} +func (m *BindingSignature) XXX_DiscardUnknown() { + xxx_messageInfo_BindingSignature.DiscardUnknown(m) +} + +var xxx_messageInfo_BindingSignature proto.InternalMessageInfo + +func (m *BindingSignature) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +// The body of an output description, including only the minimal +// data required to scan and process the output. +type NotePayload struct { + // The note commitment for the output note. 32 bytes. + NoteCommitment *StateCommitment `protobuf:"bytes,1,opt,name=note_commitment,json=noteCommitment,proto3" json:"note_commitment,omitempty"` + // The encoding of an ephemeral public key. 32 bytes. + EphemeralKey []byte `protobuf:"bytes,2,opt,name=ephemeral_key,json=ephemeralKey,proto3" json:"ephemeral_key,omitempty"` + // An encryption of the newly created note. + // 132 = 1(type) + 11(d) + 8(amount) + 32(asset_id) + 32(rcm) + 32(pk_d) + 16(MAC) bytes. + EncryptedNote *NoteCiphertext `protobuf:"bytes,3,opt,name=encrypted_note,json=encryptedNote,proto3" json:"encrypted_note,omitempty"` +} + +func (m *NotePayload) Reset() { *m = NotePayload{} } +func (m *NotePayload) String() string { return proto.CompactTextString(m) } +func (*NotePayload) ProtoMessage() {} +func (*NotePayload) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{29} +} +func (m *NotePayload) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NotePayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NotePayload.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 *NotePayload) XXX_Merge(src proto.Message) { + xxx_messageInfo_NotePayload.Merge(m, src) +} +func (m *NotePayload) XXX_Size() int { + return m.Size() +} +func (m *NotePayload) XXX_DiscardUnknown() { + xxx_messageInfo_NotePayload.DiscardUnknown(m) +} + +var xxx_messageInfo_NotePayload proto.InternalMessageInfo + +func (m *NotePayload) GetNoteCommitment() *StateCommitment { + if m != nil { + return m.NoteCommitment + } + return nil +} + +func (m *NotePayload) GetEphemeralKey() []byte { + if m != nil { + return m.EphemeralKey + } + return nil +} + +func (m *NotePayload) GetEncryptedNote() *NoteCiphertext { + if m != nil { + return m.EncryptedNote + } + return nil +} + +// An authentication path from a state commitment to the root of the state commitment tree. +type StateCommitmentProof struct { + NoteCommitment *StateCommitment `protobuf:"bytes,1,opt,name=note_commitment,json=noteCommitment,proto3" json:"note_commitment,omitempty"` + Position uint64 `protobuf:"varint,2,opt,name=position,proto3" json:"position,omitempty"` + AuthPath []*MerklePathChunk `protobuf:"bytes,3,rep,name=auth_path,json=authPath,proto3" json:"auth_path,omitempty"` +} + +func (m *StateCommitmentProof) Reset() { *m = StateCommitmentProof{} } +func (m *StateCommitmentProof) String() string { return proto.CompactTextString(m) } +func (*StateCommitmentProof) ProtoMessage() {} +func (*StateCommitmentProof) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{30} +} +func (m *StateCommitmentProof) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StateCommitmentProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StateCommitmentProof.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 *StateCommitmentProof) XXX_Merge(src proto.Message) { + xxx_messageInfo_StateCommitmentProof.Merge(m, src) +} +func (m *StateCommitmentProof) XXX_Size() int { + return m.Size() +} +func (m *StateCommitmentProof) XXX_DiscardUnknown() { + xxx_messageInfo_StateCommitmentProof.DiscardUnknown(m) +} + +var xxx_messageInfo_StateCommitmentProof proto.InternalMessageInfo + +func (m *StateCommitmentProof) GetNoteCommitment() *StateCommitment { + if m != nil { + return m.NoteCommitment + } + return nil +} + +func (m *StateCommitmentProof) GetPosition() uint64 { + if m != nil { + return m.Position + } + return 0 +} + +func (m *StateCommitmentProof) GetAuthPath() []*MerklePathChunk { + if m != nil { + return m.AuthPath + } + return nil +} + +// A set of 3 sibling hashes in the auth path for some note commitment. +type MerklePathChunk struct { + Sibling_1 []byte `protobuf:"bytes,1,opt,name=sibling_1,json=sibling1,proto3" json:"sibling_1,omitempty"` + Sibling_2 []byte `protobuf:"bytes,2,opt,name=sibling_2,json=sibling2,proto3" json:"sibling_2,omitempty"` + Sibling_3 []byte `protobuf:"bytes,3,opt,name=sibling_3,json=sibling3,proto3" json:"sibling_3,omitempty"` +} + +func (m *MerklePathChunk) Reset() { *m = MerklePathChunk{} } +func (m *MerklePathChunk) String() string { return proto.CompactTextString(m) } +func (*MerklePathChunk) ProtoMessage() {} +func (*MerklePathChunk) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{31} +} +func (m *MerklePathChunk) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MerklePathChunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MerklePathChunk.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 *MerklePathChunk) XXX_Merge(src proto.Message) { + xxx_messageInfo_MerklePathChunk.Merge(m, src) +} +func (m *MerklePathChunk) XXX_Size() int { + return m.Size() +} +func (m *MerklePathChunk) XXX_DiscardUnknown() { + xxx_messageInfo_MerklePathChunk.DiscardUnknown(m) +} + +var xxx_messageInfo_MerklePathChunk proto.InternalMessageInfo + +func (m *MerklePathChunk) GetSibling_1() []byte { + if m != nil { + return m.Sibling_1 + } + return nil +} + +func (m *MerklePathChunk) GetSibling_2() []byte { + if m != nil { + return m.Sibling_2 + } + return nil +} + +func (m *MerklePathChunk) GetSibling_3() []byte { + if m != nil { + return m.Sibling_3 + } + return nil +} + +// A clue for use with Fuzzy Message Detection. +type Clue struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *Clue) Reset() { *m = Clue{} } +func (m *Clue) String() string { return proto.CompactTextString(m) } +func (*Clue) ProtoMessage() {} +func (*Clue) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{32} +} +func (m *Clue) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Clue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Clue.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 *Clue) XXX_Merge(src proto.Message) { + xxx_messageInfo_Clue.Merge(m, src) +} +func (m *Clue) XXX_Size() int { + return m.Size() +} +func (m *Clue) XXX_DiscardUnknown() { + xxx_messageInfo_Clue.DiscardUnknown(m) +} + +var xxx_messageInfo_Clue proto.InternalMessageInfo + +func (m *Clue) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +// An authorization hash for a Penumbra transaction. +type EffectHash struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *EffectHash) Reset() { *m = EffectHash{} } +func (m *EffectHash) String() string { return proto.CompactTextString(m) } +func (*EffectHash) ProtoMessage() {} +func (*EffectHash) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{33} +} +func (m *EffectHash) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EffectHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EffectHash.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 *EffectHash) XXX_Merge(src proto.Message) { + xxx_messageInfo_EffectHash.Merge(m, src) +} +func (m *EffectHash) XXX_Size() int { + return m.Size() +} +func (m *EffectHash) XXX_DiscardUnknown() { + xxx_messageInfo_EffectHash.DiscardUnknown(m) +} + +var xxx_messageInfo_EffectHash proto.InternalMessageInfo + +func (m *EffectHash) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +// A Penumbra ZK output proof. +type ZKOutputProof struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *ZKOutputProof) Reset() { *m = ZKOutputProof{} } +func (m *ZKOutputProof) String() string { return proto.CompactTextString(m) } +func (*ZKOutputProof) ProtoMessage() {} +func (*ZKOutputProof) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{34} +} +func (m *ZKOutputProof) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ZKOutputProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ZKOutputProof.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 *ZKOutputProof) XXX_Merge(src proto.Message) { + xxx_messageInfo_ZKOutputProof.Merge(m, src) +} +func (m *ZKOutputProof) XXX_Size() int { + return m.Size() +} +func (m *ZKOutputProof) XXX_DiscardUnknown() { + xxx_messageInfo_ZKOutputProof.DiscardUnknown(m) +} + +var xxx_messageInfo_ZKOutputProof proto.InternalMessageInfo + +func (m *ZKOutputProof) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +// A Penumbra ZK spend proof. +type ZKSpendProof struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *ZKSpendProof) Reset() { *m = ZKSpendProof{} } +func (m *ZKSpendProof) String() string { return proto.CompactTextString(m) } +func (*ZKSpendProof) ProtoMessage() {} +func (*ZKSpendProof) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{35} +} +func (m *ZKSpendProof) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ZKSpendProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ZKSpendProof.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 *ZKSpendProof) XXX_Merge(src proto.Message) { + xxx_messageInfo_ZKSpendProof.Merge(m, src) +} +func (m *ZKSpendProof) XXX_Size() int { + return m.Size() +} +func (m *ZKSpendProof) XXX_DiscardUnknown() { + xxx_messageInfo_ZKSpendProof.DiscardUnknown(m) +} + +var xxx_messageInfo_ZKSpendProof proto.InternalMessageInfo + +func (m *ZKSpendProof) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +// A Penumbra ZK swap proof. +type ZKSwapProof struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *ZKSwapProof) Reset() { *m = ZKSwapProof{} } +func (m *ZKSwapProof) String() string { return proto.CompactTextString(m) } +func (*ZKSwapProof) ProtoMessage() {} +func (*ZKSwapProof) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{36} +} +func (m *ZKSwapProof) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ZKSwapProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ZKSwapProof.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 *ZKSwapProof) XXX_Merge(src proto.Message) { + xxx_messageInfo_ZKSwapProof.Merge(m, src) +} +func (m *ZKSwapProof) XXX_Size() int { + return m.Size() +} +func (m *ZKSwapProof) XXX_DiscardUnknown() { + xxx_messageInfo_ZKSwapProof.DiscardUnknown(m) +} + +var xxx_messageInfo_ZKSwapProof proto.InternalMessageInfo + +func (m *ZKSwapProof) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +// A Penumbra ZK undelegate claim proof. +type ZKUndelegateClaimProof struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *ZKUndelegateClaimProof) Reset() { *m = ZKUndelegateClaimProof{} } +func (m *ZKUndelegateClaimProof) String() string { return proto.CompactTextString(m) } +func (*ZKUndelegateClaimProof) ProtoMessage() {} +func (*ZKUndelegateClaimProof) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{37} +} +func (m *ZKUndelegateClaimProof) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ZKUndelegateClaimProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ZKUndelegateClaimProof.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 *ZKUndelegateClaimProof) XXX_Merge(src proto.Message) { + xxx_messageInfo_ZKUndelegateClaimProof.Merge(m, src) +} +func (m *ZKUndelegateClaimProof) XXX_Size() int { + return m.Size() +} +func (m *ZKUndelegateClaimProof) XXX_DiscardUnknown() { + xxx_messageInfo_ZKUndelegateClaimProof.DiscardUnknown(m) +} + +var xxx_messageInfo_ZKUndelegateClaimProof proto.InternalMessageInfo + +func (m *ZKUndelegateClaimProof) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +// A Penumbra ZK delegator vote proof. +type ZKDelegatorVoteProof struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *ZKDelegatorVoteProof) Reset() { *m = ZKDelegatorVoteProof{} } +func (m *ZKDelegatorVoteProof) String() string { return proto.CompactTextString(m) } +func (*ZKDelegatorVoteProof) ProtoMessage() {} +func (*ZKDelegatorVoteProof) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{38} +} +func (m *ZKDelegatorVoteProof) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ZKDelegatorVoteProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ZKDelegatorVoteProof.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 *ZKDelegatorVoteProof) XXX_Merge(src proto.Message) { + xxx_messageInfo_ZKDelegatorVoteProof.Merge(m, src) +} +func (m *ZKDelegatorVoteProof) XXX_Size() int { + return m.Size() +} +func (m *ZKDelegatorVoteProof) XXX_DiscardUnknown() { + xxx_messageInfo_ZKDelegatorVoteProof.DiscardUnknown(m) +} + +var xxx_messageInfo_ZKDelegatorVoteProof proto.InternalMessageInfo + +func (m *ZKDelegatorVoteProof) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +// A Penumbra ZK nullifier derivation proof. +type ZKNullifierDerivationProof struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *ZKNullifierDerivationProof) Reset() { *m = ZKNullifierDerivationProof{} } +func (m *ZKNullifierDerivationProof) String() string { return proto.CompactTextString(m) } +func (*ZKNullifierDerivationProof) ProtoMessage() {} +func (*ZKNullifierDerivationProof) Descriptor() ([]byte, []int) { + return fileDescriptor_5c23a0b4440af102, []int{39} +} +func (m *ZKNullifierDerivationProof) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ZKNullifierDerivationProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ZKNullifierDerivationProof.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 *ZKNullifierDerivationProof) XXX_Merge(src proto.Message) { + xxx_messageInfo_ZKNullifierDerivationProof.Merge(m, src) +} +func (m *ZKNullifierDerivationProof) XXX_Size() int { + return m.Size() +} +func (m *ZKNullifierDerivationProof) XXX_DiscardUnknown() { + xxx_messageInfo_ZKNullifierDerivationProof.DiscardUnknown(m) +} + +var xxx_messageInfo_ZKNullifierDerivationProof proto.InternalMessageInfo + +func (m *ZKNullifierDerivationProof) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +func init() { + proto.RegisterType((*Fee)(nil), "penumbra.core.crypto.v1alpha1.Fee") + proto.RegisterType((*Address)(nil), "penumbra.core.crypto.v1alpha1.Address") + proto.RegisterType((*AddressView)(nil), "penumbra.core.crypto.v1alpha1.AddressView") + proto.RegisterType((*AddressView_Visible)(nil), "penumbra.core.crypto.v1alpha1.AddressView.Visible") + proto.RegisterType((*AddressView_Opaque)(nil), "penumbra.core.crypto.v1alpha1.AddressView.Opaque") + proto.RegisterType((*SpendKey)(nil), "penumbra.core.crypto.v1alpha1.SpendKey") + proto.RegisterType((*SpendVerificationKey)(nil), "penumbra.core.crypto.v1alpha1.SpendVerificationKey") + proto.RegisterType((*FullViewingKey)(nil), "penumbra.core.crypto.v1alpha1.FullViewingKey") + proto.RegisterType((*AccountGroupId)(nil), "penumbra.core.crypto.v1alpha1.AccountGroupId") + proto.RegisterType((*Diversifier)(nil), "penumbra.core.crypto.v1alpha1.Diversifier") + proto.RegisterType((*AddressIndex)(nil), "penumbra.core.crypto.v1alpha1.AddressIndex") + proto.RegisterType((*StateCommitment)(nil), "penumbra.core.crypto.v1alpha1.StateCommitment") + proto.RegisterType((*BalanceCommitment)(nil), "penumbra.core.crypto.v1alpha1.BalanceCommitment") + proto.RegisterType((*AssetId)(nil), "penumbra.core.crypto.v1alpha1.AssetId") + proto.RegisterType((*Amount)(nil), "penumbra.core.crypto.v1alpha1.Amount") + proto.RegisterType((*Denom)(nil), "penumbra.core.crypto.v1alpha1.Denom") + proto.RegisterType((*DenomMetadata)(nil), "penumbra.core.crypto.v1alpha1.DenomMetadata") + proto.RegisterType((*DenomUnit)(nil), "penumbra.core.crypto.v1alpha1.DenomUnit") + proto.RegisterType((*Value)(nil), "penumbra.core.crypto.v1alpha1.Value") + proto.RegisterType((*ValueView)(nil), "penumbra.core.crypto.v1alpha1.ValueView") + proto.RegisterType((*ValueView_KnownDenom)(nil), "penumbra.core.crypto.v1alpha1.ValueView.KnownDenom") + proto.RegisterType((*ValueView_UnknownDenom)(nil), "penumbra.core.crypto.v1alpha1.ValueView.UnknownDenom") + proto.RegisterType((*MerkleRoot)(nil), "penumbra.core.crypto.v1alpha1.MerkleRoot") + proto.RegisterType((*Asset)(nil), "penumbra.core.crypto.v1alpha1.Asset") + proto.RegisterType((*IdentityKey)(nil), "penumbra.core.crypto.v1alpha1.IdentityKey") + proto.RegisterType((*GovernanceKey)(nil), "penumbra.core.crypto.v1alpha1.GovernanceKey") + proto.RegisterType((*ConsensusKey)(nil), "penumbra.core.crypto.v1alpha1.ConsensusKey") + proto.RegisterType((*Note)(nil), "penumbra.core.crypto.v1alpha1.Note") + proto.RegisterType((*NoteView)(nil), "penumbra.core.crypto.v1alpha1.NoteView") + proto.RegisterType((*NoteCiphertext)(nil), "penumbra.core.crypto.v1alpha1.NoteCiphertext") + proto.RegisterType((*Nullifier)(nil), "penumbra.core.crypto.v1alpha1.Nullifier") + proto.RegisterType((*SpendAuthSignature)(nil), "penumbra.core.crypto.v1alpha1.SpendAuthSignature") + proto.RegisterType((*BindingSignature)(nil), "penumbra.core.crypto.v1alpha1.BindingSignature") + proto.RegisterType((*NotePayload)(nil), "penumbra.core.crypto.v1alpha1.NotePayload") + proto.RegisterType((*StateCommitmentProof)(nil), "penumbra.core.crypto.v1alpha1.StateCommitmentProof") + proto.RegisterType((*MerklePathChunk)(nil), "penumbra.core.crypto.v1alpha1.MerklePathChunk") + proto.RegisterType((*Clue)(nil), "penumbra.core.crypto.v1alpha1.Clue") + proto.RegisterType((*EffectHash)(nil), "penumbra.core.crypto.v1alpha1.EffectHash") + proto.RegisterType((*ZKOutputProof)(nil), "penumbra.core.crypto.v1alpha1.ZKOutputProof") + proto.RegisterType((*ZKSpendProof)(nil), "penumbra.core.crypto.v1alpha1.ZKSpendProof") + proto.RegisterType((*ZKSwapProof)(nil), "penumbra.core.crypto.v1alpha1.ZKSwapProof") + proto.RegisterType((*ZKUndelegateClaimProof)(nil), "penumbra.core.crypto.v1alpha1.ZKUndelegateClaimProof") + proto.RegisterType((*ZKDelegatorVoteProof)(nil), "penumbra.core.crypto.v1alpha1.ZKDelegatorVoteProof") + proto.RegisterType((*ZKNullifierDerivationProof)(nil), "penumbra.core.crypto.v1alpha1.ZKNullifierDerivationProof") +} + +func init() { + proto.RegisterFile("penumbra/core/crypto/v1alpha1/crypto.proto", fileDescriptor_5c23a0b4440af102) +} + +var fileDescriptor_5c23a0b4440af102 = []byte{ + // 1416 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcf, 0x6f, 0x1b, 0xc5, + 0x17, 0xcf, 0xae, 0xf3, 0xc3, 0x79, 0x76, 0x9c, 0x76, 0x14, 0x55, 0xfe, 0xe6, 0x4b, 0xd2, 0x74, + 0x9b, 0x86, 0xb4, 0x14, 0x47, 0x71, 0x04, 0x87, 0x20, 0x10, 0xb1, 0x43, 0x9b, 0x60, 0xb5, 0xb5, + 0x36, 0xd4, 0x45, 0x56, 0x24, 0x6b, 0xe2, 0x9d, 0x78, 0x47, 0xde, 0x9d, 0x59, 0xf6, 0x87, 0x53, + 0xc3, 0x1f, 0x80, 0x38, 0xd1, 0x33, 0x47, 0x0e, 0x1c, 0xf8, 0x0f, 0xb8, 0x71, 0x44, 0x9c, 0x7a, + 0xec, 0x11, 0xd2, 0x03, 0x12, 0x27, 0x0e, 0xfc, 0x01, 0x68, 0x66, 0x67, 0x1d, 0x27, 0x8a, 0x7f, + 0x94, 0x0a, 0xc1, 0x6d, 0xde, 0xbc, 0xcf, 0x7b, 0xf3, 0x99, 0xf7, 0xde, 0xcc, 0x9b, 0x5d, 0xb8, + 0xe3, 0x11, 0x16, 0xb9, 0x47, 0x3e, 0xde, 0x68, 0x72, 0x9f, 0x6c, 0x34, 0xfd, 0xae, 0x17, 0xf2, + 0x8d, 0xce, 0x26, 0x76, 0x3c, 0x1b, 0x6f, 0x2a, 0xb9, 0xe0, 0xf9, 0x3c, 0xe4, 0x68, 0x29, 0xc1, + 0x16, 0x04, 0xb6, 0xa0, 0x74, 0x09, 0xd6, 0xf8, 0x52, 0x83, 0xd4, 0x3d, 0x42, 0xd0, 0xfb, 0x30, + 0x8d, 0x5d, 0x1e, 0xb1, 0x30, 0xaf, 0xad, 0x68, 0xeb, 0x99, 0xe2, 0xad, 0xc2, 0x50, 0xbb, 0xc2, + 0x8e, 0x04, 0x9b, 0xca, 0x08, 0xed, 0x40, 0x1a, 0x07, 0x01, 0x09, 0x1b, 0xd4, 0xca, 0xeb, 0xd2, + 0xc1, 0xda, 0x28, 0x07, 0x02, 0xbe, 0x6f, 0x99, 0x33, 0x38, 0x1e, 0x18, 0xd7, 0x61, 0x66, 0xc7, + 0xb2, 0x7c, 0x12, 0x04, 0x68, 0x01, 0xa6, 0x28, 0x63, 0xc4, 0x97, 0x5c, 0xb2, 0x66, 0x2c, 0x18, + 0x7f, 0xa4, 0x20, 0xa3, 0x10, 0x35, 0x4a, 0x4e, 0xd0, 0x43, 0x98, 0xe9, 0xd0, 0x80, 0x1e, 0x39, + 0x44, 0x71, 0x2e, 0x8e, 0x5a, 0xf2, 0xcc, 0xb8, 0x50, 0x8b, 0x2d, 0xf7, 0x26, 0xcc, 0xc4, 0x09, + 0xaa, 0xc0, 0x34, 0xf7, 0xf0, 0x67, 0x11, 0x51, 0x3b, 0xd8, 0x7c, 0x05, 0x77, 0x8f, 0xa4, 0xe1, + 0xde, 0x84, 0xa9, 0x5c, 0x2c, 0xfe, 0xa6, 0xc1, 0x8c, 0x5a, 0x03, 0x7d, 0x08, 0x33, 0x38, 0xc6, + 0x2a, 0xa2, 0x6b, 0xe3, 0x79, 0x36, 0x13, 0x33, 0xb4, 0x23, 0x02, 0x62, 0x91, 0xa7, 0x8a, 0xd9, + 0x5b, 0xe3, 0xd9, 0xef, 0x0b, 0x13, 0x33, 0xb6, 0x44, 0x4f, 0xe0, 0x0a, 0x6e, 0x36, 0x45, 0xb2, + 0x1a, 0x2d, 0x9f, 0x47, 0x9e, 0xc8, 0x54, 0x4a, 0x7a, 0x7b, 0x7b, 0x94, 0xb7, 0xd8, 0xec, 0xbe, + 0xb0, 0xda, 0xb7, 0xcc, 0x1c, 0x3e, 0x27, 0x2f, 0x7e, 0x0c, 0xd3, 0xf1, 0xee, 0x5f, 0x7f, 0x9f, + 0xa5, 0x1c, 0x64, 0xd5, 0xb0, 0xd1, 0xa1, 0xe4, 0xc4, 0x58, 0x81, 0xf4, 0x81, 0x47, 0x98, 0x55, + 0x21, 0xdd, 0x01, 0x45, 0x71, 0x17, 0x16, 0x24, 0xa2, 0x46, 0x7c, 0x7a, 0x4c, 0x9b, 0x38, 0xa4, + 0x9c, 0x0d, 0x46, 0xaf, 0x41, 0xee, 0x5e, 0xe4, 0x38, 0x22, 0x65, 0x94, 0xb5, 0x86, 0xe2, 0xce, + 0xef, 0x7a, 0x00, 0xee, 0x26, 0x64, 0x76, 0x69, 0x87, 0xf8, 0x01, 0x3d, 0xa6, 0xc4, 0x1f, 0x00, + 0xda, 0x83, 0x6c, 0x7f, 0x42, 0x50, 0x1e, 0x66, 0x54, 0x08, 0x65, 0x3a, 0xe7, 0xcc, 0x44, 0x44, + 0xcb, 0x00, 0x3e, 0x66, 0x16, 0x77, 0xe9, 0xe7, 0xc4, 0x97, 0xd9, 0xc9, 0x9a, 0x7d, 0x33, 0xc6, + 0x9b, 0x30, 0x7f, 0x10, 0xe2, 0x90, 0x94, 0xb9, 0xeb, 0xd2, 0xd0, 0x25, 0x2c, 0x1c, 0xb0, 0xe4, + 0x6d, 0xb8, 0x5a, 0xc2, 0x0e, 0x66, 0xcd, 0xd1, 0x50, 0x71, 0xec, 0xe2, 0x13, 0x38, 0x00, 0xb0, + 0x0e, 0xd3, 0xf1, 0x61, 0x47, 0x39, 0xd0, 0x1d, 0x2e, 0x95, 0x93, 0xa6, 0xee, 0x70, 0x21, 0xdb, + 0x54, 0xee, 0x61, 0xd2, 0xd4, 0x6d, 0x6a, 0x2c, 0xc1, 0xd4, 0x2e, 0x61, 0xdc, 0x15, 0x8e, 0x2c, + 0x31, 0x90, 0xd8, 0x59, 0x33, 0x16, 0x8c, 0x17, 0x3a, 0xcc, 0x49, 0xfd, 0x03, 0x12, 0x62, 0x0b, + 0x87, 0x18, 0xad, 0x40, 0xc6, 0x22, 0x41, 0xd3, 0xa7, 0x9e, 0x48, 0x9b, 0x42, 0xf7, 0x4f, 0xa1, + 0x7d, 0x81, 0x60, 0xdc, 0x6d, 0x44, 0x8c, 0x86, 0x41, 0x5e, 0x5f, 0x49, 0xad, 0x67, 0x8a, 0xeb, + 0x23, 0xca, 0x4a, 0x2e, 0xf2, 0x98, 0xd1, 0xd0, 0x04, 0x2b, 0x19, 0x06, 0x08, 0xc1, 0xe4, 0x11, + 0x0e, 0x88, 0x0c, 0xeb, 0xac, 0x29, 0xc7, 0x22, 0x15, 0x16, 0x0d, 0x3c, 0x07, 0x77, 0xf3, 0x93, + 0x72, 0x3a, 0x11, 0x05, 0x9a, 0x61, 0x97, 0xe4, 0xa7, 0x62, 0xb4, 0x18, 0xa3, 0x6b, 0x30, 0x1d, + 0x74, 0xdd, 0x23, 0xee, 0xe4, 0xa7, 0xe5, 0xac, 0x92, 0xd0, 0x15, 0x48, 0x45, 0x3e, 0xcd, 0xcf, + 0xc8, 0x49, 0x31, 0x44, 0xff, 0x83, 0x74, 0xe4, 0xd3, 0x86, 0x8d, 0x03, 0x3b, 0x9f, 0x8e, 0x1d, + 0x47, 0x3e, 0xdd, 0xc3, 0x81, 0x8d, 0x0e, 0xe0, 0x6a, 0xc2, 0xbe, 0xd1, 0xbb, 0x32, 0x7f, 0x9c, + 0x7f, 0xa5, 0x3b, 0x73, 0x3e, 0x81, 0xa9, 0x09, 0xe3, 0x09, 0xcc, 0xf6, 0x36, 0x7d, 0x79, 0xf4, + 0xd1, 0x22, 0xa4, 0xc9, 0x53, 0x8f, 0x33, 0xd2, 0x2b, 0xbb, 0x9e, 0x2c, 0x2b, 0xd2, 0xa1, 0x38, + 0x20, 0x41, 0x3e, 0xb5, 0x92, 0x12, 0x6c, 0x95, 0x68, 0x7c, 0xa5, 0xc1, 0x54, 0x0d, 0x3b, 0xd1, + 0x7f, 0xa1, 0x41, 0xfc, 0x99, 0x82, 0x59, 0xc9, 0x45, 0xde, 0xfe, 0x35, 0xc8, 0xb4, 0x19, 0x3f, + 0x61, 0x8d, 0xb3, 0xbd, 0x66, 0x8a, 0x5b, 0x23, 0x7c, 0xf6, 0xcc, 0x0b, 0x15, 0x61, 0x2b, 0x63, + 0xb6, 0x37, 0x61, 0x42, 0xbb, 0x27, 0xa1, 0x43, 0x98, 0x8b, 0x58, 0xbf, 0xe7, 0x98, 0xed, 0x3b, + 0x63, 0x7b, 0x7e, 0xcc, 0xda, 0xfd, 0xbe, 0xb3, 0x51, 0x9f, 0xbc, 0xf8, 0xb5, 0x06, 0x70, 0xb6, + 0xf4, 0xeb, 0x06, 0xb5, 0x94, 0x64, 0x3a, 0xe6, 0x78, 0x77, 0x9c, 0x73, 0x91, 0x1c, 0x3e, 0x55, + 0x17, 0x8b, 0xcf, 0x34, 0xc8, 0xf6, 0x53, 0xfe, 0xf7, 0x13, 0x5d, 0xca, 0x02, 0x74, 0x44, 0x38, + 0xe3, 0x1e, 0x60, 0x00, 0x3c, 0x20, 0x7e, 0xdb, 0x21, 0x26, 0xe7, 0x83, 0x2e, 0xb1, 0x2f, 0x60, + 0x4a, 0x7a, 0x41, 0xef, 0x82, 0x4e, 0xad, 0x71, 0xbb, 0x8f, 0x5a, 0x57, 0xa7, 0x16, 0xda, 0x3e, + 0x1f, 0xc9, 0xd5, 0x71, 0x22, 0x99, 0xdc, 0x6b, 0x4b, 0x90, 0xd9, 0xb7, 0x08, 0x0b, 0x69, 0xd8, + 0x15, 0x1d, 0x25, 0x07, 0x3a, 0x6d, 0x2b, 0x7a, 0x3a, 0x6d, 0x1b, 0xd7, 0x61, 0xee, 0x3e, 0xef, + 0x10, 0x9f, 0x89, 0xeb, 0x58, 0x01, 0x5a, 0x3d, 0x40, 0xab, 0x6d, 0xac, 0x42, 0xb6, 0xcc, 0x59, + 0x40, 0x58, 0x10, 0x05, 0x83, 0x5b, 0xd2, 0x37, 0x1a, 0x4c, 0x3e, 0xe4, 0x21, 0x11, 0x54, 0x65, + 0x74, 0xd4, 0x2e, 0x57, 0xc7, 0x29, 0x4c, 0x33, 0x36, 0x11, 0xae, 0xfd, 0x80, 0x90, 0x38, 0x33, + 0x59, 0x33, 0x16, 0xfa, 0xfb, 0x76, 0xea, 0x6f, 0xf5, 0x6d, 0xe3, 0x3b, 0x0d, 0xd2, 0x82, 0x9c, + 0x3c, 0x99, 0x1f, 0x9c, 0x27, 0xb8, 0x3e, 0xee, 0xc9, 0x19, 0x4e, 0x72, 0xf7, 0x22, 0xc9, 0x3b, + 0xe3, 0x3f, 0xcf, 0xce, 0x88, 0xae, 0x41, 0x4e, 0xf0, 0x2c, 0x53, 0xcf, 0x26, 0x7e, 0x48, 0x9e, + 0x0e, 0x2a, 0xa8, 0x1b, 0x30, 0xfb, 0x30, 0x72, 0x9c, 0x61, 0x6d, 0xfd, 0x0e, 0x20, 0xf9, 0xf2, + 0xd8, 0x89, 0x42, 0xfb, 0x80, 0xb6, 0x18, 0x0e, 0x23, 0x9f, 0x0c, 0xec, 0xa1, 0x57, 0x4a, 0x94, + 0x59, 0x94, 0xb5, 0x46, 0x21, 0x7f, 0xd5, 0x20, 0x23, 0x18, 0x56, 0x71, 0xd7, 0xe1, 0xd8, 0x42, + 0x4f, 0x60, 0x9e, 0xf1, 0x90, 0x34, 0x9a, 0xbd, 0x3e, 0xae, 0xc2, 0x5a, 0x18, 0xb1, 0xfd, 0x0b, + 0x0f, 0x05, 0x33, 0x27, 0xdc, 0xf4, 0xbd, 0x06, 0x6e, 0xc2, 0x1c, 0xf1, 0x6c, 0xe2, 0x12, 0x1f, + 0x3b, 0x8d, 0x36, 0xe9, 0xaa, 0x68, 0x67, 0x7b, 0x93, 0xa2, 0x14, 0x3f, 0x81, 0x1c, 0x61, 0xd2, + 0x33, 0xb1, 0x1a, 0xc2, 0xc1, 0x98, 0x4f, 0xc6, 0xf3, 0x31, 0x36, 0xe7, 0x7a, 0x4e, 0x84, 0xc2, + 0x78, 0xa1, 0xc1, 0xc2, 0x05, 0x7a, 0x55, 0x9f, 0xf3, 0xe3, 0x7f, 0x6e, 0xb3, 0x8b, 0x90, 0xf6, + 0x78, 0x40, 0xe5, 0x2b, 0x23, 0x7e, 0xaf, 0xf4, 0x64, 0x54, 0x81, 0x59, 0x1c, 0x85, 0x76, 0xc3, + 0xc3, 0xa1, 0x2d, 0xdb, 0xdf, 0xe8, 0xe5, 0xe2, 0xfb, 0xa8, 0x8a, 0x43, 0xbb, 0x6c, 0x47, 0xac, + 0x6d, 0xa6, 0x85, 0x03, 0x21, 0x1a, 0x36, 0xcc, 0x5f, 0x50, 0xa2, 0xff, 0xc3, 0xac, 0xf8, 0x0c, + 0xa0, 0xac, 0xd5, 0xd8, 0x54, 0xb9, 0x4e, 0xab, 0x89, 0xcd, 0x7e, 0x65, 0x51, 0x65, 0x20, 0x51, + 0x16, 0xfb, 0x95, 0x5b, 0xea, 0x35, 0x98, 0x28, 0xb7, 0x8c, 0x37, 0x60, 0xb2, 0xac, 0x4e, 0xcb, + 0x25, 0x65, 0x64, 0x00, 0x7c, 0x74, 0x7c, 0x4c, 0x9a, 0xa1, 0x7c, 0x73, 0x5c, 0x8e, 0xb9, 0x05, + 0x73, 0xf5, 0xca, 0xa3, 0x28, 0xf4, 0x22, 0x15, 0xfe, 0xcb, 0x61, 0xab, 0x90, 0xad, 0x57, 0x64, + 0xa5, 0x0f, 0x43, 0xdd, 0x84, 0x4c, 0xbd, 0x72, 0x70, 0x82, 0xbd, 0x61, 0xa0, 0x02, 0x5c, 0xab, + 0x57, 0x1e, 0x33, 0x8b, 0x38, 0xa4, 0x25, 0x12, 0xe6, 0x60, 0xea, 0x0e, 0xc3, 0xdf, 0x85, 0x85, + 0x7a, 0x65, 0x37, 0x46, 0x73, 0xbf, 0x26, 0x8e, 0xc5, 0x10, 0x74, 0x11, 0x16, 0xeb, 0x95, 0xde, + 0xa9, 0xdd, 0x25, 0x3e, 0xed, 0xc8, 0xcf, 0x81, 0x21, 0x36, 0xa5, 0x1f, 0xf4, 0x9f, 0x4e, 0x97, + 0xb5, 0xe7, 0xa7, 0xcb, 0xda, 0x2f, 0xa7, 0xcb, 0xda, 0xb3, 0x97, 0xcb, 0x13, 0xcf, 0x5f, 0x2e, + 0x4f, 0xbc, 0x78, 0xb9, 0x3c, 0x01, 0x37, 0x9a, 0xdc, 0x1d, 0x5e, 0x07, 0xa5, 0x4c, 0x59, 0x4e, + 0x54, 0xc5, 0x87, 0x76, 0x55, 0xab, 0x7f, 0xda, 0xa2, 0xa1, 0x1d, 0x1d, 0x15, 0x9a, 0xdc, 0xdd, + 0x68, 0xf2, 0xc0, 0xe5, 0xc1, 0x86, 0x4f, 0x1c, 0xdc, 0x25, 0xfe, 0x46, 0xa7, 0xd8, 0x1b, 0x36, + 0x6d, 0x4c, 0x59, 0xb0, 0x31, 0xf4, 0x13, 0xfe, 0xbd, 0x58, 0x4e, 0xc4, 0x6f, 0xf5, 0x54, 0xb5, + 0x5c, 0xfe, 0x5e, 0x5f, 0xaa, 0x26, 0x74, 0xca, 0x82, 0x4e, 0xbc, 0x7a, 0xa1, 0xa6, 0x50, 0x3f, + 0x9f, 0xe9, 0x0f, 0x85, 0xfe, 0x30, 0xd6, 0x1f, 0x26, 0xfa, 0x53, 0xfd, 0xf6, 0x50, 0xfd, 0xe1, + 0xfd, 0x6a, 0x29, 0x79, 0x1d, 0xfc, 0xae, 0xaf, 0x24, 0xd8, 0xed, 0x6d, 0x01, 0xde, 0xde, 0x8e, + 0xd1, 0xdb, 0xdb, 0x09, 0xfc, 0x68, 0x5a, 0xfe, 0x60, 0xd8, 0xfa, 0x2b, 0x00, 0x00, 0xff, 0xff, + 0xfa, 0xd5, 0x1e, 0x48, 0x8e, 0x10, 0x00, 0x00, +} + +func (m *Fee) 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 *Fee) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Fee) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AssetId != nil { + { + size, err := m.AssetId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Amount != nil { + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Address) 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 *Address) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Address) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AddressView) 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 *AddressView) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddressView) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AddressView != nil { + { + size := m.AddressView.Size() + i -= size + if _, err := m.AddressView.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *AddressView_Visible_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddressView_Visible_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Visible != nil { + { + size, err := m.Visible.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *AddressView_Opaque_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddressView_Opaque_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Opaque != nil { + { + size, err := m.Opaque.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *AddressView_Visible) 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 *AddressView_Visible) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddressView_Visible) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AccountGroupId != nil { + { + size, err := m.AccountGroupId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Index != nil { + { + size, err := m.Index.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Address != nil { + { + size, err := m.Address.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AddressView_Opaque) 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 *AddressView_Opaque) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddressView_Opaque) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Address != nil { + { + size, err := m.Address.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SpendKey) 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 *SpendKey) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpendKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SpendVerificationKey) 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 *SpendVerificationKey) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpendVerificationKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *FullViewingKey) 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 *FullViewingKey) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FullViewingKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AccountGroupId) 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 *AccountGroupId) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AccountGroupId) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Diversifier) 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 *Diversifier) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Diversifier) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AddressIndex) 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 *AddressIndex) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddressIndex) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Randomizer) > 0 { + i -= len(m.Randomizer) + copy(dAtA[i:], m.Randomizer) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Randomizer))) + i-- + dAtA[i] = 0x1a + } + if m.Account != 0 { + i = encodeVarintCrypto(dAtA, i, uint64(m.Account)) + i-- + dAtA[i] = 0x10 + } + return len(dAtA) - i, nil +} + +func (m *StateCommitment) 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 *StateCommitment) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StateCommitment) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BalanceCommitment) 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 *BalanceCommitment) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BalanceCommitment) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AssetId) 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 *AssetId) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AssetId) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Amount) 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 *Amount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Amount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Hi != 0 { + i = encodeVarintCrypto(dAtA, i, uint64(m.Hi)) + i-- + dAtA[i] = 0x10 + } + if m.Lo != 0 { + i = encodeVarintCrypto(dAtA, i, uint64(m.Lo)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Denom) 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 *Denom) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Denom) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DenomMetadata) 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 *DenomMetadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DenomMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PenumbraAssetId != nil { + { + size, err := m.PenumbraAssetId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7c + i-- + dAtA[i] = 0x82 + } + if len(m.UriHash) > 0 { + i -= len(m.UriHash) + copy(dAtA[i:], m.UriHash) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.UriHash))) + i-- + dAtA[i] = 0x42 + } + if len(m.Uri) > 0 { + i -= len(m.Uri) + copy(dAtA[i:], m.Uri) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Uri))) + i-- + dAtA[i] = 0x3a + } + if len(m.Symbol) > 0 { + i -= len(m.Symbol) + copy(dAtA[i:], m.Symbol) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Symbol))) + i-- + dAtA[i] = 0x32 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x2a + } + if len(m.Display) > 0 { + i -= len(m.Display) + copy(dAtA[i:], m.Display) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Display))) + i-- + dAtA[i] = 0x22 + } + if len(m.Base) > 0 { + i -= len(m.Base) + copy(dAtA[i:], m.Base) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Base))) + i-- + dAtA[i] = 0x1a + } + if len(m.DenomUnits) > 0 { + for iNdEx := len(m.DenomUnits) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DenomUnits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DenomUnit) 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 *DenomUnit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DenomUnit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Aliases) > 0 { + for iNdEx := len(m.Aliases) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Aliases[iNdEx]) + copy(dAtA[i:], m.Aliases[iNdEx]) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Aliases[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if m.Exponent != 0 { + i = encodeVarintCrypto(dAtA, i, uint64(m.Exponent)) + i-- + dAtA[i] = 0x10 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Value) 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 *Value) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Value) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AssetId != nil { + { + size, err := m.AssetId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Amount != nil { + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ValueView) 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 *ValueView) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValueView) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ValueView != nil { + { + size := m.ValueView.Size() + i -= size + if _, err := m.ValueView.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *ValueView_KnownDenom_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValueView_KnownDenom_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.KnownDenom != nil { + { + size, err := m.KnownDenom.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *ValueView_UnknownDenom_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValueView_UnknownDenom_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.UnknownDenom != nil { + { + size, err := m.UnknownDenom.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *ValueView_KnownDenom) 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 *ValueView_KnownDenom) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValueView_KnownDenom) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Denom != nil { + { + size, err := m.Denom.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Amount != nil { + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ValueView_UnknownDenom) 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 *ValueView_UnknownDenom) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValueView_UnknownDenom) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AssetId != nil { + { + size, err := m.AssetId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Amount != nil { + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MerkleRoot) 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 *MerkleRoot) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MerkleRoot) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Asset) 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 *Asset) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Asset) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Denom != nil { + { + size, err := m.Denom.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Id != nil { + { + size, err := m.Id.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *IdentityKey) 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 *IdentityKey) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IdentityKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Ik) > 0 { + i -= len(m.Ik) + copy(dAtA[i:], m.Ik) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Ik))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GovernanceKey) 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 *GovernanceKey) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GovernanceKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Gk) > 0 { + i -= len(m.Gk) + copy(dAtA[i:], m.Gk) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Gk))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ConsensusKey) 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 *ConsensusKey) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConsensusKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Note) 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 *Note) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Note) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Address != nil { + { + size, err := m.Address.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Rseed) > 0 { + i -= len(m.Rseed) + copy(dAtA[i:], m.Rseed) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Rseed))) + i-- + dAtA[i] = 0x12 + } + if m.Value != nil { + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NoteView) 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 *NoteView) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NoteView) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Address != nil { + { + size, err := m.Address.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Rseed) > 0 { + i -= len(m.Rseed) + copy(dAtA[i:], m.Rseed) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Rseed))) + i-- + dAtA[i] = 0x12 + } + if m.Value != nil { + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NoteCiphertext) 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 *NoteCiphertext) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NoteCiphertext) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Nullifier) 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 *Nullifier) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Nullifier) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SpendAuthSignature) 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 *SpendAuthSignature) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpendAuthSignature) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BindingSignature) 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 *BindingSignature) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BindingSignature) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NotePayload) 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 *NotePayload) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NotePayload) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.EncryptedNote != nil { + { + size, err := m.EncryptedNote.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.EphemeralKey) > 0 { + i -= len(m.EphemeralKey) + copy(dAtA[i:], m.EphemeralKey) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.EphemeralKey))) + i-- + dAtA[i] = 0x12 + } + if m.NoteCommitment != nil { + { + size, err := m.NoteCommitment.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *StateCommitmentProof) 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 *StateCommitmentProof) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StateCommitmentProof) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AuthPath) > 0 { + for iNdEx := len(m.AuthPath) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AuthPath[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.Position != 0 { + i = encodeVarintCrypto(dAtA, i, uint64(m.Position)) + i-- + dAtA[i] = 0x10 + } + if m.NoteCommitment != nil { + { + size, err := m.NoteCommitment.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrypto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MerklePathChunk) 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 *MerklePathChunk) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MerklePathChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Sibling_3) > 0 { + i -= len(m.Sibling_3) + copy(dAtA[i:], m.Sibling_3) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Sibling_3))) + i-- + dAtA[i] = 0x1a + } + if len(m.Sibling_2) > 0 { + i -= len(m.Sibling_2) + copy(dAtA[i:], m.Sibling_2) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Sibling_2))) + i-- + dAtA[i] = 0x12 + } + if len(m.Sibling_1) > 0 { + i -= len(m.Sibling_1) + copy(dAtA[i:], m.Sibling_1) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Sibling_1))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Clue) 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 *Clue) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Clue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EffectHash) 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 *EffectHash) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EffectHash) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ZKOutputProof) 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 *ZKOutputProof) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ZKOutputProof) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ZKSpendProof) 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 *ZKSpendProof) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ZKSpendProof) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ZKSwapProof) 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 *ZKSwapProof) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ZKSwapProof) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ZKUndelegateClaimProof) 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 *ZKUndelegateClaimProof) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ZKUndelegateClaimProof) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ZKDelegatorVoteProof) 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 *ZKDelegatorVoteProof) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ZKDelegatorVoteProof) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ZKNullifierDerivationProof) 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 *ZKNullifierDerivationProof) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ZKNullifierDerivationProof) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintCrypto(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintCrypto(dAtA []byte, offset int, v uint64) int { + offset -= sovCrypto(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Fee) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Amount != nil { + l = m.Amount.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + if m.AssetId != nil { + l = m.AssetId.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *Address) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *AddressView) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AddressView != nil { + n += m.AddressView.Size() + } + return n +} + +func (m *AddressView_Visible_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Visible != nil { + l = m.Visible.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} +func (m *AddressView_Opaque_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Opaque != nil { + l = m.Opaque.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} +func (m *AddressView_Visible) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Address != nil { + l = m.Address.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + if m.Index != nil { + l = m.Index.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + if m.AccountGroupId != nil { + l = m.AccountGroupId.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *AddressView_Opaque) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Address != nil { + l = m.Address.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *SpendKey) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *SpendVerificationKey) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *FullViewingKey) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *AccountGroupId) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *Diversifier) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *AddressIndex) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Account != 0 { + n += 1 + sovCrypto(uint64(m.Account)) + } + l = len(m.Randomizer) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *StateCommitment) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *BalanceCommitment) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *AssetId) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *Amount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Lo != 0 { + n += 1 + sovCrypto(uint64(m.Lo)) + } + if m.Hi != 0 { + n += 1 + sovCrypto(uint64(m.Hi)) + } + return n +} + +func (m *Denom) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *DenomMetadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Description) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + if len(m.DenomUnits) > 0 { + for _, e := range m.DenomUnits { + l = e.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + } + l = len(m.Base) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + l = len(m.Display) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + l = len(m.Symbol) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + l = len(m.Uri) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + l = len(m.UriHash) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + if m.PenumbraAssetId != nil { + l = m.PenumbraAssetId.Size() + n += 2 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *DenomUnit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + if m.Exponent != 0 { + n += 1 + sovCrypto(uint64(m.Exponent)) + } + if len(m.Aliases) > 0 { + for _, s := range m.Aliases { + l = len(s) + n += 1 + l + sovCrypto(uint64(l)) + } + } + return n +} + +func (m *Value) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Amount != nil { + l = m.Amount.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + if m.AssetId != nil { + l = m.AssetId.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *ValueView) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ValueView != nil { + n += m.ValueView.Size() + } + return n +} + +func (m *ValueView_KnownDenom_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.KnownDenom != nil { + l = m.KnownDenom.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} +func (m *ValueView_UnknownDenom_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.UnknownDenom != nil { + l = m.UnknownDenom.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} +func (m *ValueView_KnownDenom) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Amount != nil { + l = m.Amount.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + if m.Denom != nil { + l = m.Denom.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *ValueView_UnknownDenom) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Amount != nil { + l = m.Amount.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + if m.AssetId != nil { + l = m.AssetId.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *MerkleRoot) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *Asset) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != nil { + l = m.Id.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + if m.Denom != nil { + l = m.Denom.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *IdentityKey) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Ik) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *GovernanceKey) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Gk) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *ConsensusKey) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *Note) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != nil { + l = m.Value.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + l = len(m.Rseed) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + if m.Address != nil { + l = m.Address.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *NoteView) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != nil { + l = m.Value.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + l = len(m.Rseed) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + if m.Address != nil { + l = m.Address.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *NoteCiphertext) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *Nullifier) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *SpendAuthSignature) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *BindingSignature) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *NotePayload) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NoteCommitment != nil { + l = m.NoteCommitment.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + l = len(m.EphemeralKey) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + if m.EncryptedNote != nil { + l = m.EncryptedNote.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *StateCommitmentProof) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NoteCommitment != nil { + l = m.NoteCommitment.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + if m.Position != 0 { + n += 1 + sovCrypto(uint64(m.Position)) + } + if len(m.AuthPath) > 0 { + for _, e := range m.AuthPath { + l = e.Size() + n += 1 + l + sovCrypto(uint64(l)) + } + } + return n +} + +func (m *MerklePathChunk) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sibling_1) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + l = len(m.Sibling_2) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + l = len(m.Sibling_3) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *Clue) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *EffectHash) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *ZKOutputProof) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *ZKSpendProof) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *ZKSwapProof) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *ZKUndelegateClaimProof) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *ZKDelegatorVoteProof) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func (m *ZKNullifierDerivationProof) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovCrypto(uint64(l)) + } + return n +} + +func sovCrypto(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozCrypto(x uint64) (n int) { + return sovCrypto(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Fee) 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 ErrIntOverflowCrypto + } + 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: Fee: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Fee: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Amount == nil { + m.Amount = &Amount{} + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AssetId == nil { + m.AssetId = &AssetId{} + } + if err := m.AssetId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Address) 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 ErrIntOverflowCrypto + } + 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: Address: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Address: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AddressView) 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 ErrIntOverflowCrypto + } + 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: AddressView: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddressView: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Visible", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &AddressView_Visible{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.AddressView = &AddressView_Visible_{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Opaque", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &AddressView_Opaque{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.AddressView = &AddressView_Opaque_{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AddressView_Visible) 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 ErrIntOverflowCrypto + } + 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: Visible: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Visible: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Address == nil { + m.Address = &Address{} + } + if err := m.Address.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Index == nil { + m.Index = &AddressIndex{} + } + if err := m.Index.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccountGroupId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AccountGroupId == nil { + m.AccountGroupId = &AccountGroupId{} + } + if err := m.AccountGroupId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AddressView_Opaque) 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 ErrIntOverflowCrypto + } + 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: Opaque: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Opaque: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Address == nil { + m.Address = &Address{} + } + if err := m.Address.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SpendKey) 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 ErrIntOverflowCrypto + } + 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: SpendKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SpendKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SpendVerificationKey) 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 ErrIntOverflowCrypto + } + 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: SpendVerificationKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SpendVerificationKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FullViewingKey) 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 ErrIntOverflowCrypto + } + 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: FullViewingKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FullViewingKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AccountGroupId) 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 ErrIntOverflowCrypto + } + 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: AccountGroupId: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AccountGroupId: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Diversifier) 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 ErrIntOverflowCrypto + } + 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: Diversifier: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Diversifier: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AddressIndex) 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 ErrIntOverflowCrypto + } + 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: AddressIndex: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddressIndex: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) + } + m.Account = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Account |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Randomizer", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Randomizer = append(m.Randomizer[:0], dAtA[iNdEx:postIndex]...) + if m.Randomizer == nil { + m.Randomizer = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StateCommitment) 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 ErrIntOverflowCrypto + } + 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: StateCommitment: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StateCommitment: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BalanceCommitment) 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 ErrIntOverflowCrypto + } + 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: BalanceCommitment: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BalanceCommitment: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AssetId) 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 ErrIntOverflowCrypto + } + 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: AssetId: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AssetId: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Amount) 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 ErrIntOverflowCrypto + } + 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: Amount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Amount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Lo", wireType) + } + m.Lo = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Lo |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Hi", wireType) + } + m.Hi = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Hi |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Denom) 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 ErrIntOverflowCrypto + } + 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: Denom: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Denom: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + 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 ErrInvalidLengthCrypto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DenomMetadata) 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 ErrIntOverflowCrypto + } + 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: DenomMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DenomMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + 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 ErrInvalidLengthCrypto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DenomUnits", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DenomUnits = append(m.DenomUnits, &DenomUnit{}) + if err := m.DenomUnits[len(m.DenomUnits)-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 Base", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + 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 ErrInvalidLengthCrypto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Base = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Display", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + 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 ErrInvalidLengthCrypto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Display = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + 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 ErrIntOverflowCrypto + } + 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 ErrInvalidLengthCrypto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + 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 ErrInvalidLengthCrypto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Symbol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Uri", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + 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 ErrInvalidLengthCrypto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Uri = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UriHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + 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 ErrInvalidLengthCrypto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UriHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 1984: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PenumbraAssetId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PenumbraAssetId == nil { + m.PenumbraAssetId = &AssetId{} + } + if err := m.PenumbraAssetId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DenomUnit) 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 ErrIntOverflowCrypto + } + 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: DenomUnit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DenomUnit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + 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 ErrInvalidLengthCrypto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Exponent", wireType) + } + m.Exponent = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Exponent |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Aliases", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + 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 ErrInvalidLengthCrypto + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Aliases = append(m.Aliases, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Value) 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 ErrIntOverflowCrypto + } + 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: Value: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Value: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Amount == nil { + m.Amount = &Amount{} + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AssetId == nil { + m.AssetId = &AssetId{} + } + if err := m.AssetId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValueView) 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 ErrIntOverflowCrypto + } + 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: ValueView: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValueView: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KnownDenom", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &ValueView_KnownDenom{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ValueView = &ValueView_KnownDenom_{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnknownDenom", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &ValueView_UnknownDenom{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ValueView = &ValueView_UnknownDenom_{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValueView_KnownDenom) 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 ErrIntOverflowCrypto + } + 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: KnownDenom: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: KnownDenom: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Amount == nil { + m.Amount = &Amount{} + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Denom == nil { + m.Denom = &DenomMetadata{} + } + if err := m.Denom.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValueView_UnknownDenom) 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 ErrIntOverflowCrypto + } + 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: UnknownDenom: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UnknownDenom: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Amount == nil { + m.Amount = &Amount{} + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AssetId == nil { + m.AssetId = &AssetId{} + } + if err := m.AssetId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MerkleRoot) 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 ErrIntOverflowCrypto + } + 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: MerkleRoot: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MerkleRoot: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Asset) 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 ErrIntOverflowCrypto + } + 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: Asset: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Asset: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Id == nil { + m.Id = &AssetId{} + } + if err := m.Id.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Denom == nil { + m.Denom = &Denom{} + } + if err := m.Denom.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *IdentityKey) 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 ErrIntOverflowCrypto + } + 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: IdentityKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IdentityKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ik", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ik = append(m.Ik[:0], dAtA[iNdEx:postIndex]...) + if m.Ik == nil { + m.Ik = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GovernanceKey) 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 ErrIntOverflowCrypto + } + 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: GovernanceKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GovernanceKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Gk", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Gk = append(m.Gk[:0], dAtA[iNdEx:postIndex]...) + if m.Gk == nil { + m.Gk = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConsensusKey) 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 ErrIntOverflowCrypto + } + 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: ConsensusKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConsensusKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Note) 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 ErrIntOverflowCrypto + } + 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: Note: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Note: 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 msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Value == nil { + m.Value = &Value{} + } + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rseed", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rseed = append(m.Rseed[:0], dAtA[iNdEx:postIndex]...) + if m.Rseed == nil { + m.Rseed = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Address == nil { + m.Address = &Address{} + } + if err := m.Address.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NoteView) 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 ErrIntOverflowCrypto + } + 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: NoteView: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NoteView: 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 msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Value == nil { + m.Value = &ValueView{} + } + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rseed", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rseed = append(m.Rseed[:0], dAtA[iNdEx:postIndex]...) + if m.Rseed == nil { + m.Rseed = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Address == nil { + m.Address = &AddressView{} + } + if err := m.Address.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NoteCiphertext) 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 ErrIntOverflowCrypto + } + 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: NoteCiphertext: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NoteCiphertext: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Nullifier) 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 ErrIntOverflowCrypto + } + 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: Nullifier: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Nullifier: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SpendAuthSignature) 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 ErrIntOverflowCrypto + } + 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: SpendAuthSignature: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SpendAuthSignature: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BindingSignature) 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 ErrIntOverflowCrypto + } + 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: BindingSignature: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BindingSignature: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NotePayload) 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 ErrIntOverflowCrypto + } + 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: NotePayload: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NotePayload: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NoteCommitment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NoteCommitment == nil { + m.NoteCommitment = &StateCommitment{} + } + if err := m.NoteCommitment.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EphemeralKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EphemeralKey = append(m.EphemeralKey[:0], dAtA[iNdEx:postIndex]...) + if m.EphemeralKey == nil { + m.EphemeralKey = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EncryptedNote", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.EncryptedNote == nil { + m.EncryptedNote = &NoteCiphertext{} + } + if err := m.EncryptedNote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StateCommitmentProof) 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 ErrIntOverflowCrypto + } + 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: StateCommitmentProof: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StateCommitmentProof: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NoteCommitment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NoteCommitment == nil { + m.NoteCommitment = &StateCommitment{} + } + if err := m.NoteCommitment.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Position", wireType) + } + m.Position = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Position |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthPath", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AuthPath = append(m.AuthPath, &MerklePathChunk{}) + if err := m.AuthPath[len(m.AuthPath)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MerklePathChunk) 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 ErrIntOverflowCrypto + } + 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: MerklePathChunk: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MerklePathChunk: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sibling_1", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sibling_1 = append(m.Sibling_1[:0], dAtA[iNdEx:postIndex]...) + if m.Sibling_1 == nil { + m.Sibling_1 = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sibling_2", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sibling_2 = append(m.Sibling_2[:0], dAtA[iNdEx:postIndex]...) + if m.Sibling_2 == nil { + m.Sibling_2 = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sibling_3", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sibling_3 = append(m.Sibling_3[:0], dAtA[iNdEx:postIndex]...) + if m.Sibling_3 == nil { + m.Sibling_3 = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Clue) 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 ErrIntOverflowCrypto + } + 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: Clue: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Clue: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EffectHash) 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 ErrIntOverflowCrypto + } + 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: EffectHash: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EffectHash: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ZKOutputProof) 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 ErrIntOverflowCrypto + } + 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: ZKOutputProof: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ZKOutputProof: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ZKSpendProof) 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 ErrIntOverflowCrypto + } + 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: ZKSpendProof: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ZKSpendProof: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ZKSwapProof) 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 ErrIntOverflowCrypto + } + 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: ZKSwapProof: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ZKSwapProof: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ZKUndelegateClaimProof) 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 ErrIntOverflowCrypto + } + 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: ZKUndelegateClaimProof: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ZKUndelegateClaimProof: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ZKDelegatorVoteProof) 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 ErrIntOverflowCrypto + } + 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: ZKDelegatorVoteProof: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ZKDelegatorVoteProof: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ZKNullifierDerivationProof) 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 ErrIntOverflowCrypto + } + 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: ZKNullifierDerivationProof: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ZKNullifierDerivationProof: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrypto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCrypto + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCrypto + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrypto(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrypto + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipCrypto(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, ErrIntOverflowCrypto + } + 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, ErrIntOverflowCrypto + } + 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, ErrIntOverflowCrypto + } + 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, ErrInvalidLengthCrypto + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupCrypto + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthCrypto + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthCrypto = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowCrypto = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupCrypto = fmt.Errorf("proto: unexpected end of group") +) diff --git a/relayer/chains/penumbra/core/dex/v1alpha1/dex.pb.go b/relayer/chains/penumbra/core/dex/v1alpha1/dex.pb.go new file mode 100644 index 000000000..0fa502019 --- /dev/null +++ b/relayer/chains/penumbra/core/dex/v1alpha1/dex.pb.go @@ -0,0 +1,9467 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: penumbra/core/dex/v1alpha1/dex.proto + +package dexv1alpha1 + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + v1alpha1 "github.com/cosmos/relayer/v2/relayer/chains/penumbra/core/crypto/v1alpha1" + 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 PositionState_PositionStateEnum int32 + +const ( + PositionState_POSITION_STATE_ENUM_UNSPECIFIED PositionState_PositionStateEnum = 0 + // The position has been opened, is active, has reserves and accumulated + // fees, and can be traded against. + PositionState_POSITION_STATE_ENUM_OPENED PositionState_PositionStateEnum = 1 + // The position has been closed, is inactive and can no longer be traded + // against, but still has reserves and accumulated fees. + PositionState_POSITION_STATE_ENUM_CLOSED PositionState_PositionStateEnum = 2 + // The final reserves and accumulated fees have been withdrawn, leaving an + // empty, inactive position awaiting (possible) retroactive rewards. + PositionState_POSITION_STATE_ENUM_WITHDRAWN PositionState_PositionStateEnum = 3 + // Any retroactive rewards have been claimed. The position is now an inert, + // historical artefact. + PositionState_POSITION_STATE_ENUM_CLAIMED PositionState_PositionStateEnum = 4 +) + +var PositionState_PositionStateEnum_name = map[int32]string{ + 0: "POSITION_STATE_ENUM_UNSPECIFIED", + 1: "POSITION_STATE_ENUM_OPENED", + 2: "POSITION_STATE_ENUM_CLOSED", + 3: "POSITION_STATE_ENUM_WITHDRAWN", + 4: "POSITION_STATE_ENUM_CLAIMED", +} + +var PositionState_PositionStateEnum_value = map[string]int32{ + "POSITION_STATE_ENUM_UNSPECIFIED": 0, + "POSITION_STATE_ENUM_OPENED": 1, + "POSITION_STATE_ENUM_CLOSED": 2, + "POSITION_STATE_ENUM_WITHDRAWN": 3, + "POSITION_STATE_ENUM_CLAIMED": 4, +} + +func (x PositionState_PositionStateEnum) String() string { + return proto.EnumName(PositionState_PositionStateEnum_name, int32(x)) +} + +func (PositionState_PositionStateEnum) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{19, 0} +} + +// A transaction action that submits a swap to the dex. +type Swap struct { + // Contains the Swap proof. + Proof *v1alpha1.ZKSwapProof `protobuf:"bytes,1,opt,name=proof,proto3" json:"proof,omitempty"` + // MockFlowCiphertext dropped until flow encryption/ABCI++ available + // // Encrypted amount of asset 1 of the trading pair. + // MockFlowCiphertext enc_amount_1 = 2; + // // Encrypted amount of asset 2 of the trading pair. + // MockFlowCiphertext enc_amount_2 = 3; + // Encapsulates the authorized fields of the Swap action, used in signing. + Body *SwapBody `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"` +} + +func (m *Swap) Reset() { *m = Swap{} } +func (m *Swap) String() string { return proto.CompactTextString(m) } +func (*Swap) ProtoMessage() {} +func (*Swap) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{0} +} +func (m *Swap) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Swap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Swap.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 *Swap) XXX_Merge(src proto.Message) { + xxx_messageInfo_Swap.Merge(m, src) +} +func (m *Swap) XXX_Size() int { + return m.Size() +} +func (m *Swap) XXX_DiscardUnknown() { + xxx_messageInfo_Swap.DiscardUnknown(m) +} + +var xxx_messageInfo_Swap proto.InternalMessageInfo + +func (m *Swap) GetProof() *v1alpha1.ZKSwapProof { + if m != nil { + return m.Proof + } + return nil +} + +func (m *Swap) GetBody() *SwapBody { + if m != nil { + return m.Body + } + return nil +} + +// A transaction action that obtains assets previously confirmed +// via a Swap transaction. Does not include a spend authorization +// signature, as it is only capable of consuming the NFT from a +// Swap transaction. +type SwapClaim struct { + // Contains the SwapClaim proof. + Proof []byte `protobuf:"bytes,1,opt,name=proof,proto3" json:"proof,omitempty"` + // Encapsulates the authorized fields of the SwapClaim action, used in signing. + Body *SwapClaimBody `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` + // The epoch duration of the chain when the swap claim took place. + EpochDuration uint64 `protobuf:"varint,7,opt,name=epoch_duration,json=epochDuration,proto3" json:"epoch_duration,omitempty"` +} + +func (m *SwapClaim) Reset() { *m = SwapClaim{} } +func (m *SwapClaim) String() string { return proto.CompactTextString(m) } +func (*SwapClaim) ProtoMessage() {} +func (*SwapClaim) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{1} +} +func (m *SwapClaim) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SwapClaim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SwapClaim.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 *SwapClaim) XXX_Merge(src proto.Message) { + xxx_messageInfo_SwapClaim.Merge(m, src) +} +func (m *SwapClaim) XXX_Size() int { + return m.Size() +} +func (m *SwapClaim) XXX_DiscardUnknown() { + xxx_messageInfo_SwapClaim.DiscardUnknown(m) +} + +var xxx_messageInfo_SwapClaim proto.InternalMessageInfo + +func (m *SwapClaim) GetProof() []byte { + if m != nil { + return m.Proof + } + return nil +} + +func (m *SwapClaim) GetBody() *SwapClaimBody { + if m != nil { + return m.Body + } + return nil +} + +func (m *SwapClaim) GetEpochDuration() uint64 { + if m != nil { + return m.EpochDuration + } + return 0 +} + +// Encapsulates the authorized fields of the SwapClaim action, used in signing. +type SwapClaimBody struct { + // The nullifier for the Swap commitment to be consumed. + Nullifier *v1alpha1.Nullifier `protobuf:"bytes,1,opt,name=nullifier,proto3" json:"nullifier,omitempty"` + // The fee allows `SwapClaim` without an additional `Spend`. + Fee *v1alpha1.Fee `protobuf:"bytes,2,opt,name=fee,proto3" json:"fee,omitempty"` + // Note output for asset 1. + Output_1Commitment *v1alpha1.StateCommitment `protobuf:"bytes,3,opt,name=output_1_commitment,json=output1Commitment,proto3" json:"output_1_commitment,omitempty"` + // Note output for asset 2. + Output_2Commitment *v1alpha1.StateCommitment `protobuf:"bytes,4,opt,name=output_2_commitment,json=output2Commitment,proto3" json:"output_2_commitment,omitempty"` + // Input and output amounts, and asset IDs for the assets in the swap. + OutputData *BatchSwapOutputData `protobuf:"bytes,6,opt,name=output_data,json=outputData,proto3" json:"output_data,omitempty"` +} + +func (m *SwapClaimBody) Reset() { *m = SwapClaimBody{} } +func (m *SwapClaimBody) String() string { return proto.CompactTextString(m) } +func (*SwapClaimBody) ProtoMessage() {} +func (*SwapClaimBody) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{2} +} +func (m *SwapClaimBody) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SwapClaimBody) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SwapClaimBody.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 *SwapClaimBody) XXX_Merge(src proto.Message) { + xxx_messageInfo_SwapClaimBody.Merge(m, src) +} +func (m *SwapClaimBody) XXX_Size() int { + return m.Size() +} +func (m *SwapClaimBody) XXX_DiscardUnknown() { + xxx_messageInfo_SwapClaimBody.DiscardUnknown(m) +} + +var xxx_messageInfo_SwapClaimBody proto.InternalMessageInfo + +func (m *SwapClaimBody) GetNullifier() *v1alpha1.Nullifier { + if m != nil { + return m.Nullifier + } + return nil +} + +func (m *SwapClaimBody) GetFee() *v1alpha1.Fee { + if m != nil { + return m.Fee + } + return nil +} + +func (m *SwapClaimBody) GetOutput_1Commitment() *v1alpha1.StateCommitment { + if m != nil { + return m.Output_1Commitment + } + return nil +} + +func (m *SwapClaimBody) GetOutput_2Commitment() *v1alpha1.StateCommitment { + if m != nil { + return m.Output_2Commitment + } + return nil +} + +func (m *SwapClaimBody) GetOutputData() *BatchSwapOutputData { + if m != nil { + return m.OutputData + } + return nil +} + +// The authorized data of a Swap transaction. +type SwapBody struct { + // The trading pair to swap. + TradingPair *TradingPair `protobuf:"bytes,1,opt,name=trading_pair,json=tradingPair,proto3" json:"trading_pair,omitempty"` + // The amount for asset 1. + Delta_1I *v1alpha1.Amount `protobuf:"bytes,2,opt,name=delta_1_i,json=delta1I,proto3" json:"delta_1_i,omitempty"` + // The amount for asset 2. + Delta_2I *v1alpha1.Amount `protobuf:"bytes,3,opt,name=delta_2_i,json=delta2I,proto3" json:"delta_2_i,omitempty"` + // A commitment to a prepaid fee for the future SwapClaim. + // This is recorded separately from delta_j_i because it's shielded; + // in the future we'll want separate commitments to each delta_j_i + // anyways in order to prove consistency with flow encryption. + FeeCommitment *v1alpha1.BalanceCommitment `protobuf:"bytes,4,opt,name=fee_commitment,json=feeCommitment,proto3" json:"fee_commitment,omitempty"` + // The swap commitment and encryption of the swap data. + Payload *SwapPayload `protobuf:"bytes,5,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (m *SwapBody) Reset() { *m = SwapBody{} } +func (m *SwapBody) String() string { return proto.CompactTextString(m) } +func (*SwapBody) ProtoMessage() {} +func (*SwapBody) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{3} +} +func (m *SwapBody) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SwapBody) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SwapBody.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 *SwapBody) XXX_Merge(src proto.Message) { + xxx_messageInfo_SwapBody.Merge(m, src) +} +func (m *SwapBody) XXX_Size() int { + return m.Size() +} +func (m *SwapBody) XXX_DiscardUnknown() { + xxx_messageInfo_SwapBody.DiscardUnknown(m) +} + +var xxx_messageInfo_SwapBody proto.InternalMessageInfo + +func (m *SwapBody) GetTradingPair() *TradingPair { + if m != nil { + return m.TradingPair + } + return nil +} + +func (m *SwapBody) GetDelta_1I() *v1alpha1.Amount { + if m != nil { + return m.Delta_1I + } + return nil +} + +func (m *SwapBody) GetDelta_2I() *v1alpha1.Amount { + if m != nil { + return m.Delta_2I + } + return nil +} + +func (m *SwapBody) GetFeeCommitment() *v1alpha1.BalanceCommitment { + if m != nil { + return m.FeeCommitment + } + return nil +} + +func (m *SwapBody) GetPayload() *SwapPayload { + if m != nil { + return m.Payload + } + return nil +} + +type SwapPayload struct { + Commitment *v1alpha1.StateCommitment `protobuf:"bytes,1,opt,name=commitment,proto3" json:"commitment,omitempty"` + EncryptedSwap []byte `protobuf:"bytes,2,opt,name=encrypted_swap,json=encryptedSwap,proto3" json:"encrypted_swap,omitempty"` +} + +func (m *SwapPayload) Reset() { *m = SwapPayload{} } +func (m *SwapPayload) String() string { return proto.CompactTextString(m) } +func (*SwapPayload) ProtoMessage() {} +func (*SwapPayload) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{4} +} +func (m *SwapPayload) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SwapPayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SwapPayload.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 *SwapPayload) XXX_Merge(src proto.Message) { + xxx_messageInfo_SwapPayload.Merge(m, src) +} +func (m *SwapPayload) XXX_Size() int { + return m.Size() +} +func (m *SwapPayload) XXX_DiscardUnknown() { + xxx_messageInfo_SwapPayload.DiscardUnknown(m) +} + +var xxx_messageInfo_SwapPayload proto.InternalMessageInfo + +func (m *SwapPayload) GetCommitment() *v1alpha1.StateCommitment { + if m != nil { + return m.Commitment + } + return nil +} + +func (m *SwapPayload) GetEncryptedSwap() []byte { + if m != nil { + return m.EncryptedSwap + } + return nil +} + +type SwapPlaintext struct { + // The trading pair to swap. + TradingPair *TradingPair `protobuf:"bytes,1,opt,name=trading_pair,json=tradingPair,proto3" json:"trading_pair,omitempty"` + // Input amount of asset 1 + Delta_1I *v1alpha1.Amount `protobuf:"bytes,2,opt,name=delta_1_i,json=delta1I,proto3" json:"delta_1_i,omitempty"` + // Input amount of asset 2 + Delta_2I *v1alpha1.Amount `protobuf:"bytes,3,opt,name=delta_2_i,json=delta2I,proto3" json:"delta_2_i,omitempty"` + // Pre-paid fee to claim the swap + ClaimFee *v1alpha1.Fee `protobuf:"bytes,4,opt,name=claim_fee,json=claimFee,proto3" json:"claim_fee,omitempty"` + // Address that will claim the swap outputs via SwapClaim. + ClaimAddress *v1alpha1.Address `protobuf:"bytes,5,opt,name=claim_address,json=claimAddress,proto3" json:"claim_address,omitempty"` + // Swap rseed (blinding factors are derived from this) + Rseed []byte `protobuf:"bytes,6,opt,name=rseed,proto3" json:"rseed,omitempty"` +} + +func (m *SwapPlaintext) Reset() { *m = SwapPlaintext{} } +func (m *SwapPlaintext) String() string { return proto.CompactTextString(m) } +func (*SwapPlaintext) ProtoMessage() {} +func (*SwapPlaintext) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{5} +} +func (m *SwapPlaintext) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SwapPlaintext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SwapPlaintext.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 *SwapPlaintext) XXX_Merge(src proto.Message) { + xxx_messageInfo_SwapPlaintext.Merge(m, src) +} +func (m *SwapPlaintext) XXX_Size() int { + return m.Size() +} +func (m *SwapPlaintext) XXX_DiscardUnknown() { + xxx_messageInfo_SwapPlaintext.DiscardUnknown(m) +} + +var xxx_messageInfo_SwapPlaintext proto.InternalMessageInfo + +func (m *SwapPlaintext) GetTradingPair() *TradingPair { + if m != nil { + return m.TradingPair + } + return nil +} + +func (m *SwapPlaintext) GetDelta_1I() *v1alpha1.Amount { + if m != nil { + return m.Delta_1I + } + return nil +} + +func (m *SwapPlaintext) GetDelta_2I() *v1alpha1.Amount { + if m != nil { + return m.Delta_2I + } + return nil +} + +func (m *SwapPlaintext) GetClaimFee() *v1alpha1.Fee { + if m != nil { + return m.ClaimFee + } + return nil +} + +func (m *SwapPlaintext) GetClaimAddress() *v1alpha1.Address { + if m != nil { + return m.ClaimAddress + } + return nil +} + +func (m *SwapPlaintext) GetRseed() []byte { + if m != nil { + return m.Rseed + } + return nil +} + +type MockFlowCiphertext struct { + // Represents this transaction's contribution to flow's value. + Value *v1alpha1.Amount `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *MockFlowCiphertext) Reset() { *m = MockFlowCiphertext{} } +func (m *MockFlowCiphertext) String() string { return proto.CompactTextString(m) } +func (*MockFlowCiphertext) ProtoMessage() {} +func (*MockFlowCiphertext) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{6} +} +func (m *MockFlowCiphertext) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MockFlowCiphertext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MockFlowCiphertext.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 *MockFlowCiphertext) XXX_Merge(src proto.Message) { + xxx_messageInfo_MockFlowCiphertext.Merge(m, src) +} +func (m *MockFlowCiphertext) XXX_Size() int { + return m.Size() +} +func (m *MockFlowCiphertext) XXX_DiscardUnknown() { + xxx_messageInfo_MockFlowCiphertext.DiscardUnknown(m) +} + +var xxx_messageInfo_MockFlowCiphertext proto.InternalMessageInfo + +func (m *MockFlowCiphertext) GetValue() *v1alpha1.Amount { + if m != nil { + return m.Value + } + return nil +} + +type SwapPlan struct { + // The plaintext version of the swap to be performed. + SwapPlaintext *SwapPlaintext `protobuf:"bytes,1,opt,name=swap_plaintext,json=swapPlaintext,proto3" json:"swap_plaintext,omitempty"` + // The blinding factor for the fee commitment. The fee in the SwapPlan is private to prevent linkability with the SwapClaim. + FeeBlinding []byte `protobuf:"bytes,2,opt,name=fee_blinding,json=feeBlinding,proto3" json:"fee_blinding,omitempty"` +} + +func (m *SwapPlan) Reset() { *m = SwapPlan{} } +func (m *SwapPlan) String() string { return proto.CompactTextString(m) } +func (*SwapPlan) ProtoMessage() {} +func (*SwapPlan) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{7} +} +func (m *SwapPlan) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SwapPlan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SwapPlan.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 *SwapPlan) XXX_Merge(src proto.Message) { + xxx_messageInfo_SwapPlan.Merge(m, src) +} +func (m *SwapPlan) XXX_Size() int { + return m.Size() +} +func (m *SwapPlan) XXX_DiscardUnknown() { + xxx_messageInfo_SwapPlan.DiscardUnknown(m) +} + +var xxx_messageInfo_SwapPlan proto.InternalMessageInfo + +func (m *SwapPlan) GetSwapPlaintext() *SwapPlaintext { + if m != nil { + return m.SwapPlaintext + } + return nil +} + +func (m *SwapPlan) GetFeeBlinding() []byte { + if m != nil { + return m.FeeBlinding + } + return nil +} + +type SwapClaimPlan struct { + // The plaintext version of the swap to be performed. + SwapPlaintext *SwapPlaintext `protobuf:"bytes,1,opt,name=swap_plaintext,json=swapPlaintext,proto3" json:"swap_plaintext,omitempty"` + // The position of the swap commitment. + Position uint64 `protobuf:"varint,2,opt,name=position,proto3" json:"position,omitempty"` + // Input and output amounts for the Swap. + OutputData *BatchSwapOutputData `protobuf:"bytes,3,opt,name=output_data,json=outputData,proto3" json:"output_data,omitempty"` + // The epoch duration, used in proving. + EpochDuration uint64 `protobuf:"varint,4,opt,name=epoch_duration,json=epochDuration,proto3" json:"epoch_duration,omitempty"` +} + +func (m *SwapClaimPlan) Reset() { *m = SwapClaimPlan{} } +func (m *SwapClaimPlan) String() string { return proto.CompactTextString(m) } +func (*SwapClaimPlan) ProtoMessage() {} +func (*SwapClaimPlan) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{8} +} +func (m *SwapClaimPlan) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SwapClaimPlan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SwapClaimPlan.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 *SwapClaimPlan) XXX_Merge(src proto.Message) { + xxx_messageInfo_SwapClaimPlan.Merge(m, src) +} +func (m *SwapClaimPlan) XXX_Size() int { + return m.Size() +} +func (m *SwapClaimPlan) XXX_DiscardUnknown() { + xxx_messageInfo_SwapClaimPlan.DiscardUnknown(m) +} + +var xxx_messageInfo_SwapClaimPlan proto.InternalMessageInfo + +func (m *SwapClaimPlan) GetSwapPlaintext() *SwapPlaintext { + if m != nil { + return m.SwapPlaintext + } + return nil +} + +func (m *SwapClaimPlan) GetPosition() uint64 { + if m != nil { + return m.Position + } + return 0 +} + +func (m *SwapClaimPlan) GetOutputData() *BatchSwapOutputData { + if m != nil { + return m.OutputData + } + return nil +} + +func (m *SwapClaimPlan) GetEpochDuration() uint64 { + if m != nil { + return m.EpochDuration + } + return 0 +} + +type SwapView struct { + // Types that are valid to be assigned to SwapView: + // *SwapView_Visible_ + // *SwapView_Opaque_ + SwapView isSwapView_SwapView `protobuf_oneof:"swap_view"` +} + +func (m *SwapView) Reset() { *m = SwapView{} } +func (m *SwapView) String() string { return proto.CompactTextString(m) } +func (*SwapView) ProtoMessage() {} +func (*SwapView) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{9} +} +func (m *SwapView) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SwapView) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SwapView.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 *SwapView) XXX_Merge(src proto.Message) { + xxx_messageInfo_SwapView.Merge(m, src) +} +func (m *SwapView) XXX_Size() int { + return m.Size() +} +func (m *SwapView) XXX_DiscardUnknown() { + xxx_messageInfo_SwapView.DiscardUnknown(m) +} + +var xxx_messageInfo_SwapView proto.InternalMessageInfo + +type isSwapView_SwapView interface { + isSwapView_SwapView() + MarshalTo([]byte) (int, error) + Size() int +} + +type SwapView_Visible_ struct { + Visible *SwapView_Visible `protobuf:"bytes,1,opt,name=visible,proto3,oneof" json:"visible,omitempty"` +} +type SwapView_Opaque_ struct { + Opaque *SwapView_Opaque `protobuf:"bytes,2,opt,name=opaque,proto3,oneof" json:"opaque,omitempty"` +} + +func (*SwapView_Visible_) isSwapView_SwapView() {} +func (*SwapView_Opaque_) isSwapView_SwapView() {} + +func (m *SwapView) GetSwapView() isSwapView_SwapView { + if m != nil { + return m.SwapView + } + return nil +} + +func (m *SwapView) GetVisible() *SwapView_Visible { + if x, ok := m.GetSwapView().(*SwapView_Visible_); ok { + return x.Visible + } + return nil +} + +func (m *SwapView) GetOpaque() *SwapView_Opaque { + if x, ok := m.GetSwapView().(*SwapView_Opaque_); ok { + return x.Opaque + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*SwapView) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*SwapView_Visible_)(nil), + (*SwapView_Opaque_)(nil), + } +} + +type SwapView_Visible struct { + Swap *Swap `protobuf:"bytes,1,opt,name=swap,proto3" json:"swap,omitempty"` + SwapPlaintext *SwapPlaintext `protobuf:"bytes,3,opt,name=swap_plaintext,json=swapPlaintext,proto3" json:"swap_plaintext,omitempty"` +} + +func (m *SwapView_Visible) Reset() { *m = SwapView_Visible{} } +func (m *SwapView_Visible) String() string { return proto.CompactTextString(m) } +func (*SwapView_Visible) ProtoMessage() {} +func (*SwapView_Visible) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{9, 0} +} +func (m *SwapView_Visible) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SwapView_Visible) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SwapView_Visible.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 *SwapView_Visible) XXX_Merge(src proto.Message) { + xxx_messageInfo_SwapView_Visible.Merge(m, src) +} +func (m *SwapView_Visible) XXX_Size() int { + return m.Size() +} +func (m *SwapView_Visible) XXX_DiscardUnknown() { + xxx_messageInfo_SwapView_Visible.DiscardUnknown(m) +} + +var xxx_messageInfo_SwapView_Visible proto.InternalMessageInfo + +func (m *SwapView_Visible) GetSwap() *Swap { + if m != nil { + return m.Swap + } + return nil +} + +func (m *SwapView_Visible) GetSwapPlaintext() *SwapPlaintext { + if m != nil { + return m.SwapPlaintext + } + return nil +} + +type SwapView_Opaque struct { + Swap *Swap `protobuf:"bytes,1,opt,name=swap,proto3" json:"swap,omitempty"` +} + +func (m *SwapView_Opaque) Reset() { *m = SwapView_Opaque{} } +func (m *SwapView_Opaque) String() string { return proto.CompactTextString(m) } +func (*SwapView_Opaque) ProtoMessage() {} +func (*SwapView_Opaque) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{9, 1} +} +func (m *SwapView_Opaque) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SwapView_Opaque) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SwapView_Opaque.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 *SwapView_Opaque) XXX_Merge(src proto.Message) { + xxx_messageInfo_SwapView_Opaque.Merge(m, src) +} +func (m *SwapView_Opaque) XXX_Size() int { + return m.Size() +} +func (m *SwapView_Opaque) XXX_DiscardUnknown() { + xxx_messageInfo_SwapView_Opaque.DiscardUnknown(m) +} + +var xxx_messageInfo_SwapView_Opaque proto.InternalMessageInfo + +func (m *SwapView_Opaque) GetSwap() *Swap { + if m != nil { + return m.Swap + } + return nil +} + +type SwapClaimView struct { + // Types that are valid to be assigned to SwapClaimView: + // + // *SwapClaimView_Visible_ + // *SwapClaimView_Opaque_ + SwapClaimView isSwapClaimView_SwapClaimView `protobuf_oneof:"swap_claim_view"` +} + +func (m *SwapClaimView) Reset() { *m = SwapClaimView{} } +func (m *SwapClaimView) String() string { return proto.CompactTextString(m) } +func (*SwapClaimView) ProtoMessage() {} +func (*SwapClaimView) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{10} +} +func (m *SwapClaimView) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SwapClaimView) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SwapClaimView.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 *SwapClaimView) XXX_Merge(src proto.Message) { + xxx_messageInfo_SwapClaimView.Merge(m, src) +} +func (m *SwapClaimView) XXX_Size() int { + return m.Size() +} +func (m *SwapClaimView) XXX_DiscardUnknown() { + xxx_messageInfo_SwapClaimView.DiscardUnknown(m) +} + +var xxx_messageInfo_SwapClaimView proto.InternalMessageInfo + +type isSwapClaimView_SwapClaimView interface { + isSwapClaimView_SwapClaimView() + MarshalTo([]byte) (int, error) + Size() int +} + +type SwapClaimView_Visible_ struct { + Visible *SwapClaimView_Visible `protobuf:"bytes,1,opt,name=visible,proto3,oneof" json:"visible,omitempty"` +} +type SwapClaimView_Opaque_ struct { + Opaque *SwapClaimView_Opaque `protobuf:"bytes,2,opt,name=opaque,proto3,oneof" json:"opaque,omitempty"` +} + +func (*SwapClaimView_Visible_) isSwapClaimView_SwapClaimView() {} +func (*SwapClaimView_Opaque_) isSwapClaimView_SwapClaimView() {} + +func (m *SwapClaimView) GetSwapClaimView() isSwapClaimView_SwapClaimView { + if m != nil { + return m.SwapClaimView + } + return nil +} + +func (m *SwapClaimView) GetVisible() *SwapClaimView_Visible { + if x, ok := m.GetSwapClaimView().(*SwapClaimView_Visible_); ok { + return x.Visible + } + return nil +} + +func (m *SwapClaimView) GetOpaque() *SwapClaimView_Opaque { + if x, ok := m.GetSwapClaimView().(*SwapClaimView_Opaque_); ok { + return x.Opaque + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*SwapClaimView) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*SwapClaimView_Visible_)(nil), + (*SwapClaimView_Opaque_)(nil), + } +} + +type SwapClaimView_Visible struct { + SwapClaim *SwapClaim `protobuf:"bytes,1,opt,name=swap_claim,json=swapClaim,proto3" json:"swap_claim,omitempty"` + Output_1 *v1alpha1.NoteView `protobuf:"bytes,2,opt,name=output_1,json=output1,proto3" json:"output_1,omitempty"` + Output_2 *v1alpha1.NoteView `protobuf:"bytes,3,opt,name=output_2,json=output2,proto3" json:"output_2,omitempty"` +} + +func (m *SwapClaimView_Visible) Reset() { *m = SwapClaimView_Visible{} } +func (m *SwapClaimView_Visible) String() string { return proto.CompactTextString(m) } +func (*SwapClaimView_Visible) ProtoMessage() {} +func (*SwapClaimView_Visible) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{10, 0} +} +func (m *SwapClaimView_Visible) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SwapClaimView_Visible) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SwapClaimView_Visible.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 *SwapClaimView_Visible) XXX_Merge(src proto.Message) { + xxx_messageInfo_SwapClaimView_Visible.Merge(m, src) +} +func (m *SwapClaimView_Visible) XXX_Size() int { + return m.Size() +} +func (m *SwapClaimView_Visible) XXX_DiscardUnknown() { + xxx_messageInfo_SwapClaimView_Visible.DiscardUnknown(m) +} + +var xxx_messageInfo_SwapClaimView_Visible proto.InternalMessageInfo + +func (m *SwapClaimView_Visible) GetSwapClaim() *SwapClaim { + if m != nil { + return m.SwapClaim + } + return nil +} + +func (m *SwapClaimView_Visible) GetOutput_1() *v1alpha1.NoteView { + if m != nil { + return m.Output_1 + } + return nil +} + +func (m *SwapClaimView_Visible) GetOutput_2() *v1alpha1.NoteView { + if m != nil { + return m.Output_2 + } + return nil +} + +type SwapClaimView_Opaque struct { + SwapClaim *SwapClaim `protobuf:"bytes,1,opt,name=swap_claim,json=swapClaim,proto3" json:"swap_claim,omitempty"` +} + +func (m *SwapClaimView_Opaque) Reset() { *m = SwapClaimView_Opaque{} } +func (m *SwapClaimView_Opaque) String() string { return proto.CompactTextString(m) } +func (*SwapClaimView_Opaque) ProtoMessage() {} +func (*SwapClaimView_Opaque) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{10, 1} +} +func (m *SwapClaimView_Opaque) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SwapClaimView_Opaque) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SwapClaimView_Opaque.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 *SwapClaimView_Opaque) XXX_Merge(src proto.Message) { + xxx_messageInfo_SwapClaimView_Opaque.Merge(m, src) +} +func (m *SwapClaimView_Opaque) XXX_Size() int { + return m.Size() +} +func (m *SwapClaimView_Opaque) XXX_DiscardUnknown() { + xxx_messageInfo_SwapClaimView_Opaque.DiscardUnknown(m) +} + +var xxx_messageInfo_SwapClaimView_Opaque proto.InternalMessageInfo + +func (m *SwapClaimView_Opaque) GetSwapClaim() *SwapClaim { + if m != nil { + return m.SwapClaim + } + return nil +} + +// Holds two asset IDs. Ordering doesn't reflect trading direction. Instead, we +// require `asset_1 < asset_2` as field elements, to ensure a canonical +// representation of an unordered pair. +type TradingPair struct { + // The first asset of the pair. + Asset_1 *v1alpha1.AssetId `protobuf:"bytes,1,opt,name=asset_1,json=asset1,proto3" json:"asset_1,omitempty"` + // The second asset of the pair. + Asset_2 *v1alpha1.AssetId `protobuf:"bytes,2,opt,name=asset_2,json=asset2,proto3" json:"asset_2,omitempty"` +} + +func (m *TradingPair) Reset() { *m = TradingPair{} } +func (m *TradingPair) String() string { return proto.CompactTextString(m) } +func (*TradingPair) ProtoMessage() {} +func (*TradingPair) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{11} +} +func (m *TradingPair) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TradingPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TradingPair.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 *TradingPair) XXX_Merge(src proto.Message) { + xxx_messageInfo_TradingPair.Merge(m, src) +} +func (m *TradingPair) XXX_Size() int { + return m.Size() +} +func (m *TradingPair) XXX_DiscardUnknown() { + xxx_messageInfo_TradingPair.DiscardUnknown(m) +} + +var xxx_messageInfo_TradingPair proto.InternalMessageInfo + +func (m *TradingPair) GetAsset_1() *v1alpha1.AssetId { + if m != nil { + return m.Asset_1 + } + return nil +} + +func (m *TradingPair) GetAsset_2() *v1alpha1.AssetId { + if m != nil { + return m.Asset_2 + } + return nil +} + +// Encodes a trading pair starting from asset `start` +// and ending on asset `end`. +type DirectedTradingPair struct { + // The start asset of the pair. + Start *v1alpha1.AssetId `protobuf:"bytes,1,opt,name=start,proto3" json:"start,omitempty"` + // The end asset of the pair. + End *v1alpha1.AssetId `protobuf:"bytes,2,opt,name=end,proto3" json:"end,omitempty"` +} + +func (m *DirectedTradingPair) Reset() { *m = DirectedTradingPair{} } +func (m *DirectedTradingPair) String() string { return proto.CompactTextString(m) } +func (*DirectedTradingPair) ProtoMessage() {} +func (*DirectedTradingPair) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{12} +} +func (m *DirectedTradingPair) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DirectedTradingPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DirectedTradingPair.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 *DirectedTradingPair) XXX_Merge(src proto.Message) { + xxx_messageInfo_DirectedTradingPair.Merge(m, src) +} +func (m *DirectedTradingPair) XXX_Size() int { + return m.Size() +} +func (m *DirectedTradingPair) XXX_DiscardUnknown() { + xxx_messageInfo_DirectedTradingPair.DiscardUnknown(m) +} + +var xxx_messageInfo_DirectedTradingPair proto.InternalMessageInfo + +func (m *DirectedTradingPair) GetStart() *v1alpha1.AssetId { + if m != nil { + return m.Start + } + return nil +} + +func (m *DirectedTradingPair) GetEnd() *v1alpha1.AssetId { + if m != nil { + return m.End + } + return nil +} + +// Records the result of a batch swap on-chain. +// +// Used as a public input to a swap claim proof, as it implies the effective +// clearing price for the batch. +type BatchSwapOutputData struct { + // The total amount of asset 1 that was input to the batch swap. + Delta_1 *v1alpha1.Amount `protobuf:"bytes,1,opt,name=delta_1,json=delta1,proto3" json:"delta_1,omitempty"` + // The total amount of asset 2 that was input to the batch swap. + Delta_2 *v1alpha1.Amount `protobuf:"bytes,2,opt,name=delta_2,json=delta2,proto3" json:"delta_2,omitempty"` + // The total amount of asset 1 that was output from the batch swap for 2=>1 trades. + Lambda_1 *v1alpha1.Amount `protobuf:"bytes,3,opt,name=lambda_1,json=lambda1,proto3" json:"lambda_1,omitempty"` + // The total amount of asset 2 that was output from the batch swap for 1=>2 trades. + Lambda_2 *v1alpha1.Amount `protobuf:"bytes,4,opt,name=lambda_2,json=lambda2,proto3" json:"lambda_2,omitempty"` + // The total amount of asset 1 that was returned unfilled from the batch swap for 1=>2 trades. + Unfilled_1 *v1alpha1.Amount `protobuf:"bytes,5,opt,name=unfilled_1,json=unfilled1,proto3" json:"unfilled_1,omitempty"` + // The total amount of asset 2 that was returned unfilled from the batch swap for 2=>1 trades. + Unfilled_2 *v1alpha1.Amount `protobuf:"bytes,6,opt,name=unfilled_2,json=unfilled2,proto3" json:"unfilled_2,omitempty"` + // The height for which the batch swap data is valid. + Height uint64 `protobuf:"varint,7,opt,name=height,proto3" json:"height,omitempty"` + // The trading pair associated with the batch swap. + TradingPair *TradingPair `protobuf:"bytes,8,opt,name=trading_pair,json=tradingPair,proto3" json:"trading_pair,omitempty"` + // The starting block height of the epoch for which the batch swap data is valid. + EpochHeight uint64 `protobuf:"varint,9,opt,name=epoch_height,json=epochHeight,proto3" json:"epoch_height,omitempty"` +} + +func (m *BatchSwapOutputData) Reset() { *m = BatchSwapOutputData{} } +func (m *BatchSwapOutputData) String() string { return proto.CompactTextString(m) } +func (*BatchSwapOutputData) ProtoMessage() {} +func (*BatchSwapOutputData) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{13} +} +func (m *BatchSwapOutputData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BatchSwapOutputData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BatchSwapOutputData.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 *BatchSwapOutputData) XXX_Merge(src proto.Message) { + xxx_messageInfo_BatchSwapOutputData.Merge(m, src) +} +func (m *BatchSwapOutputData) XXX_Size() int { + return m.Size() +} +func (m *BatchSwapOutputData) XXX_DiscardUnknown() { + xxx_messageInfo_BatchSwapOutputData.DiscardUnknown(m) +} + +var xxx_messageInfo_BatchSwapOutputData proto.InternalMessageInfo + +func (m *BatchSwapOutputData) GetDelta_1() *v1alpha1.Amount { + if m != nil { + return m.Delta_1 + } + return nil +} + +func (m *BatchSwapOutputData) GetDelta_2() *v1alpha1.Amount { + if m != nil { + return m.Delta_2 + } + return nil +} + +func (m *BatchSwapOutputData) GetLambda_1() *v1alpha1.Amount { + if m != nil { + return m.Lambda_1 + } + return nil +} + +func (m *BatchSwapOutputData) GetLambda_2() *v1alpha1.Amount { + if m != nil { + return m.Lambda_2 + } + return nil +} + +func (m *BatchSwapOutputData) GetUnfilled_1() *v1alpha1.Amount { + if m != nil { + return m.Unfilled_1 + } + return nil +} + +func (m *BatchSwapOutputData) GetUnfilled_2() *v1alpha1.Amount { + if m != nil { + return m.Unfilled_2 + } + return nil +} + +func (m *BatchSwapOutputData) GetHeight() uint64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *BatchSwapOutputData) GetTradingPair() *TradingPair { + if m != nil { + return m.TradingPair + } + return nil +} + +func (m *BatchSwapOutputData) GetEpochHeight() uint64 { + if m != nil { + return m.EpochHeight + } + return 0 +} + +// The trading function for a specific pair. +// For a pair (asset_1, asset_2), a trading function is defined by: +// `phi(R) = p*R_1 + q*R_2` and `gamma = 1 - fee`. +// The trading function is frequently referred to as "phi". +type TradingFunction struct { + Component *BareTradingFunction `protobuf:"bytes,1,opt,name=component,proto3" json:"component,omitempty"` + Pair *TradingPair `protobuf:"bytes,2,opt,name=pair,proto3" json:"pair,omitempty"` +} + +func (m *TradingFunction) Reset() { *m = TradingFunction{} } +func (m *TradingFunction) String() string { return proto.CompactTextString(m) } +func (*TradingFunction) ProtoMessage() {} +func (*TradingFunction) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{14} +} +func (m *TradingFunction) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TradingFunction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TradingFunction.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 *TradingFunction) XXX_Merge(src proto.Message) { + xxx_messageInfo_TradingFunction.Merge(m, src) +} +func (m *TradingFunction) XXX_Size() int { + return m.Size() +} +func (m *TradingFunction) XXX_DiscardUnknown() { + xxx_messageInfo_TradingFunction.DiscardUnknown(m) +} + +var xxx_messageInfo_TradingFunction proto.InternalMessageInfo + +func (m *TradingFunction) GetComponent() *BareTradingFunction { + if m != nil { + return m.Component + } + return nil +} + +func (m *TradingFunction) GetPair() *TradingPair { + if m != nil { + return m.Pair + } + return nil +} + +// The minimum amount of data describing a trading function. +// +// This implicitly treats the trading function as being between assets 1 and 2, +// without specifying what those assets are, to avoid duplicating data (each +// asset ID alone is twice the size of the trading function). +type BareTradingFunction struct { + Fee uint32 `protobuf:"varint,1,opt,name=fee,proto3" json:"fee,omitempty"` + // This is not actually an amount, it's an integer the same width as an amount + P *v1alpha1.Amount `protobuf:"bytes,2,opt,name=p,proto3" json:"p,omitempty"` + // This is not actually an amount, it's an integer the same width as an amount + Q *v1alpha1.Amount `protobuf:"bytes,3,opt,name=q,proto3" json:"q,omitempty"` +} + +func (m *BareTradingFunction) Reset() { *m = BareTradingFunction{} } +func (m *BareTradingFunction) String() string { return proto.CompactTextString(m) } +func (*BareTradingFunction) ProtoMessage() {} +func (*BareTradingFunction) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{15} +} +func (m *BareTradingFunction) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BareTradingFunction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BareTradingFunction.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 *BareTradingFunction) XXX_Merge(src proto.Message) { + xxx_messageInfo_BareTradingFunction.Merge(m, src) +} +func (m *BareTradingFunction) XXX_Size() int { + return m.Size() +} +func (m *BareTradingFunction) XXX_DiscardUnknown() { + xxx_messageInfo_BareTradingFunction.DiscardUnknown(m) +} + +var xxx_messageInfo_BareTradingFunction proto.InternalMessageInfo + +func (m *BareTradingFunction) GetFee() uint32 { + if m != nil { + return m.Fee + } + return 0 +} + +func (m *BareTradingFunction) GetP() *v1alpha1.Amount { + if m != nil { + return m.P + } + return nil +} + +func (m *BareTradingFunction) GetQ() *v1alpha1.Amount { + if m != nil { + return m.Q + } + return nil +} + +// The reserves of a position. +// +// Like a position, this implicitly treats the trading function as being +// between assets 1 and 2, without specifying what those assets are, to avoid +// duplicating data (each asset ID alone is four times the size of the +// reserves). +type Reserves struct { + R1 *v1alpha1.Amount `protobuf:"bytes,1,opt,name=r1,proto3" json:"r1,omitempty"` + R2 *v1alpha1.Amount `protobuf:"bytes,2,opt,name=r2,proto3" json:"r2,omitempty"` +} + +func (m *Reserves) Reset() { *m = Reserves{} } +func (m *Reserves) String() string { return proto.CompactTextString(m) } +func (*Reserves) ProtoMessage() {} +func (*Reserves) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{16} +} +func (m *Reserves) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Reserves) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Reserves.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 *Reserves) XXX_Merge(src proto.Message) { + xxx_messageInfo_Reserves.Merge(m, src) +} +func (m *Reserves) XXX_Size() int { + return m.Size() +} +func (m *Reserves) XXX_DiscardUnknown() { + xxx_messageInfo_Reserves.DiscardUnknown(m) +} + +var xxx_messageInfo_Reserves proto.InternalMessageInfo + +func (m *Reserves) GetR1() *v1alpha1.Amount { + if m != nil { + return m.R1 + } + return nil +} + +func (m *Reserves) GetR2() *v1alpha1.Amount { + if m != nil { + return m.R2 + } + return nil +} + +// Data identifying a position. +type Position struct { + Phi *TradingFunction `protobuf:"bytes,1,opt,name=phi,proto3" json:"phi,omitempty"` + // A random value used to disambiguate different positions with the exact same + // trading function. The chain should reject newly created positions with the + // same nonce as an existing position. This ensures that `PositionId`s will + // be unique, and allows us to track position ownership with a + // sequence of stateful NFTs based on the `PositionId`. + Nonce []byte `protobuf:"bytes,2,opt,name=nonce,proto3" json:"nonce,omitempty"` + State *PositionState `protobuf:"bytes,3,opt,name=state,proto3" json:"state,omitempty"` + Reserves *Reserves `protobuf:"bytes,4,opt,name=reserves,proto3" json:"reserves,omitempty"` +} + +func (m *Position) Reset() { *m = Position{} } +func (m *Position) String() string { return proto.CompactTextString(m) } +func (*Position) ProtoMessage() {} +func (*Position) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{17} +} +func (m *Position) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Position) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Position.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 *Position) XXX_Merge(src proto.Message) { + xxx_messageInfo_Position.Merge(m, src) +} +func (m *Position) XXX_Size() int { + return m.Size() +} +func (m *Position) XXX_DiscardUnknown() { + xxx_messageInfo_Position.DiscardUnknown(m) +} + +var xxx_messageInfo_Position proto.InternalMessageInfo + +func (m *Position) GetPhi() *TradingFunction { + if m != nil { + return m.Phi + } + return nil +} + +func (m *Position) GetNonce() []byte { + if m != nil { + return m.Nonce + } + return nil +} + +func (m *Position) GetState() *PositionState { + if m != nil { + return m.State + } + return nil +} + +func (m *Position) GetReserves() *Reserves { + if m != nil { + return m.Reserves + } + return nil +} + +// A hash of a `Position`. +type PositionId struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *PositionId) Reset() { *m = PositionId{} } +func (m *PositionId) String() string { return proto.CompactTextString(m) } +func (*PositionId) ProtoMessage() {} +func (*PositionId) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{18} +} +func (m *PositionId) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PositionId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PositionId.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 *PositionId) XXX_Merge(src proto.Message) { + xxx_messageInfo_PositionId.Merge(m, src) +} +func (m *PositionId) XXX_Size() int { + return m.Size() +} +func (m *PositionId) XXX_DiscardUnknown() { + xxx_messageInfo_PositionId.DiscardUnknown(m) +} + +var xxx_messageInfo_PositionId proto.InternalMessageInfo + +func (m *PositionId) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +// The state of a position. +type PositionState struct { + State PositionState_PositionStateEnum `protobuf:"varint,1,opt,name=state,proto3,enum=penumbra.core.dex.v1alpha1.PositionState_PositionStateEnum" json:"state,omitempty"` +} + +func (m *PositionState) Reset() { *m = PositionState{} } +func (m *PositionState) String() string { return proto.CompactTextString(m) } +func (*PositionState) ProtoMessage() {} +func (*PositionState) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{19} +} +func (m *PositionState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PositionState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PositionState.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 *PositionState) XXX_Merge(src proto.Message) { + xxx_messageInfo_PositionState.Merge(m, src) +} +func (m *PositionState) XXX_Size() int { + return m.Size() +} +func (m *PositionState) XXX_DiscardUnknown() { + xxx_messageInfo_PositionState.DiscardUnknown(m) +} + +var xxx_messageInfo_PositionState proto.InternalMessageInfo + +func (m *PositionState) GetState() PositionState_PositionStateEnum { + if m != nil { + return m.State + } + return PositionState_POSITION_STATE_ENUM_UNSPECIFIED +} + +// An LPNFT tracking both ownership and state of a position. +// +// Tracking the state as part of the LPNFT means that all LP-related actions can +// be authorized by spending funds: a state transition (e.g., closing a +// position) is modeled as spending an "open position LPNFT" and minting a +// "closed position LPNFT" for the same (globally unique) position ID. +// +// This means that the LP mechanics can be agnostic to the mechanism used to +// record custody and spend authorization. For instance, they can be recorded +// in the shielded pool, where custody is based on off-chain keys, or they could +// be recorded in a programmatic on-chain account (in the future, e.g., to +// support interchain accounts). This also means that LP-related actions don't +// require any cryptographic implementation (proofs, signatures, etc), other +// than hooking into the value commitment mechanism used for transaction +// balances. +type LpNft struct { + PositionId *PositionId `protobuf:"bytes,1,opt,name=position_id,json=positionId,proto3" json:"position_id,omitempty"` + State *PositionState `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` +} + +func (m *LpNft) Reset() { *m = LpNft{} } +func (m *LpNft) String() string { return proto.CompactTextString(m) } +func (*LpNft) ProtoMessage() {} +func (*LpNft) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{20} +} +func (m *LpNft) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LpNft) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LpNft.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 *LpNft) XXX_Merge(src proto.Message) { + xxx_messageInfo_LpNft.Merge(m, src) +} +func (m *LpNft) XXX_Size() int { + return m.Size() +} +func (m *LpNft) XXX_DiscardUnknown() { + xxx_messageInfo_LpNft.DiscardUnknown(m) +} + +var xxx_messageInfo_LpNft proto.InternalMessageInfo + +func (m *LpNft) GetPositionId() *PositionId { + if m != nil { + return m.PositionId + } + return nil +} + +func (m *LpNft) GetState() *PositionState { + if m != nil { + return m.State + } + return nil +} + +// A transaction action that opens a new position. +// +// This action's contribution to the transaction's value balance is to consume +// the initial reserves and contribute an opened position NFT. +type PositionOpen struct { + // Contains the data defining the position, sufficient to compute its `PositionId`. + // + // Positions are immutable, so the `PositionData` (and hence the `PositionId`) + // are unchanged over the entire lifetime of the position. + Position *Position `protobuf:"bytes,1,opt,name=position,proto3" json:"position,omitempty"` +} + +func (m *PositionOpen) Reset() { *m = PositionOpen{} } +func (m *PositionOpen) String() string { return proto.CompactTextString(m) } +func (*PositionOpen) ProtoMessage() {} +func (*PositionOpen) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{21} +} +func (m *PositionOpen) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PositionOpen) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PositionOpen.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 *PositionOpen) XXX_Merge(src proto.Message) { + xxx_messageInfo_PositionOpen.Merge(m, src) +} +func (m *PositionOpen) XXX_Size() int { + return m.Size() +} +func (m *PositionOpen) XXX_DiscardUnknown() { + xxx_messageInfo_PositionOpen.DiscardUnknown(m) +} + +var xxx_messageInfo_PositionOpen proto.InternalMessageInfo + +func (m *PositionOpen) GetPosition() *Position { + if m != nil { + return m.Position + } + return nil +} + +// A transaction action that closes a position. +// +// This action's contribution to the transaction's value balance is to consume +// an opened position NFT and contribute a closed position NFT. +// +// Closing a position does not immediately withdraw funds, because Penumbra +// transactions (like any ZK transaction model) are early-binding: the prover +// must know the state transition they prove knowledge of, and they cannot know +// the final reserves with certainty until after the position has been deactivated. +type PositionClose struct { + PositionId *PositionId `protobuf:"bytes,1,opt,name=position_id,json=positionId,proto3" json:"position_id,omitempty"` +} + +func (m *PositionClose) Reset() { *m = PositionClose{} } +func (m *PositionClose) String() string { return proto.CompactTextString(m) } +func (*PositionClose) ProtoMessage() {} +func (*PositionClose) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{22} +} +func (m *PositionClose) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PositionClose) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PositionClose.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 *PositionClose) XXX_Merge(src proto.Message) { + xxx_messageInfo_PositionClose.Merge(m, src) +} +func (m *PositionClose) XXX_Size() int { + return m.Size() +} +func (m *PositionClose) XXX_DiscardUnknown() { + xxx_messageInfo_PositionClose.DiscardUnknown(m) +} + +var xxx_messageInfo_PositionClose proto.InternalMessageInfo + +func (m *PositionClose) GetPositionId() *PositionId { + if m != nil { + return m.PositionId + } + return nil +} + +// A transaction action that withdraws funds from a closed position. +// +// This action's contribution to the transaction's value balance is to consume a +// closed position NFT and contribute a withdrawn position NFT, as well as all +// of the funds that were in the position at the time of closing. +type PositionWithdraw struct { + PositionId *PositionId `protobuf:"bytes,1,opt,name=position_id,json=positionId,proto3" json:"position_id,omitempty"` + // A transparent (zero blinding factor) commitment to the position's final reserves and fees. + // + // The chain will check this commitment by recomputing it with the on-chain state. + ReservesCommitment *v1alpha1.BalanceCommitment `protobuf:"bytes,2,opt,name=reserves_commitment,json=reservesCommitment,proto3" json:"reserves_commitment,omitempty"` +} + +func (m *PositionWithdraw) Reset() { *m = PositionWithdraw{} } +func (m *PositionWithdraw) String() string { return proto.CompactTextString(m) } +func (*PositionWithdraw) ProtoMessage() {} +func (*PositionWithdraw) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{23} +} +func (m *PositionWithdraw) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PositionWithdraw) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PositionWithdraw.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 *PositionWithdraw) XXX_Merge(src proto.Message) { + xxx_messageInfo_PositionWithdraw.Merge(m, src) +} +func (m *PositionWithdraw) XXX_Size() int { + return m.Size() +} +func (m *PositionWithdraw) XXX_DiscardUnknown() { + xxx_messageInfo_PositionWithdraw.DiscardUnknown(m) +} + +var xxx_messageInfo_PositionWithdraw proto.InternalMessageInfo + +func (m *PositionWithdraw) GetPositionId() *PositionId { + if m != nil { + return m.PositionId + } + return nil +} + +func (m *PositionWithdraw) GetReservesCommitment() *v1alpha1.BalanceCommitment { + if m != nil { + return m.ReservesCommitment + } + return nil +} + +// A transaction action that claims retroactive rewards for a historical +// position. +// +// This action's contribution to the transaction's value balance is to consume a +// withdrawn position NFT and contribute its reward balance. +type PositionRewardClaim struct { + PositionId *PositionId `protobuf:"bytes,1,opt,name=position_id,json=positionId,proto3" json:"position_id,omitempty"` + // A transparent (zero blinding factor) commitment to the position's accumulated rewards. + // + // The chain will check this commitment by recomputing it with the on-chain state. + RewardsCommitment *v1alpha1.BalanceCommitment `protobuf:"bytes,2,opt,name=rewards_commitment,json=rewardsCommitment,proto3" json:"rewards_commitment,omitempty"` +} + +func (m *PositionRewardClaim) Reset() { *m = PositionRewardClaim{} } +func (m *PositionRewardClaim) String() string { return proto.CompactTextString(m) } +func (*PositionRewardClaim) ProtoMessage() {} +func (*PositionRewardClaim) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{24} +} +func (m *PositionRewardClaim) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PositionRewardClaim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PositionRewardClaim.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 *PositionRewardClaim) XXX_Merge(src proto.Message) { + xxx_messageInfo_PositionRewardClaim.Merge(m, src) +} +func (m *PositionRewardClaim) XXX_Size() int { + return m.Size() +} +func (m *PositionRewardClaim) XXX_DiscardUnknown() { + xxx_messageInfo_PositionRewardClaim.DiscardUnknown(m) +} + +var xxx_messageInfo_PositionRewardClaim proto.InternalMessageInfo + +func (m *PositionRewardClaim) GetPositionId() *PositionId { + if m != nil { + return m.PositionId + } + return nil +} + +func (m *PositionRewardClaim) GetRewardsCommitment() *v1alpha1.BalanceCommitment { + if m != nil { + return m.RewardsCommitment + } + return nil +} + +// Contains a path for a trade, including the trading pair (with direction), the trading +// function defining their relationship, and the route taken between the two assets. +type Path struct { + Pair *DirectedTradingPair `protobuf:"bytes,1,opt,name=pair,proto3" json:"pair,omitempty"` + Route []*v1alpha1.AssetId `protobuf:"bytes,2,rep,name=route,proto3" json:"route,omitempty"` + Phi *BareTradingFunction `protobuf:"bytes,3,opt,name=phi,proto3" json:"phi,omitempty"` +} + +func (m *Path) Reset() { *m = Path{} } +func (m *Path) String() string { return proto.CompactTextString(m) } +func (*Path) ProtoMessage() {} +func (*Path) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{25} +} +func (m *Path) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Path) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Path.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 *Path) XXX_Merge(src proto.Message) { + xxx_messageInfo_Path.Merge(m, src) +} +func (m *Path) XXX_Size() int { + return m.Size() +} +func (m *Path) XXX_DiscardUnknown() { + xxx_messageInfo_Path.DiscardUnknown(m) +} + +var xxx_messageInfo_Path proto.InternalMessageInfo + +func (m *Path) GetPair() *DirectedTradingPair { + if m != nil { + return m.Pair + } + return nil +} + +func (m *Path) GetRoute() []*v1alpha1.AssetId { + if m != nil { + return m.Route + } + return nil +} + +func (m *Path) GetPhi() *BareTradingFunction { + if m != nil { + return m.Phi + } + return nil +} + +// Contains the entire execution of a particular swap. +type SwapExecution struct { + Traces []*SwapExecution_Trace `protobuf:"bytes,1,rep,name=traces,proto3" json:"traces,omitempty"` +} + +func (m *SwapExecution) Reset() { *m = SwapExecution{} } +func (m *SwapExecution) String() string { return proto.CompactTextString(m) } +func (*SwapExecution) ProtoMessage() {} +func (*SwapExecution) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{26} +} +func (m *SwapExecution) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SwapExecution) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SwapExecution.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 *SwapExecution) XXX_Merge(src proto.Message) { + xxx_messageInfo_SwapExecution.Merge(m, src) +} +func (m *SwapExecution) XXX_Size() int { + return m.Size() +} +func (m *SwapExecution) XXX_DiscardUnknown() { + xxx_messageInfo_SwapExecution.DiscardUnknown(m) +} + +var xxx_messageInfo_SwapExecution proto.InternalMessageInfo + +func (m *SwapExecution) GetTraces() []*SwapExecution_Trace { + if m != nil { + return m.Traces + } + return nil +} + +// Contains all individual steps consisting of a trade trace. +type SwapExecution_Trace struct { + // Each step in the trade trace. + Value []*v1alpha1.Value `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"` +} + +func (m *SwapExecution_Trace) Reset() { *m = SwapExecution_Trace{} } +func (m *SwapExecution_Trace) String() string { return proto.CompactTextString(m) } +func (*SwapExecution_Trace) ProtoMessage() {} +func (*SwapExecution_Trace) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{26, 0} +} +func (m *SwapExecution_Trace) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SwapExecution_Trace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SwapExecution_Trace.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 *SwapExecution_Trace) XXX_Merge(src proto.Message) { + xxx_messageInfo_SwapExecution_Trace.Merge(m, src) +} +func (m *SwapExecution_Trace) XXX_Size() int { + return m.Size() +} +func (m *SwapExecution_Trace) XXX_DiscardUnknown() { + xxx_messageInfo_SwapExecution_Trace.DiscardUnknown(m) +} + +var xxx_messageInfo_SwapExecution_Trace proto.InternalMessageInfo + +func (m *SwapExecution_Trace) GetValue() []*v1alpha1.Value { + if m != nil { + return m.Value + } + return nil +} + +// Contains private and public data for withdrawing funds from a closed position. +type PositionWithdrawPlan struct { + Reserves *Reserves `protobuf:"bytes,1,opt,name=reserves,proto3" json:"reserves,omitempty"` + PositionId *PositionId `protobuf:"bytes,2,opt,name=position_id,json=positionId,proto3" json:"position_id,omitempty"` + Pair *TradingPair `protobuf:"bytes,3,opt,name=pair,proto3" json:"pair,omitempty"` +} + +func (m *PositionWithdrawPlan) Reset() { *m = PositionWithdrawPlan{} } +func (m *PositionWithdrawPlan) String() string { return proto.CompactTextString(m) } +func (*PositionWithdrawPlan) ProtoMessage() {} +func (*PositionWithdrawPlan) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{27} +} +func (m *PositionWithdrawPlan) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PositionWithdrawPlan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PositionWithdrawPlan.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 *PositionWithdrawPlan) XXX_Merge(src proto.Message) { + xxx_messageInfo_PositionWithdrawPlan.Merge(m, src) +} +func (m *PositionWithdrawPlan) XXX_Size() int { + return m.Size() +} +func (m *PositionWithdrawPlan) XXX_DiscardUnknown() { + xxx_messageInfo_PositionWithdrawPlan.DiscardUnknown(m) +} + +var xxx_messageInfo_PositionWithdrawPlan proto.InternalMessageInfo + +func (m *PositionWithdrawPlan) GetReserves() *Reserves { + if m != nil { + return m.Reserves + } + return nil +} + +func (m *PositionWithdrawPlan) GetPositionId() *PositionId { + if m != nil { + return m.PositionId + } + return nil +} + +func (m *PositionWithdrawPlan) GetPair() *TradingPair { + if m != nil { + return m.Pair + } + return nil +} + +// Contains private and public data for claiming rewards from a position. +type PositionRewardClaimPlan struct { + Reserves *Reserves `protobuf:"bytes,1,opt,name=reserves,proto3" json:"reserves,omitempty"` +} + +func (m *PositionRewardClaimPlan) Reset() { *m = PositionRewardClaimPlan{} } +func (m *PositionRewardClaimPlan) String() string { return proto.CompactTextString(m) } +func (*PositionRewardClaimPlan) ProtoMessage() {} +func (*PositionRewardClaimPlan) Descriptor() ([]byte, []int) { + return fileDescriptor_d1eba752ca2f0d70, []int{28} +} +func (m *PositionRewardClaimPlan) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PositionRewardClaimPlan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PositionRewardClaimPlan.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 *PositionRewardClaimPlan) XXX_Merge(src proto.Message) { + xxx_messageInfo_PositionRewardClaimPlan.Merge(m, src) +} +func (m *PositionRewardClaimPlan) XXX_Size() int { + return m.Size() +} +func (m *PositionRewardClaimPlan) XXX_DiscardUnknown() { + xxx_messageInfo_PositionRewardClaimPlan.DiscardUnknown(m) +} + +var xxx_messageInfo_PositionRewardClaimPlan proto.InternalMessageInfo + +func (m *PositionRewardClaimPlan) GetReserves() *Reserves { + if m != nil { + return m.Reserves + } + return nil +} + +func init() { + proto.RegisterEnum("penumbra.core.dex.v1alpha1.PositionState_PositionStateEnum", PositionState_PositionStateEnum_name, PositionState_PositionStateEnum_value) + proto.RegisterType((*Swap)(nil), "penumbra.core.dex.v1alpha1.Swap") + proto.RegisterType((*SwapClaim)(nil), "penumbra.core.dex.v1alpha1.SwapClaim") + proto.RegisterType((*SwapClaimBody)(nil), "penumbra.core.dex.v1alpha1.SwapClaimBody") + proto.RegisterType((*SwapBody)(nil), "penumbra.core.dex.v1alpha1.SwapBody") + proto.RegisterType((*SwapPayload)(nil), "penumbra.core.dex.v1alpha1.SwapPayload") + proto.RegisterType((*SwapPlaintext)(nil), "penumbra.core.dex.v1alpha1.SwapPlaintext") + proto.RegisterType((*MockFlowCiphertext)(nil), "penumbra.core.dex.v1alpha1.MockFlowCiphertext") + proto.RegisterType((*SwapPlan)(nil), "penumbra.core.dex.v1alpha1.SwapPlan") + proto.RegisterType((*SwapClaimPlan)(nil), "penumbra.core.dex.v1alpha1.SwapClaimPlan") + proto.RegisterType((*SwapView)(nil), "penumbra.core.dex.v1alpha1.SwapView") + proto.RegisterType((*SwapView_Visible)(nil), "penumbra.core.dex.v1alpha1.SwapView.Visible") + proto.RegisterType((*SwapView_Opaque)(nil), "penumbra.core.dex.v1alpha1.SwapView.Opaque") + proto.RegisterType((*SwapClaimView)(nil), "penumbra.core.dex.v1alpha1.SwapClaimView") + proto.RegisterType((*SwapClaimView_Visible)(nil), "penumbra.core.dex.v1alpha1.SwapClaimView.Visible") + proto.RegisterType((*SwapClaimView_Opaque)(nil), "penumbra.core.dex.v1alpha1.SwapClaimView.Opaque") + proto.RegisterType((*TradingPair)(nil), "penumbra.core.dex.v1alpha1.TradingPair") + proto.RegisterType((*DirectedTradingPair)(nil), "penumbra.core.dex.v1alpha1.DirectedTradingPair") + proto.RegisterType((*BatchSwapOutputData)(nil), "penumbra.core.dex.v1alpha1.BatchSwapOutputData") + proto.RegisterType((*TradingFunction)(nil), "penumbra.core.dex.v1alpha1.TradingFunction") + proto.RegisterType((*BareTradingFunction)(nil), "penumbra.core.dex.v1alpha1.BareTradingFunction") + proto.RegisterType((*Reserves)(nil), "penumbra.core.dex.v1alpha1.Reserves") + proto.RegisterType((*Position)(nil), "penumbra.core.dex.v1alpha1.Position") + proto.RegisterType((*PositionId)(nil), "penumbra.core.dex.v1alpha1.PositionId") + proto.RegisterType((*PositionState)(nil), "penumbra.core.dex.v1alpha1.PositionState") + proto.RegisterType((*LpNft)(nil), "penumbra.core.dex.v1alpha1.LpNft") + proto.RegisterType((*PositionOpen)(nil), "penumbra.core.dex.v1alpha1.PositionOpen") + proto.RegisterType((*PositionClose)(nil), "penumbra.core.dex.v1alpha1.PositionClose") + proto.RegisterType((*PositionWithdraw)(nil), "penumbra.core.dex.v1alpha1.PositionWithdraw") + proto.RegisterType((*PositionRewardClaim)(nil), "penumbra.core.dex.v1alpha1.PositionRewardClaim") + proto.RegisterType((*Path)(nil), "penumbra.core.dex.v1alpha1.Path") + proto.RegisterType((*SwapExecution)(nil), "penumbra.core.dex.v1alpha1.SwapExecution") + proto.RegisterType((*SwapExecution_Trace)(nil), "penumbra.core.dex.v1alpha1.SwapExecution.Trace") + proto.RegisterType((*PositionWithdrawPlan)(nil), "penumbra.core.dex.v1alpha1.PositionWithdrawPlan") + proto.RegisterType((*PositionRewardClaimPlan)(nil), "penumbra.core.dex.v1alpha1.PositionRewardClaimPlan") +} + +func init() { + proto.RegisterFile("penumbra/core/dex/v1alpha1/dex.proto", fileDescriptor_d1eba752ca2f0d70) +} + +var fileDescriptor_d1eba752ca2f0d70 = []byte{ + // 1781 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0x4f, 0x6f, 0xe3, 0xc6, + 0x15, 0x37, 0x29, 0xd9, 0x96, 0x9f, 0xe4, 0x8d, 0x77, 0x1c, 0xb4, 0x86, 0x8a, 0x38, 0xbb, 0x6c, + 0xfe, 0x6c, 0x93, 0x42, 0x8a, 0x98, 0x14, 0x08, 0xbc, 0x4d, 0x36, 0xd6, 0x1f, 0xaf, 0x95, 0xc4, + 0x32, 0x43, 0x3b, 0xbb, 0x45, 0xba, 0x28, 0x31, 0x26, 0xc7, 0x2b, 0xa2, 0x14, 0xc9, 0x25, 0x47, + 0xb6, 0x7c, 0x2a, 0x50, 0xb4, 0xe8, 0xa9, 0x68, 0xf3, 0x01, 0x8a, 0x22, 0x3d, 0x16, 0xfd, 0x08, + 0x45, 0x7b, 0x2d, 0x8a, 0x1e, 0x72, 0x6b, 0x4f, 0x45, 0xe1, 0x3d, 0x14, 0xe8, 0x07, 0x28, 0x7a, + 0xe8, 0xa1, 0x98, 0xe1, 0x8c, 0x48, 0xdb, 0xf2, 0x4a, 0xf4, 0xba, 0x97, 0xdc, 0x34, 0x33, 0xef, + 0xf7, 0xe3, 0x7b, 0xf3, 0xfe, 0x92, 0x82, 0x57, 0x42, 0xe2, 0x0f, 0x07, 0x07, 0x11, 0xae, 0xdb, + 0x41, 0x44, 0xea, 0x0e, 0x19, 0xd5, 0x8f, 0x1a, 0xd8, 0x0b, 0xfb, 0xb8, 0xc1, 0x16, 0xb5, 0x30, + 0x0a, 0x68, 0x80, 0xaa, 0x52, 0xaa, 0xc6, 0xa4, 0x6a, 0xec, 0x40, 0x4a, 0x55, 0xdf, 0x38, 0xcb, + 0x60, 0x47, 0x27, 0x21, 0x0d, 0x52, 0x92, 0x64, 0x9d, 0xf0, 0x68, 0x3f, 0x56, 0xa0, 0xb8, 0x77, + 0x8c, 0x43, 0xf4, 0x01, 0xcc, 0x87, 0x51, 0x10, 0x1c, 0xae, 0x29, 0xb7, 0x94, 0x3b, 0x65, 0xfd, + 0x8d, 0xda, 0xd9, 0x07, 0x08, 0x90, 0x24, 0xa9, 0x7d, 0xf6, 0x11, 0x43, 0x19, 0x0c, 0x61, 0x26, + 0x40, 0xf4, 0x2e, 0x14, 0x0f, 0x02, 0xe7, 0x64, 0xad, 0xc8, 0x09, 0x5e, 0xa9, 0x5d, 0xae, 0x61, + 0x8d, 0x61, 0x9b, 0x81, 0x73, 0x62, 0x72, 0x84, 0xf6, 0x33, 0x05, 0x96, 0xd8, 0x56, 0xcb, 0xc3, + 0xee, 0x00, 0xbd, 0x98, 0xd5, 0xa4, 0x22, 0xd9, 0xdf, 0x13, 0xec, 0x2a, 0x67, 0xff, 0xd6, 0x34, + 0x76, 0x4e, 0x95, 0x3e, 0x02, 0xbd, 0x0a, 0x37, 0x48, 0x18, 0xd8, 0x7d, 0xcb, 0x19, 0x46, 0x98, + 0xba, 0x81, 0xbf, 0xb6, 0x78, 0x4b, 0xb9, 0x53, 0x34, 0x97, 0xf9, 0x6e, 0x5b, 0x6c, 0x6a, 0xbf, + 0x2e, 0xc0, 0xf2, 0x19, 0x38, 0xda, 0x82, 0x25, 0x7f, 0xe8, 0x79, 0xee, 0xa1, 0x4b, 0x22, 0x71, + 0x37, 0x77, 0xa6, 0xdc, 0x4d, 0x4f, 0xca, 0x9b, 0x29, 0x14, 0xbd, 0x03, 0x85, 0x43, 0x42, 0x84, + 0xfa, 0xda, 0x14, 0x86, 0x2d, 0x42, 0x4c, 0x26, 0x8e, 0x7e, 0x00, 0xab, 0xc1, 0x90, 0x86, 0x43, + 0x6a, 0x35, 0x2c, 0x3b, 0x18, 0x0c, 0x5c, 0x3a, 0x20, 0x3e, 0x5d, 0x2b, 0x70, 0x96, 0xda, 0x14, + 0x96, 0x3d, 0x8a, 0x29, 0x69, 0x8d, 0x51, 0xe6, 0xcd, 0x84, 0xaa, 0x91, 0x6e, 0x65, 0xf8, 0xf5, + 0x2c, 0x7f, 0xf1, 0x79, 0xf8, 0xf5, 0x0c, 0xbf, 0x01, 0x65, 0xc1, 0xef, 0x60, 0x8a, 0xd7, 0x16, + 0x38, 0x6f, 0xfd, 0x59, 0xce, 0x6b, 0x62, 0x6a, 0xf7, 0x99, 0x0b, 0x76, 0x39, 0xae, 0x8d, 0x29, + 0x36, 0x21, 0x18, 0xff, 0xd6, 0xfe, 0xa3, 0x42, 0x49, 0x86, 0x0f, 0xfa, 0x10, 0x2a, 0x34, 0xc2, + 0x8e, 0xeb, 0x3f, 0xb6, 0x42, 0xec, 0x4a, 0xff, 0xbc, 0xfe, 0x2c, 0xfe, 0xfd, 0x44, 0xde, 0xc0, + 0x6e, 0x64, 0x96, 0x69, 0xba, 0x40, 0x9b, 0xb0, 0xe4, 0x10, 0x8f, 0x62, 0xab, 0x61, 0xb9, 0xc2, + 0x4d, 0xaf, 0x4e, 0xb9, 0x80, 0xcd, 0x41, 0x30, 0xf4, 0xa9, 0xb9, 0xc8, 0x71, 0x8d, 0x6e, 0x4a, + 0xa1, 0x5b, 0xae, 0xf0, 0x51, 0x2e, 0x0a, 0xbd, 0x8b, 0x1e, 0xc2, 0x8d, 0x43, 0x42, 0x2e, 0xfa, + 0xe2, 0xad, 0x29, 0x3c, 0x4d, 0xec, 0x61, 0xdf, 0xce, 0x7a, 0x63, 0xf9, 0x90, 0x64, 0x96, 0x68, + 0x13, 0x16, 0x43, 0x7c, 0xe2, 0x05, 0xd8, 0x59, 0x9b, 0x9f, 0x7e, 0x4b, 0x3c, 0xb9, 0x13, 0x71, + 0x53, 0xe2, 0xb4, 0x9f, 0x28, 0x50, 0xce, 0x1c, 0xa0, 0x1e, 0x40, 0x46, 0x4f, 0xe5, 0x4a, 0x31, + 0x93, 0x61, 0xe0, 0x39, 0xea, 0x73, 0x00, 0x71, 0xac, 0xf8, 0x18, 0x87, 0xdc, 0x0d, 0x15, 0x73, + 0x79, 0xbc, 0xcb, 0x9e, 0xae, 0xfd, 0x54, 0xe4, 0xa8, 0xe1, 0x61, 0xd7, 0xa7, 0x64, 0x44, 0xbf, + 0x82, 0x61, 0x70, 0x0f, 0x96, 0x6c, 0x56, 0x82, 0x2c, 0x56, 0x33, 0x8a, 0x33, 0xd7, 0x8c, 0x12, + 0x07, 0x6d, 0x11, 0x82, 0x3e, 0x82, 0xe5, 0x84, 0x00, 0x3b, 0x4e, 0x44, 0xe2, 0x58, 0x38, 0xfd, + 0xb5, 0x69, 0x7a, 0x24, 0xd2, 0x66, 0x85, 0x83, 0xc5, 0x8a, 0x55, 0xe4, 0x28, 0x26, 0xc4, 0xe1, + 0xf9, 0x5b, 0x31, 0x93, 0x85, 0xf6, 0x09, 0xa0, 0x9d, 0xc0, 0xfe, 0xe1, 0x96, 0x17, 0x1c, 0xb7, + 0xdc, 0xb0, 0x4f, 0x22, 0xee, 0x8b, 0xbb, 0x30, 0x7f, 0x84, 0xbd, 0x21, 0x11, 0x4e, 0x98, 0xd1, + 0xf0, 0x04, 0xa3, 0xfd, 0x28, 0xc9, 0x6d, 0xc3, 0xc3, 0x3e, 0x32, 0xe0, 0x06, 0x8b, 0x01, 0x2b, + 0x94, 0x6e, 0x16, 0x8c, 0x53, 0x4b, 0xff, 0x38, 0x2e, 0xcc, 0xe5, 0xf8, 0x4c, 0x98, 0xdc, 0x86, + 0x0a, 0xcb, 0xad, 0x03, 0xcf, 0xf5, 0x99, 0xbb, 0x45, 0x74, 0x95, 0x0f, 0x09, 0x69, 0x8a, 0x2d, + 0xed, 0xdf, 0x4a, 0xa6, 0xfe, 0xff, 0x9f, 0xd4, 0xa8, 0x42, 0x29, 0x0c, 0x62, 0x97, 0x37, 0x21, + 0x95, 0x37, 0xa1, 0xf1, 0xfa, 0x7c, 0xbd, 0x2c, 0x3c, 0x77, 0xbd, 0x9c, 0xd0, 0xf8, 0x8a, 0x93, + 0x1a, 0xdf, 0x7f, 0x45, 0x59, 0x7d, 0xe0, 0x92, 0x63, 0xb4, 0x0d, 0x8b, 0x47, 0x6e, 0xec, 0x1e, + 0x78, 0xd2, 0x8b, 0xdf, 0x9e, 0x66, 0x2c, 0x83, 0xd5, 0x1e, 0x24, 0x98, 0xed, 0x39, 0x53, 0xc2, + 0x51, 0x07, 0x16, 0x82, 0x10, 0x3f, 0x19, 0xca, 0xc6, 0xf7, 0xe6, 0x4c, 0x44, 0xbb, 0x1c, 0xb2, + 0x3d, 0x67, 0x0a, 0x70, 0xf5, 0x73, 0x05, 0x16, 0x05, 0x3b, 0x7a, 0x07, 0x8a, 0xbc, 0x36, 0x24, + 0x9a, 0xdd, 0x9a, 0x46, 0x68, 0x72, 0xe9, 0x09, 0x6e, 0x2c, 0x3c, 0x9f, 0x1b, 0xab, 0xef, 0xc3, + 0x42, 0xa2, 0xe7, 0xd5, 0x34, 0x6a, 0x96, 0x61, 0x89, 0x6b, 0x74, 0xe4, 0x92, 0x63, 0xed, 0x9f, + 0xd9, 0xb9, 0x83, 0xfb, 0x60, 0xe7, 0xbc, 0x0f, 0x1a, 0x33, 0x8d, 0x3c, 0x97, 0x39, 0xe2, 0xc3, + 0x73, 0x8e, 0x78, 0x6b, 0x76, 0xb6, 0x0b, 0xde, 0xf8, 0x6b, 0xc6, 0x1b, 0x6d, 0x00, 0x6e, 0x05, + 0xaf, 0x17, 0x97, 0xe4, 0xfc, 0x64, 0x6e, 0x93, 0x9b, 0x9f, 0x8c, 0x7c, 0x4d, 0x28, 0xc9, 0x31, + 0x47, 0xe8, 0xf7, 0xfa, 0xb4, 0x19, 0x2b, 0xa0, 0x84, 0x69, 0x67, 0x2e, 0x8a, 0xa1, 0x26, 0xc3, + 0xa1, 0x0b, 0xdf, 0xe6, 0xe5, 0xd0, 0xab, 0xbd, 0xb1, 0x4f, 0xaf, 0xc5, 0xae, 0xe6, 0x4d, 0x78, + 0x21, 0x65, 0x49, 0x3c, 0xfd, 0x0b, 0x05, 0xca, 0x99, 0xe6, 0x83, 0xee, 0xc1, 0x22, 0x8e, 0x63, + 0xc2, 0x2c, 0x57, 0x66, 0x2b, 0xd1, 0x4c, 0xba, 0xeb, 0x98, 0x0b, 0x1c, 0xd6, 0x48, 0x09, 0x74, + 0x71, 0x75, 0xf9, 0x08, 0x74, 0xed, 0xe7, 0x0a, 0xac, 0xb6, 0xdd, 0x88, 0xd8, 0x94, 0x38, 0x59, + 0xcd, 0xbe, 0x0b, 0xf3, 0x31, 0xc5, 0x11, 0xcd, 0xa9, 0x57, 0x02, 0x42, 0xef, 0x42, 0x81, 0xf8, + 0x4e, 0x4e, 0x95, 0x18, 0x44, 0xfb, 0x5d, 0x11, 0x56, 0x27, 0x54, 0x35, 0xf4, 0x3e, 0x2c, 0x8a, + 0xce, 0x9c, 0xaf, 0xb7, 0x2c, 0x24, 0x7d, 0x39, 0xc5, 0xeb, 0xf9, 0xfa, 0x7a, 0x82, 0xd7, 0xd1, + 0x07, 0x50, 0xf2, 0xf0, 0xe0, 0xc0, 0x61, 0x0a, 0xe4, 0xeb, 0xea, 0x09, 0xac, 0x91, 0x61, 0xd0, + 0x45, 0x53, 0xcf, 0xc7, 0xa0, 0xb3, 0xb0, 0x1c, 0xfa, 0x87, 0xae, 0xe7, 0x11, 0xc7, 0x6a, 0x88, + 0x9e, 0x3e, 0x23, 0xc7, 0x92, 0x04, 0x36, 0xce, 0xb0, 0xe8, 0x62, 0x28, 0xcf, 0xcb, 0xa2, 0xa3, + 0xaf, 0xc1, 0x42, 0x9f, 0xb8, 0x8f, 0xfb, 0x54, 0xbc, 0x4a, 0x89, 0xd5, 0x85, 0x69, 0xac, 0xf4, + 0x1c, 0xd3, 0xd8, 0x6d, 0xa8, 0x24, 0xdd, 0x4b, 0x3c, 0x69, 0x89, 0x3f, 0xa9, 0xcc, 0xf7, 0xb6, + 0xf9, 0x96, 0xf6, 0x2b, 0x05, 0x5e, 0x10, 0xf8, 0xad, 0xa1, 0x6f, 0xf3, 0x36, 0xba, 0x03, 0x4b, + 0x76, 0x30, 0x08, 0x03, 0x3f, 0x1d, 0x4c, 0xa7, 0x34, 0xd1, 0x88, 0x9c, 0xe3, 0x30, 0x53, 0x06, + 0x74, 0x17, 0x8a, 0xdc, 0x12, 0x35, 0x9f, 0x25, 0x1c, 0xa4, 0x7d, 0xae, 0xb0, 0x70, 0xbe, 0xc0, + 0x8f, 0x56, 0x92, 0x17, 0x42, 0xa6, 0xdd, 0x72, 0xf2, 0xb2, 0xf7, 0x36, 0x28, 0x61, 0xbe, 0xd0, + 0x54, 0x42, 0x06, 0x7a, 0x92, 0x2f, 0x1c, 0x95, 0x27, 0xda, 0x08, 0x4a, 0x26, 0x89, 0x49, 0x74, + 0x44, 0x62, 0xf4, 0x1d, 0x50, 0xa3, 0x9c, 0x19, 0xa5, 0x46, 0x0d, 0x0e, 0xcb, 0x99, 0x48, 0x6a, + 0xa4, 0x6b, 0xa7, 0x0a, 0x94, 0x0c, 0x39, 0xed, 0xbc, 0x07, 0x85, 0xb0, 0xef, 0x8a, 0x67, 0xbf, + 0x39, 0xc3, 0xb5, 0x8e, 0x9d, 0xc3, 0x70, 0x6c, 0x2c, 0xf5, 0x03, 0xdf, 0x26, 0x62, 0x90, 0x4b, + 0x16, 0xe8, 0x1e, 0x2f, 0x5b, 0x94, 0xcc, 0xd2, 0xe0, 0xa5, 0x26, 0xfc, 0xad, 0xc4, 0x4c, 0x70, + 0x2c, 0x4b, 0x23, 0x71, 0x39, 0xb3, 0x7c, 0xcb, 0x90, 0x17, 0x69, 0x8e, 0x51, 0x9a, 0x06, 0x20, + 0x99, 0xbb, 0x0e, 0x53, 0xd3, 0xf5, 0x7d, 0xf1, 0xf5, 0xa0, 0x62, 0x26, 0x0b, 0xed, 0x0b, 0x15, + 0x96, 0xcf, 0x3c, 0x1e, 0x7d, 0x22, 0x15, 0x67, 0x72, 0x37, 0xf4, 0xbb, 0x33, 0x2b, 0x7e, 0x76, + 0xd5, 0xf1, 0x87, 0x03, 0x61, 0x8a, 0xf6, 0x7b, 0x05, 0x6e, 0x5e, 0x38, 0x44, 0xdf, 0x84, 0x97, + 0x8d, 0xdd, 0xbd, 0xee, 0x7e, 0x77, 0xb7, 0x67, 0xed, 0xed, 0x6f, 0xee, 0x77, 0xac, 0x4e, 0xef, + 0xd3, 0x1d, 0xeb, 0xd3, 0xde, 0x9e, 0xd1, 0x69, 0x75, 0xb7, 0xba, 0x9d, 0xf6, 0xca, 0x1c, 0x5a, + 0x87, 0xea, 0x24, 0xa1, 0x5d, 0xa3, 0xd3, 0xeb, 0xb4, 0x57, 0x94, 0xcb, 0xce, 0x5b, 0x1f, 0xef, + 0xee, 0x75, 0xda, 0x2b, 0x2a, 0xba, 0x0d, 0x2f, 0x4d, 0x3a, 0x7f, 0xd8, 0xdd, 0xdf, 0x6e, 0x9b, + 0x9b, 0x0f, 0x7b, 0x2b, 0x05, 0xf4, 0x32, 0x7c, 0x63, 0x32, 0xc5, 0x66, 0x77, 0xa7, 0xd3, 0x5e, + 0x29, 0xb2, 0xd4, 0x99, 0xff, 0x38, 0xec, 0x1d, 0x52, 0x74, 0x1f, 0xca, 0x72, 0x46, 0xb6, 0x5c, + 0xe7, 0x92, 0x8e, 0x34, 0xf1, 0x86, 0xba, 0x8e, 0x09, 0x61, 0xea, 0x8c, 0x71, 0x74, 0xa8, 0x57, + 0x8b, 0x0e, 0xcd, 0x80, 0x8a, 0xdc, 0xdf, 0x0d, 0x89, 0xcf, 0xa2, 0x65, 0x3c, 0xcd, 0x2b, 0xd3, + 0xa3, 0x45, 0x62, 0xd3, 0x99, 0x5f, 0xfb, 0x5e, 0x1a, 0x08, 0x2d, 0x2f, 0x88, 0xc9, 0xb5, 0x19, + 0xab, 0xfd, 0x41, 0x81, 0x15, 0x79, 0xf4, 0xd0, 0xa5, 0x7d, 0x27, 0xc2, 0xc7, 0xd7, 0x77, 0x95, + 0x18, 0x56, 0x65, 0xc4, 0x67, 0xbf, 0x57, 0xa8, 0x57, 0xfc, 0x5e, 0x81, 0x24, 0x59, 0xba, 0xa7, + 0xfd, 0x51, 0x81, 0xd5, 0xf1, 0x8d, 0x91, 0x63, 0x1c, 0x39, 0xc9, 0xbc, 0x78, 0x6d, 0x36, 0x58, + 0x80, 0x22, 0xce, 0x7b, 0x2d, 0x26, 0xdc, 0x14, 0x5c, 0x19, 0x0b, 0xfe, 0xa2, 0x40, 0xd1, 0xc0, + 0xb4, 0x8f, 0x5a, 0xa2, 0x87, 0xcc, 0xd0, 0x8d, 0x26, 0x0c, 0x63, 0x49, 0x2f, 0x61, 0x23, 0x59, + 0x14, 0x0c, 0x79, 0xf4, 0x16, 0xf2, 0x8c, 0x64, 0x1c, 0x84, 0x36, 0x93, 0x72, 0x5b, 0xb8, 0x5a, + 0x3f, 0x64, 0x58, 0xd6, 0x6c, 0xf9, 0x7b, 0x4a, 0x67, 0x44, 0xec, 0x21, 0xaf, 0xe1, 0xf7, 0x61, + 0x81, 0x46, 0xd8, 0x26, 0xf1, 0x9a, 0xc2, 0x75, 0xaa, 0x4f, 0x1b, 0x92, 0xc7, 0x50, 0x56, 0xd4, + 0x6d, 0x62, 0x0a, 0x78, 0xb5, 0x05, 0xf3, 0x7c, 0x03, 0x6d, 0xa4, 0x5f, 0x10, 0x0a, 0x13, 0xd2, + 0xe9, 0xbc, 0x91, 0x0f, 0x98, 0xac, 0xfc, 0x80, 0xf0, 0x77, 0x05, 0x5e, 0x3c, 0x1f, 0xf1, 0xfc, + 0x35, 0x3e, 0x5b, 0xd4, 0x95, 0xab, 0x14, 0xf5, 0xf3, 0x31, 0xa7, 0x5e, 0x39, 0xe6, 0xe4, 0x34, + 0x51, 0xb8, 0xca, 0x34, 0xf1, 0x7d, 0xf8, 0xfa, 0x84, 0x84, 0xb8, 0x1e, 0x13, 0x9b, 0x5f, 0xa8, + 0x7f, 0x3a, 0x5d, 0x57, 0xbe, 0x3c, 0x5d, 0x57, 0xfe, 0x71, 0xba, 0xae, 0xfc, 0xf2, 0xe9, 0xfa, + 0xdc, 0x97, 0x4f, 0xd7, 0xe7, 0xfe, 0xf6, 0x74, 0x7d, 0x0e, 0xd6, 0xed, 0x60, 0xf0, 0x0c, 0xb6, + 0x66, 0xa9, 0x4d, 0x46, 0x46, 0x14, 0xd0, 0xc0, 0x50, 0x3e, 0x33, 0x1f, 0xbb, 0xb4, 0x3f, 0x3c, + 0xa8, 0xd9, 0xc1, 0xa0, 0x6e, 0x07, 0xf1, 0x20, 0x88, 0xeb, 0x11, 0xf1, 0xf0, 0x09, 0x89, 0xea, + 0x47, 0xfa, 0xf8, 0xa7, 0xdd, 0xc7, 0xae, 0x1f, 0xd7, 0x2f, 0xff, 0xb7, 0xe3, 0xae, 0x43, 0x46, + 0xf2, 0xf7, 0x6f, 0xd4, 0x82, 0xd1, 0x6a, 0xff, 0x56, 0xad, 0x1a, 0x52, 0x85, 0x16, 0x53, 0xa1, + 0x4d, 0x46, 0xb5, 0x07, 0x42, 0xe4, 0xcf, 0xe9, 0xe1, 0x23, 0x76, 0xf8, 0xa8, 0x4d, 0x46, 0x8f, + 0xe4, 0xe1, 0xa9, 0xfa, 0xda, 0xe5, 0x87, 0x8f, 0xee, 0x1b, 0xcd, 0x1d, 0x42, 0xb1, 0x83, 0x29, + 0xfe, 0x97, 0xfa, 0x92, 0x14, 0xdc, 0xd8, 0x60, 0x92, 0x1b, 0x1b, 0x6d, 0x32, 0xda, 0xd8, 0x90, + 0xb2, 0x07, 0x0b, 0xfc, 0x7f, 0x93, 0xb7, 0xff, 0x17, 0x00, 0x00, 0xff, 0xff, 0x95, 0x49, 0x5f, + 0xa1, 0xa7, 0x19, 0x00, 0x00, +} + +func (m *Swap) 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 *Swap) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Swap) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Body != nil { + { + size, err := m.Body.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Proof != nil { + { + size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SwapClaim) 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 *SwapClaim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SwapClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.EpochDuration != 0 { + i = encodeVarintDex(dAtA, i, uint64(m.EpochDuration)) + i-- + dAtA[i] = 0x38 + } + if m.Body != nil { + { + size, err := m.Body.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Proof) > 0 { + i -= len(m.Proof) + copy(dAtA[i:], m.Proof) + i = encodeVarintDex(dAtA, i, uint64(len(m.Proof))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SwapClaimBody) 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 *SwapClaimBody) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SwapClaimBody) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.OutputData != nil { + { + size, err := m.OutputData.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.Output_2Commitment != nil { + { + size, err := m.Output_2Commitment.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Output_1Commitment != nil { + { + size, err := m.Output_1Commitment.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Fee != nil { + { + size, err := m.Fee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Nullifier != nil { + { + size, err := m.Nullifier.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SwapBody) 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 *SwapBody) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SwapBody) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Payload != nil { + { + size, err := m.Payload.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.FeeCommitment != nil { + { + size, err := m.FeeCommitment.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Delta_2I != nil { + { + size, err := m.Delta_2I.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Delta_1I != nil { + { + size, err := m.Delta_1I.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.TradingPair != nil { + { + size, err := m.TradingPair.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SwapPayload) 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 *SwapPayload) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SwapPayload) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.EncryptedSwap) > 0 { + i -= len(m.EncryptedSwap) + copy(dAtA[i:], m.EncryptedSwap) + i = encodeVarintDex(dAtA, i, uint64(len(m.EncryptedSwap))) + i-- + dAtA[i] = 0x12 + } + if m.Commitment != nil { + { + size, err := m.Commitment.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SwapPlaintext) 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 *SwapPlaintext) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SwapPlaintext) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Rseed) > 0 { + i -= len(m.Rseed) + copy(dAtA[i:], m.Rseed) + i = encodeVarintDex(dAtA, i, uint64(len(m.Rseed))) + i-- + dAtA[i] = 0x32 + } + if m.ClaimAddress != nil { + { + size, err := m.ClaimAddress.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.ClaimFee != nil { + { + size, err := m.ClaimFee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Delta_2I != nil { + { + size, err := m.Delta_2I.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Delta_1I != nil { + { + size, err := m.Delta_1I.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.TradingPair != nil { + { + size, err := m.TradingPair.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MockFlowCiphertext) 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 *MockFlowCiphertext) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MockFlowCiphertext) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Value != nil { + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SwapPlan) 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 *SwapPlan) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SwapPlan) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.FeeBlinding) > 0 { + i -= len(m.FeeBlinding) + copy(dAtA[i:], m.FeeBlinding) + i = encodeVarintDex(dAtA, i, uint64(len(m.FeeBlinding))) + i-- + dAtA[i] = 0x12 + } + if m.SwapPlaintext != nil { + { + size, err := m.SwapPlaintext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SwapClaimPlan) 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 *SwapClaimPlan) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SwapClaimPlan) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.EpochDuration != 0 { + i = encodeVarintDex(dAtA, i, uint64(m.EpochDuration)) + i-- + dAtA[i] = 0x20 + } + if m.OutputData != nil { + { + size, err := m.OutputData.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Position != 0 { + i = encodeVarintDex(dAtA, i, uint64(m.Position)) + i-- + dAtA[i] = 0x10 + } + if m.SwapPlaintext != nil { + { + size, err := m.SwapPlaintext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SwapView) 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 *SwapView) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SwapView) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SwapView != nil { + { + size := m.SwapView.Size() + i -= size + if _, err := m.SwapView.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *SwapView_Visible_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SwapView_Visible_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Visible != nil { + { + size, err := m.Visible.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *SwapView_Opaque_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SwapView_Opaque_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Opaque != nil { + { + size, err := m.Opaque.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *SwapView_Visible) 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 *SwapView_Visible) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SwapView_Visible) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SwapPlaintext != nil { + { + size, err := m.SwapPlaintext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Swap != nil { + { + size, err := m.Swap.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SwapView_Opaque) 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 *SwapView_Opaque) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SwapView_Opaque) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Swap != nil { + { + size, err := m.Swap.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SwapClaimView) 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 *SwapClaimView) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SwapClaimView) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SwapClaimView != nil { + { + size := m.SwapClaimView.Size() + i -= size + if _, err := m.SwapClaimView.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *SwapClaimView_Visible_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SwapClaimView_Visible_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Visible != nil { + { + size, err := m.Visible.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *SwapClaimView_Opaque_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SwapClaimView_Opaque_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Opaque != nil { + { + size, err := m.Opaque.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *SwapClaimView_Visible) 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 *SwapClaimView_Visible) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SwapClaimView_Visible) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Output_2 != nil { + { + size, err := m.Output_2.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Output_1 != nil { + { + size, err := m.Output_1.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.SwapClaim != nil { + { + size, err := m.SwapClaim.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SwapClaimView_Opaque) 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 *SwapClaimView_Opaque) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SwapClaimView_Opaque) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SwapClaim != nil { + { + size, err := m.SwapClaim.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TradingPair) 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 *TradingPair) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TradingPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Asset_2 != nil { + { + size, err := m.Asset_2.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Asset_1 != nil { + { + size, err := m.Asset_1.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DirectedTradingPair) 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 *DirectedTradingPair) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DirectedTradingPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.End != nil { + { + size, err := m.End.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Start != nil { + { + size, err := m.Start.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BatchSwapOutputData) 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 *BatchSwapOutputData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BatchSwapOutputData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.EpochHeight != 0 { + i = encodeVarintDex(dAtA, i, uint64(m.EpochHeight)) + i-- + dAtA[i] = 0x48 + } + if m.TradingPair != nil { + { + size, err := m.TradingPair.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.Height != 0 { + i = encodeVarintDex(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x38 + } + if m.Unfilled_2 != nil { + { + size, err := m.Unfilled_2.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.Unfilled_1 != nil { + { + size, err := m.Unfilled_1.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Lambda_2 != nil { + { + size, err := m.Lambda_2.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Lambda_1 != nil { + { + size, err := m.Lambda_1.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Delta_2 != nil { + { + size, err := m.Delta_2.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Delta_1 != nil { + { + size, err := m.Delta_1.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TradingFunction) 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 *TradingFunction) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TradingFunction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pair != nil { + { + size, err := m.Pair.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Component != nil { + { + size, err := m.Component.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BareTradingFunction) 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 *BareTradingFunction) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BareTradingFunction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Q != nil { + { + size, err := m.Q.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.P != nil { + { + size, err := m.P.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Fee != 0 { + i = encodeVarintDex(dAtA, i, uint64(m.Fee)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Reserves) 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 *Reserves) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Reserves) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.R2 != nil { + { + size, err := m.R2.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.R1 != nil { + { + size, err := m.R1.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Position) 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 *Position) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Position) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Reserves != nil { + { + size, err := m.Reserves.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.State != nil { + { + size, err := m.State.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Nonce) > 0 { + i -= len(m.Nonce) + copy(dAtA[i:], m.Nonce) + i = encodeVarintDex(dAtA, i, uint64(len(m.Nonce))) + i-- + dAtA[i] = 0x12 + } + if m.Phi != nil { + { + size, err := m.Phi.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PositionId) 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 *PositionId) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PositionId) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintDex(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PositionState) 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 *PositionState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PositionState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.State != 0 { + i = encodeVarintDex(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *LpNft) 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 *LpNft) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LpNft) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.State != nil { + { + size, err := m.State.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.PositionId != nil { + { + size, err := m.PositionId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PositionOpen) 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 *PositionOpen) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PositionOpen) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Position != nil { + { + size, err := m.Position.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PositionClose) 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 *PositionClose) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PositionClose) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PositionId != nil { + { + size, err := m.PositionId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PositionWithdraw) 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 *PositionWithdraw) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PositionWithdraw) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ReservesCommitment != nil { + { + size, err := m.ReservesCommitment.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.PositionId != nil { + { + size, err := m.PositionId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PositionRewardClaim) 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 *PositionRewardClaim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PositionRewardClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.RewardsCommitment != nil { + { + size, err := m.RewardsCommitment.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.PositionId != nil { + { + size, err := m.PositionId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Path) 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 *Path) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Path) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Phi != nil { + { + size, err := m.Phi.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Route) > 0 { + for iNdEx := len(m.Route) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Route[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Pair != nil { + { + size, err := m.Pair.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SwapExecution) 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 *SwapExecution) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SwapExecution) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Traces) > 0 { + for iNdEx := len(m.Traces) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Traces[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *SwapExecution_Trace) 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 *SwapExecution_Trace) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SwapExecution_Trace) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Value) > 0 { + for iNdEx := len(m.Value) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Value[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *PositionWithdrawPlan) 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 *PositionWithdrawPlan) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PositionWithdrawPlan) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pair != nil { + { + size, err := m.Pair.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.PositionId != nil { + { + size, err := m.PositionId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Reserves != nil { + { + size, err := m.Reserves.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PositionRewardClaimPlan) 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 *PositionRewardClaimPlan) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PositionRewardClaimPlan) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Reserves != nil { + { + size, err := m.Reserves.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDex(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintDex(dAtA []byte, offset int, v uint64) int { + offset -= sovDex(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Swap) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Proof != nil { + l = m.Proof.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.Body != nil { + l = m.Body.Size() + n += 1 + l + sovDex(uint64(l)) + } + return n +} + +func (m *SwapClaim) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Proof) + if l > 0 { + n += 1 + l + sovDex(uint64(l)) + } + if m.Body != nil { + l = m.Body.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.EpochDuration != 0 { + n += 1 + sovDex(uint64(m.EpochDuration)) + } + return n +} + +func (m *SwapClaimBody) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Nullifier != nil { + l = m.Nullifier.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.Fee != nil { + l = m.Fee.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.Output_1Commitment != nil { + l = m.Output_1Commitment.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.Output_2Commitment != nil { + l = m.Output_2Commitment.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.OutputData != nil { + l = m.OutputData.Size() + n += 1 + l + sovDex(uint64(l)) + } + return n +} + +func (m *SwapBody) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TradingPair != nil { + l = m.TradingPair.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.Delta_1I != nil { + l = m.Delta_1I.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.Delta_2I != nil { + l = m.Delta_2I.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.FeeCommitment != nil { + l = m.FeeCommitment.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.Payload != nil { + l = m.Payload.Size() + n += 1 + l + sovDex(uint64(l)) + } + return n +} + +func (m *SwapPayload) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Commitment != nil { + l = m.Commitment.Size() + n += 1 + l + sovDex(uint64(l)) + } + l = len(m.EncryptedSwap) + if l > 0 { + n += 1 + l + sovDex(uint64(l)) + } + return n +} + +func (m *SwapPlaintext) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TradingPair != nil { + l = m.TradingPair.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.Delta_1I != nil { + l = m.Delta_1I.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.Delta_2I != nil { + l = m.Delta_2I.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.ClaimFee != nil { + l = m.ClaimFee.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.ClaimAddress != nil { + l = m.ClaimAddress.Size() + n += 1 + l + sovDex(uint64(l)) + } + l = len(m.Rseed) + if l > 0 { + n += 1 + l + sovDex(uint64(l)) + } + return n +} + +func (m *MockFlowCiphertext) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != nil { + l = m.Value.Size() + n += 1 + l + sovDex(uint64(l)) + } + return n +} + +func (m *SwapPlan) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SwapPlaintext != nil { + l = m.SwapPlaintext.Size() + n += 1 + l + sovDex(uint64(l)) + } + l = len(m.FeeBlinding) + if l > 0 { + n += 1 + l + sovDex(uint64(l)) + } + return n +} + +func (m *SwapClaimPlan) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SwapPlaintext != nil { + l = m.SwapPlaintext.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.Position != 0 { + n += 1 + sovDex(uint64(m.Position)) + } + if m.OutputData != nil { + l = m.OutputData.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.EpochDuration != 0 { + n += 1 + sovDex(uint64(m.EpochDuration)) + } + return n +} + +func (m *SwapView) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SwapView != nil { + n += m.SwapView.Size() + } + return n +} + +func (m *SwapView_Visible_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Visible != nil { + l = m.Visible.Size() + n += 1 + l + sovDex(uint64(l)) + } + return n +} +func (m *SwapView_Opaque_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Opaque != nil { + l = m.Opaque.Size() + n += 1 + l + sovDex(uint64(l)) + } + return n +} +func (m *SwapView_Visible) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Swap != nil { + l = m.Swap.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.SwapPlaintext != nil { + l = m.SwapPlaintext.Size() + n += 1 + l + sovDex(uint64(l)) + } + return n +} + +func (m *SwapView_Opaque) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Swap != nil { + l = m.Swap.Size() + n += 1 + l + sovDex(uint64(l)) + } + return n +} + +func (m *SwapClaimView) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SwapClaimView != nil { + n += m.SwapClaimView.Size() + } + return n +} + +func (m *SwapClaimView_Visible_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Visible != nil { + l = m.Visible.Size() + n += 1 + l + sovDex(uint64(l)) + } + return n +} +func (m *SwapClaimView_Opaque_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Opaque != nil { + l = m.Opaque.Size() + n += 1 + l + sovDex(uint64(l)) + } + return n +} +func (m *SwapClaimView_Visible) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SwapClaim != nil { + l = m.SwapClaim.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.Output_1 != nil { + l = m.Output_1.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.Output_2 != nil { + l = m.Output_2.Size() + n += 1 + l + sovDex(uint64(l)) + } + return n +} + +func (m *SwapClaimView_Opaque) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SwapClaim != nil { + l = m.SwapClaim.Size() + n += 1 + l + sovDex(uint64(l)) + } + return n +} + +func (m *TradingPair) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Asset_1 != nil { + l = m.Asset_1.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.Asset_2 != nil { + l = m.Asset_2.Size() + n += 1 + l + sovDex(uint64(l)) + } + return n +} + +func (m *DirectedTradingPair) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Start != nil { + l = m.Start.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.End != nil { + l = m.End.Size() + n += 1 + l + sovDex(uint64(l)) + } + return n +} + +func (m *BatchSwapOutputData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Delta_1 != nil { + l = m.Delta_1.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.Delta_2 != nil { + l = m.Delta_2.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.Lambda_1 != nil { + l = m.Lambda_1.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.Lambda_2 != nil { + l = m.Lambda_2.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.Unfilled_1 != nil { + l = m.Unfilled_1.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.Unfilled_2 != nil { + l = m.Unfilled_2.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.Height != 0 { + n += 1 + sovDex(uint64(m.Height)) + } + if m.TradingPair != nil { + l = m.TradingPair.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.EpochHeight != 0 { + n += 1 + sovDex(uint64(m.EpochHeight)) + } + return n +} + +func (m *TradingFunction) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Component != nil { + l = m.Component.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.Pair != nil { + l = m.Pair.Size() + n += 1 + l + sovDex(uint64(l)) + } + return n +} + +func (m *BareTradingFunction) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Fee != 0 { + n += 1 + sovDex(uint64(m.Fee)) + } + if m.P != nil { + l = m.P.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.Q != nil { + l = m.Q.Size() + n += 1 + l + sovDex(uint64(l)) + } + return n +} + +func (m *Reserves) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.R1 != nil { + l = m.R1.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.R2 != nil { + l = m.R2.Size() + n += 1 + l + sovDex(uint64(l)) + } + return n +} + +func (m *Position) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Phi != nil { + l = m.Phi.Size() + n += 1 + l + sovDex(uint64(l)) + } + l = len(m.Nonce) + if l > 0 { + n += 1 + l + sovDex(uint64(l)) + } + if m.State != nil { + l = m.State.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.Reserves != nil { + l = m.Reserves.Size() + n += 1 + l + sovDex(uint64(l)) + } + return n +} + +func (m *PositionId) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovDex(uint64(l)) + } + return n +} + +func (m *PositionState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.State != 0 { + n += 1 + sovDex(uint64(m.State)) + } + return n +} + +func (m *LpNft) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PositionId != nil { + l = m.PositionId.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.State != nil { + l = m.State.Size() + n += 1 + l + sovDex(uint64(l)) + } + return n +} + +func (m *PositionOpen) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Position != nil { + l = m.Position.Size() + n += 1 + l + sovDex(uint64(l)) + } + return n +} + +func (m *PositionClose) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PositionId != nil { + l = m.PositionId.Size() + n += 1 + l + sovDex(uint64(l)) + } + return n +} + +func (m *PositionWithdraw) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PositionId != nil { + l = m.PositionId.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.ReservesCommitment != nil { + l = m.ReservesCommitment.Size() + n += 1 + l + sovDex(uint64(l)) + } + return n +} + +func (m *PositionRewardClaim) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PositionId != nil { + l = m.PositionId.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.RewardsCommitment != nil { + l = m.RewardsCommitment.Size() + n += 1 + l + sovDex(uint64(l)) + } + return n +} + +func (m *Path) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pair != nil { + l = m.Pair.Size() + n += 1 + l + sovDex(uint64(l)) + } + if len(m.Route) > 0 { + for _, e := range m.Route { + l = e.Size() + n += 1 + l + sovDex(uint64(l)) + } + } + if m.Phi != nil { + l = m.Phi.Size() + n += 1 + l + sovDex(uint64(l)) + } + return n +} + +func (m *SwapExecution) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Traces) > 0 { + for _, e := range m.Traces { + l = e.Size() + n += 1 + l + sovDex(uint64(l)) + } + } + return n +} + +func (m *SwapExecution_Trace) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Value) > 0 { + for _, e := range m.Value { + l = e.Size() + n += 1 + l + sovDex(uint64(l)) + } + } + return n +} + +func (m *PositionWithdrawPlan) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Reserves != nil { + l = m.Reserves.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.PositionId != nil { + l = m.PositionId.Size() + n += 1 + l + sovDex(uint64(l)) + } + if m.Pair != nil { + l = m.Pair.Size() + n += 1 + l + sovDex(uint64(l)) + } + return n +} + +func (m *PositionRewardClaimPlan) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Reserves != nil { + l = m.Reserves.Size() + n += 1 + l + sovDex(uint64(l)) + } + return n +} + +func sovDex(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozDex(x uint64) (n int) { + return sovDex(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Swap) 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 ErrIntOverflowDex + } + 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: Swap: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Swap: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Proof == nil { + m.Proof = &v1alpha1.ZKSwapProof{} + } + if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Body", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Body == nil { + m.Body = &SwapBody{} + } + if err := m.Body.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SwapClaim) 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 ErrIntOverflowDex + } + 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: SwapClaim: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SwapClaim: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proof = append(m.Proof[:0], dAtA[iNdEx:postIndex]...) + if m.Proof == nil { + m.Proof = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Body", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Body == nil { + m.Body = &SwapClaimBody{} + } + if err := m.Body.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EpochDuration", wireType) + } + m.EpochDuration = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EpochDuration |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SwapClaimBody) 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 ErrIntOverflowDex + } + 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: SwapClaimBody: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SwapClaimBody: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nullifier", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Nullifier == nil { + m.Nullifier = &v1alpha1.Nullifier{} + } + if err := m.Nullifier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Fee == nil { + m.Fee = &v1alpha1.Fee{} + } + if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Output_1Commitment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Output_1Commitment == nil { + m.Output_1Commitment = &v1alpha1.StateCommitment{} + } + if err := m.Output_1Commitment.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Output_2Commitment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Output_2Commitment == nil { + m.Output_2Commitment = &v1alpha1.StateCommitment{} + } + if err := m.Output_2Commitment.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutputData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.OutputData == nil { + m.OutputData = &BatchSwapOutputData{} + } + if err := m.OutputData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SwapBody) 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 ErrIntOverflowDex + } + 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: SwapBody: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SwapBody: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TradingPair", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TradingPair == nil { + m.TradingPair = &TradingPair{} + } + if err := m.TradingPair.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Delta_1I", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Delta_1I == nil { + m.Delta_1I = &v1alpha1.Amount{} + } + if err := m.Delta_1I.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Delta_2I", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Delta_2I == nil { + m.Delta_2I = &v1alpha1.Amount{} + } + if err := m.Delta_2I.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeCommitment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FeeCommitment == nil { + m.FeeCommitment = &v1alpha1.BalanceCommitment{} + } + if err := m.FeeCommitment.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Payload == nil { + m.Payload = &SwapPayload{} + } + if err := m.Payload.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SwapPayload) 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 ErrIntOverflowDex + } + 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: SwapPayload: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SwapPayload: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Commitment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Commitment == nil { + m.Commitment = &v1alpha1.StateCommitment{} + } + if err := m.Commitment.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EncryptedSwap", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EncryptedSwap = append(m.EncryptedSwap[:0], dAtA[iNdEx:postIndex]...) + if m.EncryptedSwap == nil { + m.EncryptedSwap = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SwapPlaintext) 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 ErrIntOverflowDex + } + 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: SwapPlaintext: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SwapPlaintext: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TradingPair", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TradingPair == nil { + m.TradingPair = &TradingPair{} + } + if err := m.TradingPair.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Delta_1I", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Delta_1I == nil { + m.Delta_1I = &v1alpha1.Amount{} + } + if err := m.Delta_1I.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Delta_2I", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Delta_2I == nil { + m.Delta_2I = &v1alpha1.Amount{} + } + if err := m.Delta_2I.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimFee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClaimFee == nil { + m.ClaimFee = &v1alpha1.Fee{} + } + if err := m.ClaimFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimAddress", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClaimAddress == nil { + m.ClaimAddress = &v1alpha1.Address{} + } + if err := m.ClaimAddress.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rseed", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rseed = append(m.Rseed[:0], dAtA[iNdEx:postIndex]...) + if m.Rseed == nil { + m.Rseed = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MockFlowCiphertext) 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 ErrIntOverflowDex + } + 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: MockFlowCiphertext: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MockFlowCiphertext: 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 msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Value == nil { + m.Value = &v1alpha1.Amount{} + } + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SwapPlan) 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 ErrIntOverflowDex + } + 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: SwapPlan: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SwapPlan: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SwapPlaintext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SwapPlaintext == nil { + m.SwapPlaintext = &SwapPlaintext{} + } + if err := m.SwapPlaintext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeBlinding", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeeBlinding = append(m.FeeBlinding[:0], dAtA[iNdEx:postIndex]...) + if m.FeeBlinding == nil { + m.FeeBlinding = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SwapClaimPlan) 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 ErrIntOverflowDex + } + 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: SwapClaimPlan: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SwapClaimPlan: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SwapPlaintext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SwapPlaintext == nil { + m.SwapPlaintext = &SwapPlaintext{} + } + if err := m.SwapPlaintext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Position", wireType) + } + m.Position = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Position |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutputData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.OutputData == nil { + m.OutputData = &BatchSwapOutputData{} + } + if err := m.OutputData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EpochDuration", wireType) + } + m.EpochDuration = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EpochDuration |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SwapView) 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 ErrIntOverflowDex + } + 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: SwapView: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SwapView: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Visible", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &SwapView_Visible{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.SwapView = &SwapView_Visible_{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Opaque", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &SwapView_Opaque{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.SwapView = &SwapView_Opaque_{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SwapView_Visible) 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 ErrIntOverflowDex + } + 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: Visible: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Visible: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Swap", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Swap == nil { + m.Swap = &Swap{} + } + if err := m.Swap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SwapPlaintext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SwapPlaintext == nil { + m.SwapPlaintext = &SwapPlaintext{} + } + if err := m.SwapPlaintext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SwapView_Opaque) 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 ErrIntOverflowDex + } + 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: Opaque: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Opaque: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Swap", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Swap == nil { + m.Swap = &Swap{} + } + if err := m.Swap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SwapClaimView) 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 ErrIntOverflowDex + } + 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: SwapClaimView: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SwapClaimView: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Visible", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &SwapClaimView_Visible{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.SwapClaimView = &SwapClaimView_Visible_{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Opaque", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &SwapClaimView_Opaque{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.SwapClaimView = &SwapClaimView_Opaque_{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SwapClaimView_Visible) 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 ErrIntOverflowDex + } + 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: Visible: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Visible: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SwapClaim", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SwapClaim == nil { + m.SwapClaim = &SwapClaim{} + } + if err := m.SwapClaim.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Output_1", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Output_1 == nil { + m.Output_1 = &v1alpha1.NoteView{} + } + if err := m.Output_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 Output_2", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Output_2 == nil { + m.Output_2 = &v1alpha1.NoteView{} + } + if err := m.Output_2.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SwapClaimView_Opaque) 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 ErrIntOverflowDex + } + 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: Opaque: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Opaque: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SwapClaim", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SwapClaim == nil { + m.SwapClaim = &SwapClaim{} + } + if err := m.SwapClaim.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TradingPair) 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 ErrIntOverflowDex + } + 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: TradingPair: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TradingPair: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Asset_1", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Asset_1 == nil { + m.Asset_1 = &v1alpha1.AssetId{} + } + if err := m.Asset_1.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Asset_2", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Asset_2 == nil { + m.Asset_2 = &v1alpha1.AssetId{} + } + if err := m.Asset_2.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DirectedTradingPair) 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 ErrIntOverflowDex + } + 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: DirectedTradingPair: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DirectedTradingPair: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Start", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Start == nil { + m.Start = &v1alpha1.AssetId{} + } + if err := m.Start.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field End", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.End == nil { + m.End = &v1alpha1.AssetId{} + } + if err := m.End.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BatchSwapOutputData) 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 ErrIntOverflowDex + } + 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: BatchSwapOutputData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BatchSwapOutputData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Delta_1", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Delta_1 == nil { + m.Delta_1 = &v1alpha1.Amount{} + } + if err := m.Delta_1.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Delta_2", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Delta_2 == nil { + m.Delta_2 = &v1alpha1.Amount{} + } + if err := m.Delta_2.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Lambda_1", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Lambda_1 == nil { + m.Lambda_1 = &v1alpha1.Amount{} + } + if err := m.Lambda_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 Lambda_2", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Lambda_2 == nil { + m.Lambda_2 = &v1alpha1.Amount{} + } + if err := m.Lambda_2.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Unfilled_1", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Unfilled_1 == nil { + m.Unfilled_1 = &v1alpha1.Amount{} + } + if err := m.Unfilled_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 Unfilled_2", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Unfilled_2 == nil { + m.Unfilled_2 = &v1alpha1.Amount{} + } + if err := m.Unfilled_2.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TradingPair", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TradingPair == nil { + m.TradingPair = &TradingPair{} + } + if err := m.TradingPair.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EpochHeight", wireType) + } + m.EpochHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EpochHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TradingFunction) 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 ErrIntOverflowDex + } + 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: TradingFunction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TradingFunction: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Component", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Component == nil { + m.Component = &BareTradingFunction{} + } + if err := m.Component.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pair", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pair == nil { + m.Pair = &TradingPair{} + } + if err := m.Pair.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BareTradingFunction) 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 ErrIntOverflowDex + } + 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: BareTradingFunction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BareTradingFunction: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) + } + m.Fee = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Fee |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field P", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.P == nil { + m.P = &v1alpha1.Amount{} + } + if err := m.P.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Q", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Q == nil { + m.Q = &v1alpha1.Amount{} + } + if err := m.Q.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Reserves) 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 ErrIntOverflowDex + } + 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: Reserves: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Reserves: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field R1", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.R1 == nil { + m.R1 = &v1alpha1.Amount{} + } + if err := m.R1.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field R2", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.R2 == nil { + m.R2 = &v1alpha1.Amount{} + } + if err := m.R2.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Position) 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 ErrIntOverflowDex + } + 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: Position: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Position: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Phi", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Phi == nil { + m.Phi = &TradingFunction{} + } + if err := m.Phi.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Nonce = append(m.Nonce[:0], dAtA[iNdEx:postIndex]...) + if m.Nonce == nil { + m.Nonce = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.State == nil { + m.State = &PositionState{} + } + if err := m.State.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reserves", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Reserves == nil { + m.Reserves = &Reserves{} + } + if err := m.Reserves.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PositionId) 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 ErrIntOverflowDex + } + 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: PositionId: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PositionId: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PositionState) 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 ErrIntOverflowDex + } + 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: PositionState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PositionState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + m.State = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.State |= PositionState_PositionStateEnum(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LpNft) 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 ErrIntOverflowDex + } + 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: LpNft: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LpNft: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PositionId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PositionId == nil { + m.PositionId = &PositionId{} + } + if err := m.PositionId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.State == nil { + m.State = &PositionState{} + } + if err := m.State.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PositionOpen) 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 ErrIntOverflowDex + } + 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: PositionOpen: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PositionOpen: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Position", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Position == nil { + m.Position = &Position{} + } + if err := m.Position.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PositionClose) 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 ErrIntOverflowDex + } + 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: PositionClose: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PositionClose: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PositionId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PositionId == nil { + m.PositionId = &PositionId{} + } + if err := m.PositionId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PositionWithdraw) 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 ErrIntOverflowDex + } + 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: PositionWithdraw: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PositionWithdraw: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PositionId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PositionId == nil { + m.PositionId = &PositionId{} + } + if err := m.PositionId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReservesCommitment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ReservesCommitment == nil { + m.ReservesCommitment = &v1alpha1.BalanceCommitment{} + } + if err := m.ReservesCommitment.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PositionRewardClaim) 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 ErrIntOverflowDex + } + 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: PositionRewardClaim: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PositionRewardClaim: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PositionId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PositionId == nil { + m.PositionId = &PositionId{} + } + if err := m.PositionId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardsCommitment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RewardsCommitment == nil { + m.RewardsCommitment = &v1alpha1.BalanceCommitment{} + } + if err := m.RewardsCommitment.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Path) 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 ErrIntOverflowDex + } + 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: Path: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Path: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pair", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pair == nil { + m.Pair = &DirectedTradingPair{} + } + if err := m.Pair.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Route", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Route = append(m.Route, &v1alpha1.AssetId{}) + if err := m.Route[len(m.Route)-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 Phi", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Phi == nil { + m.Phi = &BareTradingFunction{} + } + if err := m.Phi.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SwapExecution) 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 ErrIntOverflowDex + } + 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: SwapExecution: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SwapExecution: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Traces", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Traces = append(m.Traces, &SwapExecution_Trace{}) + if err := m.Traces[len(m.Traces)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SwapExecution_Trace) 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 ErrIntOverflowDex + } + 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: Trace: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Trace: 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 msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value, &v1alpha1.Value{}) + if err := m.Value[len(m.Value)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PositionWithdrawPlan) 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 ErrIntOverflowDex + } + 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: PositionWithdrawPlan: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PositionWithdrawPlan: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reserves", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Reserves == nil { + m.Reserves = &Reserves{} + } + if err := m.Reserves.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PositionId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PositionId == nil { + m.PositionId = &PositionId{} + } + if err := m.PositionId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pair", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pair == nil { + m.Pair = &TradingPair{} + } + if err := m.Pair.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PositionRewardClaimPlan) 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 ErrIntOverflowDex + } + 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: PositionRewardClaimPlan: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PositionRewardClaimPlan: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reserves", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDex + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDex + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDex + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Reserves == nil { + m.Reserves = &Reserves{} + } + if err := m.Reserves.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDex(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDex + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipDex(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, ErrIntOverflowDex + } + 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, ErrIntOverflowDex + } + 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, ErrIntOverflowDex + } + 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, ErrInvalidLengthDex + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupDex + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthDex + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthDex = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowDex = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupDex = fmt.Errorf("proto: unexpected end of group") +) diff --git a/relayer/chains/penumbra/core/governance/v1alpha1/governance.pb.go b/relayer/chains/penumbra/core/governance/v1alpha1/governance.pb.go new file mode 100644 index 000000000..51a916c78 --- /dev/null +++ b/relayer/chains/penumbra/core/governance/v1alpha1/governance.pb.go @@ -0,0 +1,7233 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: penumbra/core/governance/v1alpha1/governance.proto + +package governancev1alpha1 + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" + proto "github.com/cosmos/gogoproto/proto" + v1alpha11 "github.com/cosmos/relayer/v2/relayer/chains/penumbra/core/chain/v1alpha1" + v1alpha1 "github.com/cosmos/relayer/v2/relayer/chains/penumbra/core/crypto/v1alpha1" + 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 + +// A vote. +type Vote_Vote int32 + +const ( + Vote_VOTE_UNSPECIFIED Vote_Vote = 0 + Vote_VOTE_ABSTAIN Vote_Vote = 1 + Vote_VOTE_YES Vote_Vote = 2 + Vote_VOTE_NO Vote_Vote = 3 +) + +var Vote_Vote_name = map[int32]string{ + 0: "VOTE_UNSPECIFIED", + 1: "VOTE_ABSTAIN", + 2: "VOTE_YES", + 3: "VOTE_NO", +} + +var Vote_Vote_value = map[string]int32{ + "VOTE_UNSPECIFIED": 0, + "VOTE_ABSTAIN": 1, + "VOTE_YES": 2, + "VOTE_NO": 3, +} + +func (x Vote_Vote) String() string { + return proto.EnumName(Vote_Vote_name, int32(x)) +} + +func (Vote_Vote) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{11, 0} +} + +type ProposalSubmit struct { + // The proposal to be submitted. + Proposal *Proposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal,omitempty"` + // The amount of the proposal deposit. + DepositAmount *v1alpha1.Amount `protobuf:"bytes,3,opt,name=deposit_amount,json=depositAmount,proto3" json:"deposit_amount,omitempty"` +} + +func (m *ProposalSubmit) Reset() { *m = ProposalSubmit{} } +func (m *ProposalSubmit) String() string { return proto.CompactTextString(m) } +func (*ProposalSubmit) ProtoMessage() {} +func (*ProposalSubmit) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{0} +} +func (m *ProposalSubmit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProposalSubmit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProposalSubmit.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 *ProposalSubmit) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProposalSubmit.Merge(m, src) +} +func (m *ProposalSubmit) XXX_Size() int { + return m.Size() +} +func (m *ProposalSubmit) XXX_DiscardUnknown() { + xxx_messageInfo_ProposalSubmit.DiscardUnknown(m) +} + +var xxx_messageInfo_ProposalSubmit proto.InternalMessageInfo + +func (m *ProposalSubmit) GetProposal() *Proposal { + if m != nil { + return m.Proposal + } + return nil +} + +func (m *ProposalSubmit) GetDepositAmount() *v1alpha1.Amount { + if m != nil { + return m.DepositAmount + } + return nil +} + +type ProposalWithdraw struct { + // The proposal to be withdrawn. + Proposal uint64 `protobuf:"varint,1,opt,name=proposal,proto3" json:"proposal,omitempty"` + // The reason for the proposal being withdrawn. + Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` +} + +func (m *ProposalWithdraw) Reset() { *m = ProposalWithdraw{} } +func (m *ProposalWithdraw) String() string { return proto.CompactTextString(m) } +func (*ProposalWithdraw) ProtoMessage() {} +func (*ProposalWithdraw) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{1} +} +func (m *ProposalWithdraw) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProposalWithdraw) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProposalWithdraw.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 *ProposalWithdraw) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProposalWithdraw.Merge(m, src) +} +func (m *ProposalWithdraw) XXX_Size() int { + return m.Size() +} +func (m *ProposalWithdraw) XXX_DiscardUnknown() { + xxx_messageInfo_ProposalWithdraw.DiscardUnknown(m) +} + +var xxx_messageInfo_ProposalWithdraw proto.InternalMessageInfo + +func (m *ProposalWithdraw) GetProposal() uint64 { + if m != nil { + return m.Proposal + } + return 0 +} + +func (m *ProposalWithdraw) GetReason() string { + if m != nil { + return m.Reason + } + return "" +} + +type ProposalDepositClaim struct { + // The proposal to claim the deposit for. + Proposal uint64 `protobuf:"varint,1,opt,name=proposal,proto3" json:"proposal,omitempty"` + // The expected deposit amount. + DepositAmount *v1alpha1.Amount `protobuf:"bytes,2,opt,name=deposit_amount,json=depositAmount,proto3" json:"deposit_amount,omitempty"` + // The outcome of the proposal. + Outcome *ProposalOutcome `protobuf:"bytes,3,opt,name=outcome,proto3" json:"outcome,omitempty"` +} + +func (m *ProposalDepositClaim) Reset() { *m = ProposalDepositClaim{} } +func (m *ProposalDepositClaim) String() string { return proto.CompactTextString(m) } +func (*ProposalDepositClaim) ProtoMessage() {} +func (*ProposalDepositClaim) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{2} +} +func (m *ProposalDepositClaim) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProposalDepositClaim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProposalDepositClaim.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 *ProposalDepositClaim) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProposalDepositClaim.Merge(m, src) +} +func (m *ProposalDepositClaim) XXX_Size() int { + return m.Size() +} +func (m *ProposalDepositClaim) XXX_DiscardUnknown() { + xxx_messageInfo_ProposalDepositClaim.DiscardUnknown(m) +} + +var xxx_messageInfo_ProposalDepositClaim proto.InternalMessageInfo + +func (m *ProposalDepositClaim) GetProposal() uint64 { + if m != nil { + return m.Proposal + } + return 0 +} + +func (m *ProposalDepositClaim) GetDepositAmount() *v1alpha1.Amount { + if m != nil { + return m.DepositAmount + } + return nil +} + +func (m *ProposalDepositClaim) GetOutcome() *ProposalOutcome { + if m != nil { + return m.Outcome + } + return nil +} + +type ValidatorVote struct { + // The effecting data for the vote. + Body *ValidatorVoteBody `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + // The vote authorization signature is authorizing data. + AuthSig *v1alpha1.SpendAuthSignature `protobuf:"bytes,2,opt,name=auth_sig,json=authSig,proto3" json:"auth_sig,omitempty"` +} + +func (m *ValidatorVote) Reset() { *m = ValidatorVote{} } +func (m *ValidatorVote) String() string { return proto.CompactTextString(m) } +func (*ValidatorVote) ProtoMessage() {} +func (*ValidatorVote) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{3} +} +func (m *ValidatorVote) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorVote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorVote.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 *ValidatorVote) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorVote.Merge(m, src) +} +func (m *ValidatorVote) XXX_Size() int { + return m.Size() +} +func (m *ValidatorVote) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorVote.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorVote proto.InternalMessageInfo + +func (m *ValidatorVote) GetBody() *ValidatorVoteBody { + if m != nil { + return m.Body + } + return nil +} + +func (m *ValidatorVote) GetAuthSig() *v1alpha1.SpendAuthSignature { + if m != nil { + return m.AuthSig + } + return nil +} + +type ValidatorVoteBody struct { + // The proposal being voted on. + Proposal uint64 `protobuf:"varint,1,opt,name=proposal,proto3" json:"proposal,omitempty"` + // The vote. + Vote *Vote `protobuf:"bytes,2,opt,name=vote,proto3" json:"vote,omitempty"` + // The validator identity. + IdentityKey *v1alpha1.IdentityKey `protobuf:"bytes,3,opt,name=identity_key,json=identityKey,proto3" json:"identity_key,omitempty"` + // The validator governance key. + GovernanceKey *v1alpha1.GovernanceKey `protobuf:"bytes,4,opt,name=governance_key,json=governanceKey,proto3" json:"governance_key,omitempty"` +} + +func (m *ValidatorVoteBody) Reset() { *m = ValidatorVoteBody{} } +func (m *ValidatorVoteBody) String() string { return proto.CompactTextString(m) } +func (*ValidatorVoteBody) ProtoMessage() {} +func (*ValidatorVoteBody) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{4} +} +func (m *ValidatorVoteBody) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorVoteBody) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorVoteBody.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 *ValidatorVoteBody) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorVoteBody.Merge(m, src) +} +func (m *ValidatorVoteBody) XXX_Size() int { + return m.Size() +} +func (m *ValidatorVoteBody) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorVoteBody.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorVoteBody proto.InternalMessageInfo + +func (m *ValidatorVoteBody) GetProposal() uint64 { + if m != nil { + return m.Proposal + } + return 0 +} + +func (m *ValidatorVoteBody) GetVote() *Vote { + if m != nil { + return m.Vote + } + return nil +} + +func (m *ValidatorVoteBody) GetIdentityKey() *v1alpha1.IdentityKey { + if m != nil { + return m.IdentityKey + } + return nil +} + +func (m *ValidatorVoteBody) GetGovernanceKey() *v1alpha1.GovernanceKey { + if m != nil { + return m.GovernanceKey + } + return nil +} + +type DelegatorVote struct { + // The effecting data for the vote. + Body *DelegatorVoteBody `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + // The vote authorization signature is authorizing data. + AuthSig *v1alpha1.SpendAuthSignature `protobuf:"bytes,2,opt,name=auth_sig,json=authSig,proto3" json:"auth_sig,omitempty"` + // The vote proof is authorizing data. + Proof *v1alpha1.ZKDelegatorVoteProof `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof,omitempty"` +} + +func (m *DelegatorVote) Reset() { *m = DelegatorVote{} } +func (m *DelegatorVote) String() string { return proto.CompactTextString(m) } +func (*DelegatorVote) ProtoMessage() {} +func (*DelegatorVote) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{5} +} +func (m *DelegatorVote) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DelegatorVote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DelegatorVote.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 *DelegatorVote) XXX_Merge(src proto.Message) { + xxx_messageInfo_DelegatorVote.Merge(m, src) +} +func (m *DelegatorVote) XXX_Size() int { + return m.Size() +} +func (m *DelegatorVote) XXX_DiscardUnknown() { + xxx_messageInfo_DelegatorVote.DiscardUnknown(m) +} + +var xxx_messageInfo_DelegatorVote proto.InternalMessageInfo + +func (m *DelegatorVote) GetBody() *DelegatorVoteBody { + if m != nil { + return m.Body + } + return nil +} + +func (m *DelegatorVote) GetAuthSig() *v1alpha1.SpendAuthSignature { + if m != nil { + return m.AuthSig + } + return nil +} + +func (m *DelegatorVote) GetProof() *v1alpha1.ZKDelegatorVoteProof { + if m != nil { + return m.Proof + } + return nil +} + +type DelegatorVoteBody struct { + // The proposal being voted on. + Proposal uint64 `protobuf:"varint,1,opt,name=proposal,proto3" json:"proposal,omitempty"` + // The start position of the proposal in the TCT. + StartPosition uint64 `protobuf:"varint,2,opt,name=start_position,json=startPosition,proto3" json:"start_position,omitempty"` + // The vote. + Vote *Vote `protobuf:"bytes,3,opt,name=vote,proto3" json:"vote,omitempty"` + // The value of the delegation note. + Value *v1alpha1.Value `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` + // The amount of the delegation note, in unbonded penumbra. + UnbondedAmount *v1alpha1.Amount `protobuf:"bytes,5,opt,name=unbonded_amount,json=unbondedAmount,proto3" json:"unbonded_amount,omitempty"` + // The nullifier of the input note. + Nullifier []byte `protobuf:"bytes,6,opt,name=nullifier,proto3" json:"nullifier,omitempty"` + // The randomized validating key for the spend authorization signature. + Rk []byte `protobuf:"bytes,7,opt,name=rk,proto3" json:"rk,omitempty"` +} + +func (m *DelegatorVoteBody) Reset() { *m = DelegatorVoteBody{} } +func (m *DelegatorVoteBody) String() string { return proto.CompactTextString(m) } +func (*DelegatorVoteBody) ProtoMessage() {} +func (*DelegatorVoteBody) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{6} +} +func (m *DelegatorVoteBody) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DelegatorVoteBody) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DelegatorVoteBody.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 *DelegatorVoteBody) XXX_Merge(src proto.Message) { + xxx_messageInfo_DelegatorVoteBody.Merge(m, src) +} +func (m *DelegatorVoteBody) XXX_Size() int { + return m.Size() +} +func (m *DelegatorVoteBody) XXX_DiscardUnknown() { + xxx_messageInfo_DelegatorVoteBody.DiscardUnknown(m) +} + +var xxx_messageInfo_DelegatorVoteBody proto.InternalMessageInfo + +func (m *DelegatorVoteBody) GetProposal() uint64 { + if m != nil { + return m.Proposal + } + return 0 +} + +func (m *DelegatorVoteBody) GetStartPosition() uint64 { + if m != nil { + return m.StartPosition + } + return 0 +} + +func (m *DelegatorVoteBody) GetVote() *Vote { + if m != nil { + return m.Vote + } + return nil +} + +func (m *DelegatorVoteBody) GetValue() *v1alpha1.Value { + if m != nil { + return m.Value + } + return nil +} + +func (m *DelegatorVoteBody) GetUnbondedAmount() *v1alpha1.Amount { + if m != nil { + return m.UnbondedAmount + } + return nil +} + +func (m *DelegatorVoteBody) GetNullifier() []byte { + if m != nil { + return m.Nullifier + } + return nil +} + +func (m *DelegatorVoteBody) GetRk() []byte { + if m != nil { + return m.Rk + } + return nil +} + +type DelegatorVotePlan struct { + // The proposal to vote on. + Proposal uint64 `protobuf:"varint,1,opt,name=proposal,proto3" json:"proposal,omitempty"` + // The start position of the proposal in the TCT. + StartPosition uint64 `protobuf:"varint,2,opt,name=start_position,json=startPosition,proto3" json:"start_position,omitempty"` + // The vote to cast. + Vote *Vote `protobuf:"bytes,3,opt,name=vote,proto3" json:"vote,omitempty"` + // The delegation note to prove that we can vote. + StakedNote *v1alpha1.Note `protobuf:"bytes,4,opt,name=staked_note,json=stakedNote,proto3" json:"staked_note,omitempty"` + // The position of that delegation note. + StakedNotePosition uint64 `protobuf:"varint,5,opt,name=staked_note_position,json=stakedNotePosition,proto3" json:"staked_note_position,omitempty"` + // The unbonded amount equivalent to the delegation note. + UnbondedAmount *v1alpha1.Amount `protobuf:"bytes,6,opt,name=unbonded_amount,json=unbondedAmount,proto3" json:"unbonded_amount,omitempty"` + // The randomizer to use for the proof of spend capability. + Randomizer []byte `protobuf:"bytes,7,opt,name=randomizer,proto3" json:"randomizer,omitempty"` +} + +func (m *DelegatorVotePlan) Reset() { *m = DelegatorVotePlan{} } +func (m *DelegatorVotePlan) String() string { return proto.CompactTextString(m) } +func (*DelegatorVotePlan) ProtoMessage() {} +func (*DelegatorVotePlan) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{7} +} +func (m *DelegatorVotePlan) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DelegatorVotePlan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DelegatorVotePlan.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 *DelegatorVotePlan) XXX_Merge(src proto.Message) { + xxx_messageInfo_DelegatorVotePlan.Merge(m, src) +} +func (m *DelegatorVotePlan) XXX_Size() int { + return m.Size() +} +func (m *DelegatorVotePlan) XXX_DiscardUnknown() { + xxx_messageInfo_DelegatorVotePlan.DiscardUnknown(m) +} + +var xxx_messageInfo_DelegatorVotePlan proto.InternalMessageInfo + +func (m *DelegatorVotePlan) GetProposal() uint64 { + if m != nil { + return m.Proposal + } + return 0 +} + +func (m *DelegatorVotePlan) GetStartPosition() uint64 { + if m != nil { + return m.StartPosition + } + return 0 +} + +func (m *DelegatorVotePlan) GetVote() *Vote { + if m != nil { + return m.Vote + } + return nil +} + +func (m *DelegatorVotePlan) GetStakedNote() *v1alpha1.Note { + if m != nil { + return m.StakedNote + } + return nil +} + +func (m *DelegatorVotePlan) GetStakedNotePosition() uint64 { + if m != nil { + return m.StakedNotePosition + } + return 0 +} + +func (m *DelegatorVotePlan) GetUnbondedAmount() *v1alpha1.Amount { + if m != nil { + return m.UnbondedAmount + } + return nil +} + +func (m *DelegatorVotePlan) GetRandomizer() []byte { + if m != nil { + return m.Randomizer + } + return nil +} + +type DaoDeposit struct { + // The value to deposit into the DAO. + Value *v1alpha1.Value `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *DaoDeposit) Reset() { *m = DaoDeposit{} } +func (m *DaoDeposit) String() string { return proto.CompactTextString(m) } +func (*DaoDeposit) ProtoMessage() {} +func (*DaoDeposit) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{8} +} +func (m *DaoDeposit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DaoDeposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DaoDeposit.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 *DaoDeposit) XXX_Merge(src proto.Message) { + xxx_messageInfo_DaoDeposit.Merge(m, src) +} +func (m *DaoDeposit) XXX_Size() int { + return m.Size() +} +func (m *DaoDeposit) XXX_DiscardUnknown() { + xxx_messageInfo_DaoDeposit.DiscardUnknown(m) +} + +var xxx_messageInfo_DaoDeposit proto.InternalMessageInfo + +func (m *DaoDeposit) GetValue() *v1alpha1.Value { + if m != nil { + return m.Value + } + return nil +} + +type DaoSpend struct { + // The value to spend from the DAO. + Value *v1alpha1.Value `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *DaoSpend) Reset() { *m = DaoSpend{} } +func (m *DaoSpend) String() string { return proto.CompactTextString(m) } +func (*DaoSpend) ProtoMessage() {} +func (*DaoSpend) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{9} +} +func (m *DaoSpend) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DaoSpend) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DaoSpend.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 *DaoSpend) XXX_Merge(src proto.Message) { + xxx_messageInfo_DaoSpend.Merge(m, src) +} +func (m *DaoSpend) XXX_Size() int { + return m.Size() +} +func (m *DaoSpend) XXX_DiscardUnknown() { + xxx_messageInfo_DaoSpend.DiscardUnknown(m) +} + +var xxx_messageInfo_DaoSpend proto.InternalMessageInfo + +func (m *DaoSpend) GetValue() *v1alpha1.Value { + if m != nil { + return m.Value + } + return nil +} + +type DaoOutput struct { + // The value to output from the DAO. + Value *v1alpha1.Value `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + // The address to send the output to. + Address *v1alpha1.Address `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *DaoOutput) Reset() { *m = DaoOutput{} } +func (m *DaoOutput) String() string { return proto.CompactTextString(m) } +func (*DaoOutput) ProtoMessage() {} +func (*DaoOutput) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{10} +} +func (m *DaoOutput) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DaoOutput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DaoOutput.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 *DaoOutput) XXX_Merge(src proto.Message) { + xxx_messageInfo_DaoOutput.Merge(m, src) +} +func (m *DaoOutput) XXX_Size() int { + return m.Size() +} +func (m *DaoOutput) XXX_DiscardUnknown() { + xxx_messageInfo_DaoOutput.DiscardUnknown(m) +} + +var xxx_messageInfo_DaoOutput proto.InternalMessageInfo + +func (m *DaoOutput) GetValue() *v1alpha1.Value { + if m != nil { + return m.Value + } + return nil +} + +func (m *DaoOutput) GetAddress() *v1alpha1.Address { + if m != nil { + return m.Address + } + return nil +} + +// A vote on a proposal. +type Vote struct { + // The vote. + Vote Vote_Vote `protobuf:"varint,1,opt,name=vote,proto3,enum=penumbra.core.governance.v1alpha1.Vote_Vote" json:"vote,omitempty"` +} + +func (m *Vote) Reset() { *m = Vote{} } +func (m *Vote) String() string { return proto.CompactTextString(m) } +func (*Vote) ProtoMessage() {} +func (*Vote) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{11} +} +func (m *Vote) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Vote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Vote.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 *Vote) XXX_Merge(src proto.Message) { + xxx_messageInfo_Vote.Merge(m, src) +} +func (m *Vote) XXX_Size() int { + return m.Size() +} +func (m *Vote) XXX_DiscardUnknown() { + xxx_messageInfo_Vote.DiscardUnknown(m) +} + +var xxx_messageInfo_Vote proto.InternalMessageInfo + +func (m *Vote) GetVote() Vote_Vote { + if m != nil { + return m.Vote + } + return Vote_VOTE_UNSPECIFIED +} + +// The current state of a proposal. +type ProposalState struct { + // The state of the proposal. + // + // Types that are valid to be assigned to State: + // *ProposalState_Voting_ + // *ProposalState_Withdrawn_ + // *ProposalState_Finished_ + // *ProposalState_Claimed_ + State isProposalState_State `protobuf_oneof:"state"` +} + +func (m *ProposalState) Reset() { *m = ProposalState{} } +func (m *ProposalState) String() string { return proto.CompactTextString(m) } +func (*ProposalState) ProtoMessage() {} +func (*ProposalState) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{12} +} +func (m *ProposalState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProposalState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProposalState.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 *ProposalState) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProposalState.Merge(m, src) +} +func (m *ProposalState) XXX_Size() int { + return m.Size() +} +func (m *ProposalState) XXX_DiscardUnknown() { + xxx_messageInfo_ProposalState.DiscardUnknown(m) +} + +var xxx_messageInfo_ProposalState proto.InternalMessageInfo + +type isProposalState_State interface { + isProposalState_State() + MarshalTo([]byte) (int, error) + Size() int +} + +type ProposalState_Voting_ struct { + Voting *ProposalState_Voting `protobuf:"bytes,2,opt,name=voting,proto3,oneof" json:"voting,omitempty"` +} +type ProposalState_Withdrawn_ struct { + Withdrawn *ProposalState_Withdrawn `protobuf:"bytes,3,opt,name=withdrawn,proto3,oneof" json:"withdrawn,omitempty"` +} +type ProposalState_Finished_ struct { + Finished *ProposalState_Finished `protobuf:"bytes,4,opt,name=finished,proto3,oneof" json:"finished,omitempty"` +} +type ProposalState_Claimed_ struct { + Claimed *ProposalState_Claimed `protobuf:"bytes,5,opt,name=claimed,proto3,oneof" json:"claimed,omitempty"` +} + +func (*ProposalState_Voting_) isProposalState_State() {} +func (*ProposalState_Withdrawn_) isProposalState_State() {} +func (*ProposalState_Finished_) isProposalState_State() {} +func (*ProposalState_Claimed_) isProposalState_State() {} + +func (m *ProposalState) GetState() isProposalState_State { + if m != nil { + return m.State + } + return nil +} + +func (m *ProposalState) GetVoting() *ProposalState_Voting { + if x, ok := m.GetState().(*ProposalState_Voting_); ok { + return x.Voting + } + return nil +} + +func (m *ProposalState) GetWithdrawn() *ProposalState_Withdrawn { + if x, ok := m.GetState().(*ProposalState_Withdrawn_); ok { + return x.Withdrawn + } + return nil +} + +func (m *ProposalState) GetFinished() *ProposalState_Finished { + if x, ok := m.GetState().(*ProposalState_Finished_); ok { + return x.Finished + } + return nil +} + +func (m *ProposalState) GetClaimed() *ProposalState_Claimed { + if x, ok := m.GetState().(*ProposalState_Claimed_); ok { + return x.Claimed + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*ProposalState) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*ProposalState_Voting_)(nil), + (*ProposalState_Withdrawn_)(nil), + (*ProposalState_Finished_)(nil), + (*ProposalState_Claimed_)(nil), + } +} + +// Voting is in progress and the proposal has not yet concluded voting or been withdrawn. +type ProposalState_Voting struct { +} + +func (m *ProposalState_Voting) Reset() { *m = ProposalState_Voting{} } +func (m *ProposalState_Voting) String() string { return proto.CompactTextString(m) } +func (*ProposalState_Voting) ProtoMessage() {} +func (*ProposalState_Voting) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{12, 0} +} +func (m *ProposalState_Voting) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProposalState_Voting) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProposalState_Voting.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 *ProposalState_Voting) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProposalState_Voting.Merge(m, src) +} +func (m *ProposalState_Voting) XXX_Size() int { + return m.Size() +} +func (m *ProposalState_Voting) XXX_DiscardUnknown() { + xxx_messageInfo_ProposalState_Voting.DiscardUnknown(m) +} + +var xxx_messageInfo_ProposalState_Voting proto.InternalMessageInfo + +// The proposal has been withdrawn but the voting period is not yet concluded. +type ProposalState_Withdrawn struct { + // The reason for the withdrawal. + Reason string `protobuf:"bytes,1,opt,name=reason,proto3" json:"reason,omitempty"` +} + +func (m *ProposalState_Withdrawn) Reset() { *m = ProposalState_Withdrawn{} } +func (m *ProposalState_Withdrawn) String() string { return proto.CompactTextString(m) } +func (*ProposalState_Withdrawn) ProtoMessage() {} +func (*ProposalState_Withdrawn) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{12, 1} +} +func (m *ProposalState_Withdrawn) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProposalState_Withdrawn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProposalState_Withdrawn.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 *ProposalState_Withdrawn) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProposalState_Withdrawn.Merge(m, src) +} +func (m *ProposalState_Withdrawn) XXX_Size() int { + return m.Size() +} +func (m *ProposalState_Withdrawn) XXX_DiscardUnknown() { + xxx_messageInfo_ProposalState_Withdrawn.DiscardUnknown(m) +} + +var xxx_messageInfo_ProposalState_Withdrawn proto.InternalMessageInfo + +func (m *ProposalState_Withdrawn) GetReason() string { + if m != nil { + return m.Reason + } + return "" +} + +// The voting period has ended, and the proposal has been assigned an outcome. +type ProposalState_Finished struct { + Outcome *ProposalOutcome `protobuf:"bytes,1,opt,name=outcome,proto3" json:"outcome,omitempty"` +} + +func (m *ProposalState_Finished) Reset() { *m = ProposalState_Finished{} } +func (m *ProposalState_Finished) String() string { return proto.CompactTextString(m) } +func (*ProposalState_Finished) ProtoMessage() {} +func (*ProposalState_Finished) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{12, 2} +} +func (m *ProposalState_Finished) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProposalState_Finished) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProposalState_Finished.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 *ProposalState_Finished) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProposalState_Finished.Merge(m, src) +} +func (m *ProposalState_Finished) XXX_Size() int { + return m.Size() +} +func (m *ProposalState_Finished) XXX_DiscardUnknown() { + xxx_messageInfo_ProposalState_Finished.DiscardUnknown(m) +} + +var xxx_messageInfo_ProposalState_Finished proto.InternalMessageInfo + +func (m *ProposalState_Finished) GetOutcome() *ProposalOutcome { + if m != nil { + return m.Outcome + } + return nil +} + +// The voting period has ended, and the original proposer has claimed their deposit. +type ProposalState_Claimed struct { + Outcome *ProposalOutcome `protobuf:"bytes,1,opt,name=outcome,proto3" json:"outcome,omitempty"` +} + +func (m *ProposalState_Claimed) Reset() { *m = ProposalState_Claimed{} } +func (m *ProposalState_Claimed) String() string { return proto.CompactTextString(m) } +func (*ProposalState_Claimed) ProtoMessage() {} +func (*ProposalState_Claimed) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{12, 3} +} +func (m *ProposalState_Claimed) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProposalState_Claimed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProposalState_Claimed.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 *ProposalState_Claimed) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProposalState_Claimed.Merge(m, src) +} +func (m *ProposalState_Claimed) XXX_Size() int { + return m.Size() +} +func (m *ProposalState_Claimed) XXX_DiscardUnknown() { + xxx_messageInfo_ProposalState_Claimed.DiscardUnknown(m) +} + +var xxx_messageInfo_ProposalState_Claimed proto.InternalMessageInfo + +func (m *ProposalState_Claimed) GetOutcome() *ProposalOutcome { + if m != nil { + return m.Outcome + } + return nil +} + +// The outcome of a concluded proposal. +type ProposalOutcome struct { + // Types that are valid to be assigned to Outcome: + // + // *ProposalOutcome_Passed_ + // *ProposalOutcome_Failed_ + // *ProposalOutcome_Slashed_ + Outcome isProposalOutcome_Outcome `protobuf_oneof:"outcome"` +} + +func (m *ProposalOutcome) Reset() { *m = ProposalOutcome{} } +func (m *ProposalOutcome) String() string { return proto.CompactTextString(m) } +func (*ProposalOutcome) ProtoMessage() {} +func (*ProposalOutcome) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{13} +} +func (m *ProposalOutcome) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProposalOutcome) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProposalOutcome.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 *ProposalOutcome) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProposalOutcome.Merge(m, src) +} +func (m *ProposalOutcome) XXX_Size() int { + return m.Size() +} +func (m *ProposalOutcome) XXX_DiscardUnknown() { + xxx_messageInfo_ProposalOutcome.DiscardUnknown(m) +} + +var xxx_messageInfo_ProposalOutcome proto.InternalMessageInfo + +type isProposalOutcome_Outcome interface { + isProposalOutcome_Outcome() + MarshalTo([]byte) (int, error) + Size() int +} + +type ProposalOutcome_Passed_ struct { + Passed *ProposalOutcome_Passed `protobuf:"bytes,1,opt,name=passed,proto3,oneof" json:"passed,omitempty"` +} +type ProposalOutcome_Failed_ struct { + Failed *ProposalOutcome_Failed `protobuf:"bytes,2,opt,name=failed,proto3,oneof" json:"failed,omitempty"` +} +type ProposalOutcome_Slashed_ struct { + Slashed *ProposalOutcome_Slashed `protobuf:"bytes,3,opt,name=slashed,proto3,oneof" json:"slashed,omitempty"` +} + +func (*ProposalOutcome_Passed_) isProposalOutcome_Outcome() {} +func (*ProposalOutcome_Failed_) isProposalOutcome_Outcome() {} +func (*ProposalOutcome_Slashed_) isProposalOutcome_Outcome() {} + +func (m *ProposalOutcome) GetOutcome() isProposalOutcome_Outcome { + if m != nil { + return m.Outcome + } + return nil +} + +func (m *ProposalOutcome) GetPassed() *ProposalOutcome_Passed { + if x, ok := m.GetOutcome().(*ProposalOutcome_Passed_); ok { + return x.Passed + } + return nil +} + +func (m *ProposalOutcome) GetFailed() *ProposalOutcome_Failed { + if x, ok := m.GetOutcome().(*ProposalOutcome_Failed_); ok { + return x.Failed + } + return nil +} + +func (m *ProposalOutcome) GetSlashed() *ProposalOutcome_Slashed { + if x, ok := m.GetOutcome().(*ProposalOutcome_Slashed_); ok { + return x.Slashed + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*ProposalOutcome) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*ProposalOutcome_Passed_)(nil), + (*ProposalOutcome_Failed_)(nil), + (*ProposalOutcome_Slashed_)(nil), + } +} + +// The proposal was passed. +type ProposalOutcome_Passed struct { +} + +func (m *ProposalOutcome_Passed) Reset() { *m = ProposalOutcome_Passed{} } +func (m *ProposalOutcome_Passed) String() string { return proto.CompactTextString(m) } +func (*ProposalOutcome_Passed) ProtoMessage() {} +func (*ProposalOutcome_Passed) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{13, 0} +} +func (m *ProposalOutcome_Passed) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProposalOutcome_Passed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProposalOutcome_Passed.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 *ProposalOutcome_Passed) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProposalOutcome_Passed.Merge(m, src) +} +func (m *ProposalOutcome_Passed) XXX_Size() int { + return m.Size() +} +func (m *ProposalOutcome_Passed) XXX_DiscardUnknown() { + xxx_messageInfo_ProposalOutcome_Passed.DiscardUnknown(m) +} + +var xxx_messageInfo_ProposalOutcome_Passed proto.InternalMessageInfo + +// The proposal did not pass. +type ProposalOutcome_Failed struct { + // Types that are valid to be assigned to XWithdrawnWithReason: + // + // *ProposalOutcome_Failed_WithdrawnWithReason + XWithdrawnWithReason isProposalOutcome_Failed_XWithdrawnWithReason `protobuf_oneof:"_withdrawn_with_reason"` +} + +func (m *ProposalOutcome_Failed) Reset() { *m = ProposalOutcome_Failed{} } +func (m *ProposalOutcome_Failed) String() string { return proto.CompactTextString(m) } +func (*ProposalOutcome_Failed) ProtoMessage() {} +func (*ProposalOutcome_Failed) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{13, 1} +} +func (m *ProposalOutcome_Failed) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProposalOutcome_Failed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProposalOutcome_Failed.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 *ProposalOutcome_Failed) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProposalOutcome_Failed.Merge(m, src) +} +func (m *ProposalOutcome_Failed) XXX_Size() int { + return m.Size() +} +func (m *ProposalOutcome_Failed) XXX_DiscardUnknown() { + xxx_messageInfo_ProposalOutcome_Failed.DiscardUnknown(m) +} + +var xxx_messageInfo_ProposalOutcome_Failed proto.InternalMessageInfo + +type isProposalOutcome_Failed_XWithdrawnWithReason interface { + isProposalOutcome_Failed_XWithdrawnWithReason() + MarshalTo([]byte) (int, error) + Size() int +} + +type ProposalOutcome_Failed_WithdrawnWithReason struct { + WithdrawnWithReason string `protobuf:"bytes,1,opt,name=withdrawn_with_reason,json=withdrawnWithReason,proto3,oneof" json:"withdrawn_with_reason,omitempty"` +} + +func (*ProposalOutcome_Failed_WithdrawnWithReason) isProposalOutcome_Failed_XWithdrawnWithReason() {} + +func (m *ProposalOutcome_Failed) GetXWithdrawnWithReason() isProposalOutcome_Failed_XWithdrawnWithReason { + if m != nil { + return m.XWithdrawnWithReason + } + return nil +} + +func (m *ProposalOutcome_Failed) GetWithdrawnWithReason() string { + if x, ok := m.GetXWithdrawnWithReason().(*ProposalOutcome_Failed_WithdrawnWithReason); ok { + return x.WithdrawnWithReason + } + return "" +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*ProposalOutcome_Failed) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*ProposalOutcome_Failed_WithdrawnWithReason)(nil), + } +} + +// The proposal did not pass, and was slashed. +type ProposalOutcome_Slashed struct { + // Types that are valid to be assigned to XWithdrawnWithReason: + // + // *ProposalOutcome_Slashed_WithdrawnWithReason + XWithdrawnWithReason isProposalOutcome_Slashed_XWithdrawnWithReason `protobuf_oneof:"_withdrawn_with_reason"` +} + +func (m *ProposalOutcome_Slashed) Reset() { *m = ProposalOutcome_Slashed{} } +func (m *ProposalOutcome_Slashed) String() string { return proto.CompactTextString(m) } +func (*ProposalOutcome_Slashed) ProtoMessage() {} +func (*ProposalOutcome_Slashed) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{13, 2} +} +func (m *ProposalOutcome_Slashed) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProposalOutcome_Slashed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProposalOutcome_Slashed.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 *ProposalOutcome_Slashed) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProposalOutcome_Slashed.Merge(m, src) +} +func (m *ProposalOutcome_Slashed) XXX_Size() int { + return m.Size() +} +func (m *ProposalOutcome_Slashed) XXX_DiscardUnknown() { + xxx_messageInfo_ProposalOutcome_Slashed.DiscardUnknown(m) +} + +var xxx_messageInfo_ProposalOutcome_Slashed proto.InternalMessageInfo + +type isProposalOutcome_Slashed_XWithdrawnWithReason interface { + isProposalOutcome_Slashed_XWithdrawnWithReason() + MarshalTo([]byte) (int, error) + Size() int +} + +type ProposalOutcome_Slashed_WithdrawnWithReason struct { + WithdrawnWithReason string `protobuf:"bytes,1,opt,name=withdrawn_with_reason,json=withdrawnWithReason,proto3,oneof" json:"withdrawn_with_reason,omitempty"` +} + +func (*ProposalOutcome_Slashed_WithdrawnWithReason) isProposalOutcome_Slashed_XWithdrawnWithReason() { +} + +func (m *ProposalOutcome_Slashed) GetXWithdrawnWithReason() isProposalOutcome_Slashed_XWithdrawnWithReason { + if m != nil { + return m.XWithdrawnWithReason + } + return nil +} + +func (m *ProposalOutcome_Slashed) GetWithdrawnWithReason() string { + if x, ok := m.GetXWithdrawnWithReason().(*ProposalOutcome_Slashed_WithdrawnWithReason); ok { + return x.WithdrawnWithReason + } + return "" +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*ProposalOutcome_Slashed) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*ProposalOutcome_Slashed_WithdrawnWithReason)(nil), + } +} + +// A tally of votes on a proposal. +type Tally struct { + // The number of votes in favor of the proposal. + Yes uint64 `protobuf:"varint,1,opt,name=yes,proto3" json:"yes,omitempty"` + // The number of votes against the proposal. + No uint64 `protobuf:"varint,2,opt,name=no,proto3" json:"no,omitempty"` + // The number of abstentions. + Abstain uint64 `protobuf:"varint,3,opt,name=abstain,proto3" json:"abstain,omitempty"` +} + +func (m *Tally) Reset() { *m = Tally{} } +func (m *Tally) String() string { return proto.CompactTextString(m) } +func (*Tally) ProtoMessage() {} +func (*Tally) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{14} +} +func (m *Tally) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Tally) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Tally.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 *Tally) XXX_Merge(src proto.Message) { + xxx_messageInfo_Tally.Merge(m, src) +} +func (m *Tally) XXX_Size() int { + return m.Size() +} +func (m *Tally) XXX_DiscardUnknown() { + xxx_messageInfo_Tally.DiscardUnknown(m) +} + +var xxx_messageInfo_Tally proto.InternalMessageInfo + +func (m *Tally) GetYes() uint64 { + if m != nil { + return m.Yes + } + return 0 +} + +func (m *Tally) GetNo() uint64 { + if m != nil { + return m.No + } + return 0 +} + +func (m *Tally) GetAbstain() uint64 { + if m != nil { + return m.Abstain + } + return 0 +} + +// A proposal to be voted upon. +type Proposal struct { + // The unique identifier of the proposal. + Id uint64 `protobuf:"varint,4,opt,name=id,proto3" json:"id,omitempty"` + // A short title for the proposal. + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // A natural-language description of the effect of the proposal and its justification. + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // The different kinds of proposal. Only one of these should be set. + Signaling *Proposal_Signaling `protobuf:"bytes,5,opt,name=signaling,proto3" json:"signaling,omitempty"` + Emergency *Proposal_Emergency `protobuf:"bytes,6,opt,name=emergency,proto3" json:"emergency,omitempty"` + ParameterChange *Proposal_ParameterChange `protobuf:"bytes,7,opt,name=parameter_change,json=parameterChange,proto3" json:"parameter_change,omitempty"` + DaoSpend *Proposal_DaoSpend `protobuf:"bytes,8,opt,name=dao_spend,json=daoSpend,proto3" json:"dao_spend,omitempty"` +} + +func (m *Proposal) Reset() { *m = Proposal{} } +func (m *Proposal) String() string { return proto.CompactTextString(m) } +func (*Proposal) ProtoMessage() {} +func (*Proposal) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{15} +} +func (m *Proposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Proposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Proposal.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 *Proposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_Proposal.Merge(m, src) +} +func (m *Proposal) XXX_Size() int { + return m.Size() +} +func (m *Proposal) XXX_DiscardUnknown() { + xxx_messageInfo_Proposal.DiscardUnknown(m) +} + +var xxx_messageInfo_Proposal proto.InternalMessageInfo + +func (m *Proposal) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Proposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *Proposal) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Proposal) GetSignaling() *Proposal_Signaling { + if m != nil { + return m.Signaling + } + return nil +} + +func (m *Proposal) GetEmergency() *Proposal_Emergency { + if m != nil { + return m.Emergency + } + return nil +} + +func (m *Proposal) GetParameterChange() *Proposal_ParameterChange { + if m != nil { + return m.ParameterChange + } + return nil +} + +func (m *Proposal) GetDaoSpend() *Proposal_DaoSpend { + if m != nil { + return m.DaoSpend + } + return nil +} + +// A signaling proposal is meant to register a vote on-chain, but does not have an automatic +// effect when passed. +// +// It optionally contains a reference to a commit which contains code to upgrade the chain. +type Proposal_Signaling struct { + // Types that are valid to be assigned to XCommit: + // + // *Proposal_Signaling_Commit + XCommit isProposal_Signaling_XCommit `protobuf_oneof:"_commit"` +} + +func (m *Proposal_Signaling) Reset() { *m = Proposal_Signaling{} } +func (m *Proposal_Signaling) String() string { return proto.CompactTextString(m) } +func (*Proposal_Signaling) ProtoMessage() {} +func (*Proposal_Signaling) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{15, 0} +} +func (m *Proposal_Signaling) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Proposal_Signaling) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Proposal_Signaling.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 *Proposal_Signaling) XXX_Merge(src proto.Message) { + xxx_messageInfo_Proposal_Signaling.Merge(m, src) +} +func (m *Proposal_Signaling) XXX_Size() int { + return m.Size() +} +func (m *Proposal_Signaling) XXX_DiscardUnknown() { + xxx_messageInfo_Proposal_Signaling.DiscardUnknown(m) +} + +var xxx_messageInfo_Proposal_Signaling proto.InternalMessageInfo + +type isProposal_Signaling_XCommit interface { + isProposal_Signaling_XCommit() + MarshalTo([]byte) (int, error) + Size() int +} + +type Proposal_Signaling_Commit struct { + Commit string `protobuf:"bytes,1,opt,name=commit,proto3,oneof" json:"commit,omitempty"` +} + +func (*Proposal_Signaling_Commit) isProposal_Signaling_XCommit() {} + +func (m *Proposal_Signaling) GetXCommit() isProposal_Signaling_XCommit { + if m != nil { + return m.XCommit + } + return nil +} + +func (m *Proposal_Signaling) GetCommit() string { + if x, ok := m.GetXCommit().(*Proposal_Signaling_Commit); ok { + return x.Commit + } + return "" +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Proposal_Signaling) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*Proposal_Signaling_Commit)(nil), + } +} + +// An emergency proposal can be passed instantaneously by a 2/3 majority of validators, without +// waiting for the voting period to expire. +// +// If the boolean `halt_chain` is set to `true`, then the chain will halt immediately when the +// proposal is passed. +type Proposal_Emergency struct { + // If `true`, the chain will halt immediately when the proposal is passed. + HaltChain bool `protobuf:"varint,1,opt,name=halt_chain,json=haltChain,proto3" json:"halt_chain,omitempty"` +} + +func (m *Proposal_Emergency) Reset() { *m = Proposal_Emergency{} } +func (m *Proposal_Emergency) String() string { return proto.CompactTextString(m) } +func (*Proposal_Emergency) ProtoMessage() {} +func (*Proposal_Emergency) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{15, 1} +} +func (m *Proposal_Emergency) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Proposal_Emergency) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Proposal_Emergency.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 *Proposal_Emergency) XXX_Merge(src proto.Message) { + xxx_messageInfo_Proposal_Emergency.Merge(m, src) +} +func (m *Proposal_Emergency) XXX_Size() int { + return m.Size() +} +func (m *Proposal_Emergency) XXX_DiscardUnknown() { + xxx_messageInfo_Proposal_Emergency.DiscardUnknown(m) +} + +var xxx_messageInfo_Proposal_Emergency proto.InternalMessageInfo + +func (m *Proposal_Emergency) GetHaltChain() bool { + if m != nil { + return m.HaltChain + } + return false +} + +// A parameter change proposal describes a replacement of the chain parameters, which should take +// effect when the proposal is passed. +type Proposal_ParameterChange struct { + // The old chain parameters to be replaced: even if the proposal passes, the update will not be + // applied if the chain parameters have changed *at all* from these chain parameters. Usually, + // this should be set to the current chain parameters at time of proposal. + OldParameters *v1alpha11.ChainParameters `protobuf:"bytes,1,opt,name=old_parameters,json=oldParameters,proto3" json:"old_parameters,omitempty"` + // The new chain parameters to be set: the *entire* chain parameters will be replaced with these + // at the time the proposal is passed. + NewParameters *v1alpha11.ChainParameters `protobuf:"bytes,2,opt,name=new_parameters,json=newParameters,proto3" json:"new_parameters,omitempty"` +} + +func (m *Proposal_ParameterChange) Reset() { *m = Proposal_ParameterChange{} } +func (m *Proposal_ParameterChange) String() string { return proto.CompactTextString(m) } +func (*Proposal_ParameterChange) ProtoMessage() {} +func (*Proposal_ParameterChange) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{15, 2} +} +func (m *Proposal_ParameterChange) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Proposal_ParameterChange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Proposal_ParameterChange.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 *Proposal_ParameterChange) XXX_Merge(src proto.Message) { + xxx_messageInfo_Proposal_ParameterChange.Merge(m, src) +} +func (m *Proposal_ParameterChange) XXX_Size() int { + return m.Size() +} +func (m *Proposal_ParameterChange) XXX_DiscardUnknown() { + xxx_messageInfo_Proposal_ParameterChange.DiscardUnknown(m) +} + +var xxx_messageInfo_Proposal_ParameterChange proto.InternalMessageInfo + +func (m *Proposal_ParameterChange) GetOldParameters() *v1alpha11.ChainParameters { + if m != nil { + return m.OldParameters + } + return nil +} + +func (m *Proposal_ParameterChange) GetNewParameters() *v1alpha11.ChainParameters { + if m != nil { + return m.NewParameters + } + return nil +} + +// A DAO spend proposal describes zero or more transactions to execute on behalf of the DAO, with +// access to its funds, and zero or more scheduled transactions from previous passed proposals to +// cancel. +type Proposal_DaoSpend struct { + // The transaction plan to be executed at the time the proposal is passed. This must be a + // transaction plan which can be executed by the DAO, which means it can't require any witness + // data or authorization signatures, but it may use the `DaoSpend` action. + TransactionPlan *types.Any `protobuf:"bytes,2,opt,name=transaction_plan,json=transactionPlan,proto3" json:"transaction_plan,omitempty"` +} + +func (m *Proposal_DaoSpend) Reset() { *m = Proposal_DaoSpend{} } +func (m *Proposal_DaoSpend) String() string { return proto.CompactTextString(m) } +func (*Proposal_DaoSpend) ProtoMessage() {} +func (*Proposal_DaoSpend) Descriptor() ([]byte, []int) { + return fileDescriptor_1bc89f5bf0aed114, []int{15, 3} +} +func (m *Proposal_DaoSpend) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Proposal_DaoSpend) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Proposal_DaoSpend.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 *Proposal_DaoSpend) XXX_Merge(src proto.Message) { + xxx_messageInfo_Proposal_DaoSpend.Merge(m, src) +} +func (m *Proposal_DaoSpend) XXX_Size() int { + return m.Size() +} +func (m *Proposal_DaoSpend) XXX_DiscardUnknown() { + xxx_messageInfo_Proposal_DaoSpend.DiscardUnknown(m) +} + +var xxx_messageInfo_Proposal_DaoSpend proto.InternalMessageInfo + +func (m *Proposal_DaoSpend) GetTransactionPlan() *types.Any { + if m != nil { + return m.TransactionPlan + } + return nil +} + +func init() { + proto.RegisterEnum("penumbra.core.governance.v1alpha1.Vote_Vote", Vote_Vote_name, Vote_Vote_value) + proto.RegisterType((*ProposalSubmit)(nil), "penumbra.core.governance.v1alpha1.ProposalSubmit") + proto.RegisterType((*ProposalWithdraw)(nil), "penumbra.core.governance.v1alpha1.ProposalWithdraw") + proto.RegisterType((*ProposalDepositClaim)(nil), "penumbra.core.governance.v1alpha1.ProposalDepositClaim") + proto.RegisterType((*ValidatorVote)(nil), "penumbra.core.governance.v1alpha1.ValidatorVote") + proto.RegisterType((*ValidatorVoteBody)(nil), "penumbra.core.governance.v1alpha1.ValidatorVoteBody") + proto.RegisterType((*DelegatorVote)(nil), "penumbra.core.governance.v1alpha1.DelegatorVote") + proto.RegisterType((*DelegatorVoteBody)(nil), "penumbra.core.governance.v1alpha1.DelegatorVoteBody") + proto.RegisterType((*DelegatorVotePlan)(nil), "penumbra.core.governance.v1alpha1.DelegatorVotePlan") + proto.RegisterType((*DaoDeposit)(nil), "penumbra.core.governance.v1alpha1.DaoDeposit") + proto.RegisterType((*DaoSpend)(nil), "penumbra.core.governance.v1alpha1.DaoSpend") + proto.RegisterType((*DaoOutput)(nil), "penumbra.core.governance.v1alpha1.DaoOutput") + proto.RegisterType((*Vote)(nil), "penumbra.core.governance.v1alpha1.Vote") + proto.RegisterType((*ProposalState)(nil), "penumbra.core.governance.v1alpha1.ProposalState") + proto.RegisterType((*ProposalState_Voting)(nil), "penumbra.core.governance.v1alpha1.ProposalState.Voting") + proto.RegisterType((*ProposalState_Withdrawn)(nil), "penumbra.core.governance.v1alpha1.ProposalState.Withdrawn") + proto.RegisterType((*ProposalState_Finished)(nil), "penumbra.core.governance.v1alpha1.ProposalState.Finished") + proto.RegisterType((*ProposalState_Claimed)(nil), "penumbra.core.governance.v1alpha1.ProposalState.Claimed") + proto.RegisterType((*ProposalOutcome)(nil), "penumbra.core.governance.v1alpha1.ProposalOutcome") + proto.RegisterType((*ProposalOutcome_Passed)(nil), "penumbra.core.governance.v1alpha1.ProposalOutcome.Passed") + proto.RegisterType((*ProposalOutcome_Failed)(nil), "penumbra.core.governance.v1alpha1.ProposalOutcome.Failed") + proto.RegisterType((*ProposalOutcome_Slashed)(nil), "penumbra.core.governance.v1alpha1.ProposalOutcome.Slashed") + proto.RegisterType((*Tally)(nil), "penumbra.core.governance.v1alpha1.Tally") + proto.RegisterType((*Proposal)(nil), "penumbra.core.governance.v1alpha1.Proposal") + proto.RegisterType((*Proposal_Signaling)(nil), "penumbra.core.governance.v1alpha1.Proposal.Signaling") + proto.RegisterType((*Proposal_Emergency)(nil), "penumbra.core.governance.v1alpha1.Proposal.Emergency") + proto.RegisterType((*Proposal_ParameterChange)(nil), "penumbra.core.governance.v1alpha1.Proposal.ParameterChange") + proto.RegisterType((*Proposal_DaoSpend)(nil), "penumbra.core.governance.v1alpha1.Proposal.DaoSpend") +} + +func init() { + proto.RegisterFile("penumbra/core/governance/v1alpha1/governance.proto", fileDescriptor_1bc89f5bf0aed114) +} + +var fileDescriptor_1bc89f5bf0aed114 = []byte{ + // 1512 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xf7, 0x3a, 0x8e, 0x3f, 0x5e, 0x12, 0xc7, 0x1d, 0x42, 0x65, 0x0c, 0x44, 0xe9, 0xb6, 0x85, + 0xa8, 0x50, 0x9b, 0xa6, 0xa0, 0x52, 0xf7, 0x40, 0x63, 0xe7, 0x53, 0x6d, 0x13, 0x77, 0x1d, 0x52, + 0x28, 0x91, 0x96, 0xb1, 0x77, 0x62, 0xaf, 0xb2, 0x9e, 0x59, 0xed, 0x8e, 0x13, 0x99, 0xbf, 0x00, + 0x6e, 0x95, 0xf8, 0x0f, 0x90, 0x10, 0x12, 0xff, 0x03, 0x77, 0x84, 0x04, 0xea, 0xb1, 0xdc, 0x50, + 0x72, 0xe3, 0xc8, 0x95, 0x0b, 0x9a, 0xdd, 0xd9, 0x8f, 0x24, 0xa5, 0xae, 0x13, 0x2a, 0x6e, 0xfb, + 0xde, 0xbe, 0xdf, 0xef, 0x7d, 0xcc, 0x9b, 0x99, 0xb7, 0x0b, 0x0b, 0x36, 0xa1, 0xfd, 0x5e, 0xcb, + 0xc1, 0x95, 0x36, 0x73, 0x48, 0xa5, 0xc3, 0xf6, 0x89, 0x43, 0x31, 0x6d, 0x93, 0xca, 0xfe, 0x0d, + 0x6c, 0xd9, 0x5d, 0x7c, 0x23, 0xa6, 0x2b, 0xdb, 0x0e, 0xe3, 0x0c, 0x5d, 0x0a, 0x30, 0x65, 0x81, + 0x29, 0xc7, 0xde, 0x07, 0x98, 0xd2, 0x1b, 0x1d, 0xc6, 0x3a, 0x16, 0xa9, 0x78, 0x80, 0x56, 0x7f, + 0xb7, 0x82, 0xe9, 0xc0, 0x47, 0x97, 0xae, 0x1d, 0xf7, 0xd8, 0x76, 0x06, 0x36, 0x67, 0x91, 0x37, + 0x5f, 0x96, 0xb6, 0xf3, 0x27, 0x6c, 0xbb, 0xd8, 0xa4, 0x31, 0x53, 0x21, 0xfa, 0x96, 0xea, 0x0f, + 0x0a, 0xe4, 0x1b, 0x0e, 0xb3, 0x99, 0x8b, 0xad, 0x66, 0xbf, 0xd5, 0x33, 0x39, 0x5a, 0x85, 0xac, + 0x2d, 0x35, 0x45, 0x65, 0x4e, 0x99, 0x9f, 0x58, 0x78, 0xaf, 0x3c, 0x34, 0xf2, 0x72, 0x40, 0xa2, + 0x85, 0x60, 0x74, 0x1f, 0xf2, 0x06, 0xb1, 0x99, 0x6b, 0x72, 0x1d, 0xf7, 0x58, 0x9f, 0xf2, 0xe2, + 0x98, 0x47, 0x77, 0xf5, 0x04, 0x9d, 0x0c, 0x3d, 0xa4, 0x5a, 0xf4, 0x8c, 0xb5, 0x29, 0x09, 0xf6, + 0x45, 0x75, 0x05, 0x0a, 0x81, 0x8f, 0x47, 0x26, 0xef, 0x1a, 0x0e, 0x3e, 0x40, 0xa5, 0x13, 0xa1, + 0xa6, 0x62, 0xde, 0x2f, 0x42, 0xda, 0x21, 0xd8, 0x65, 0xb4, 0x98, 0x9c, 0x53, 0xe6, 0x73, 0x9a, + 0x94, 0xd4, 0xdf, 0x14, 0x98, 0x09, 0x88, 0x96, 0x7c, 0x0f, 0x75, 0x0b, 0x9b, 0xbd, 0x17, 0x92, + 0x9d, 0x4e, 0x25, 0x79, 0xf6, 0x54, 0xd0, 0x7d, 0xc8, 0xb0, 0x3e, 0x6f, 0xb3, 0x1e, 0x91, 0x15, + 0x59, 0x18, 0xa1, 0xc0, 0x9b, 0x3e, 0x52, 0x0b, 0x28, 0xc4, 0x12, 0x4e, 0x6d, 0x63, 0xcb, 0x34, + 0x30, 0x67, 0xce, 0x36, 0xe3, 0x04, 0xad, 0x41, 0xaa, 0xc5, 0x8c, 0x81, 0x5c, 0xbd, 0x0f, 0x5f, + 0x82, 0xfc, 0x18, 0xbe, 0xc6, 0x8c, 0x81, 0xe6, 0x31, 0xa0, 0xfb, 0x90, 0xc5, 0x7d, 0xde, 0xd5, + 0x5d, 0xb3, 0x23, 0x33, 0xbe, 0x31, 0x24, 0xe3, 0xa6, 0x4d, 0xa8, 0xb1, 0xd8, 0xe7, 0xdd, 0xa6, + 0xd9, 0xa1, 0x98, 0xf7, 0x1d, 0xa2, 0x65, 0xb0, 0x2f, 0xaa, 0x4f, 0x92, 0x70, 0xe1, 0x94, 0xa7, + 0x17, 0xd6, 0xfd, 0x0e, 0xa4, 0xf6, 0x19, 0x27, 0xd2, 0xf7, 0xbb, 0x2f, 0x93, 0x09, 0xe3, 0x44, + 0xf3, 0x40, 0xe8, 0x01, 0x4c, 0x9a, 0x06, 0xa1, 0xdc, 0xe4, 0x03, 0x7d, 0x8f, 0x0c, 0x64, 0xad, + 0xaf, 0x0d, 0x49, 0x60, 0x5d, 0x42, 0xee, 0x91, 0x81, 0x36, 0x61, 0x46, 0x02, 0x6a, 0x42, 0x3e, + 0x72, 0xe8, 0x11, 0xa6, 0x3c, 0xc2, 0xf7, 0x87, 0x10, 0xae, 0x86, 0x20, 0x41, 0x39, 0xd5, 0x89, + 0x8b, 0xea, 0x5f, 0x0a, 0x4c, 0x2d, 0x11, 0x8b, 0x74, 0xce, 0xb1, 0x78, 0xc7, 0xf0, 0xaf, 0x6a, + 0xf1, 0xd0, 0x3a, 0x8c, 0xdb, 0x0e, 0x63, 0xbb, 0xb2, 0x8c, 0x37, 0x87, 0x50, 0x3d, 0xbe, 0x77, + 0x2c, 0xac, 0x86, 0x80, 0x6a, 0x3e, 0x83, 0xfa, 0x6b, 0x12, 0x2e, 0x9c, 0x0a, 0xfa, 0x85, 0x7d, + 0x70, 0x15, 0xf2, 0x2e, 0xc7, 0x0e, 0xd7, 0xbd, 0x6d, 0x64, 0xca, 0x4d, 0x9d, 0xd2, 0xa6, 0x3c, + 0x6d, 0x43, 0x2a, 0xc3, 0x76, 0x19, 0x3b, 0x4b, 0xbb, 0x54, 0x61, 0x7c, 0x1f, 0x5b, 0x7d, 0x22, + 0x97, 0xf5, 0xca, 0x90, 0x04, 0xb7, 0x85, 0xad, 0xe6, 0x43, 0xd0, 0x06, 0x4c, 0xf7, 0x69, 0x8b, + 0x51, 0x83, 0x18, 0xc1, 0x01, 0x31, 0x3e, 0xca, 0x01, 0x91, 0x0f, 0xd0, 0xf2, 0x84, 0x78, 0x0b, + 0x72, 0xb4, 0x6f, 0x59, 0xe6, 0xae, 0x49, 0x9c, 0x62, 0x7a, 0x4e, 0x99, 0x9f, 0xd4, 0x22, 0x05, + 0xca, 0x43, 0xd2, 0xd9, 0x2b, 0x66, 0x3c, 0x75, 0xd2, 0xd9, 0x53, 0xff, 0x3e, 0x59, 0xcf, 0x86, + 0x85, 0xe9, 0xff, 0x5e, 0xcf, 0x25, 0x98, 0x70, 0x39, 0xde, 0x23, 0x86, 0x4e, 0x05, 0x87, 0x5f, + 0xd5, 0xcb, 0x43, 0xea, 0xb1, 0x21, 0xf0, 0xe0, 0xe3, 0xc4, 0x33, 0xfa, 0x00, 0x66, 0x62, 0x2c, + 0x51, 0xbc, 0xe3, 0x5e, 0xbc, 0x28, 0xb2, 0x0c, 0x83, 0x7e, 0xce, 0x5a, 0xa4, 0xcf, 0xb3, 0x16, + 0xb3, 0x00, 0x0e, 0xa6, 0x06, 0xeb, 0x99, 0x5f, 0x11, 0x47, 0x56, 0x3d, 0xa6, 0x51, 0xd7, 0x00, + 0x96, 0x30, 0x93, 0x57, 0x49, 0xd4, 0x45, 0xca, 0xc8, 0x5d, 0xa4, 0xae, 0x40, 0x76, 0x09, 0x33, + 0x6f, 0x13, 0x9e, 0x8b, 0xe7, 0x1b, 0x05, 0x72, 0x4b, 0x98, 0x6d, 0xf6, 0xb9, 0xdd, 0x3f, 0x57, + 0x44, 0xe8, 0x2e, 0x64, 0xb0, 0x61, 0x38, 0xc4, 0x75, 0xe5, 0x09, 0xf2, 0xce, 0xb0, 0x1a, 0xfa, + 0xd6, 0x5a, 0x00, 0x53, 0xbf, 0x55, 0x20, 0xe5, 0x9d, 0x6b, 0x77, 0x65, 0x2f, 0x89, 0x28, 0xf2, + 0xa7, 0x0e, 0xcd, 0x7f, 0xeb, 0xa5, 0x58, 0x43, 0xa9, 0xeb, 0x92, 0x69, 0x06, 0x0a, 0xdb, 0x9b, + 0x5b, 0xcb, 0xfa, 0xa7, 0x1b, 0xcd, 0xc6, 0x72, 0x7d, 0x7d, 0x65, 0x7d, 0x79, 0xa9, 0x90, 0x40, + 0x05, 0x98, 0xf4, 0xb4, 0x8b, 0xb5, 0xe6, 0xd6, 0xe2, 0xfa, 0x46, 0x41, 0x41, 0x93, 0x90, 0xf5, + 0x34, 0x9f, 0x2f, 0x37, 0x0b, 0x49, 0x34, 0x01, 0x19, 0x4f, 0xda, 0xd8, 0x2c, 0x8c, 0xa9, 0xcf, + 0x52, 0x30, 0x15, 0x8e, 0x3d, 0x1c, 0x73, 0x82, 0x1e, 0x42, 0x7a, 0x9f, 0x71, 0x93, 0x06, 0x47, + 0xe5, 0xad, 0x11, 0xae, 0x64, 0x8f, 0x41, 0x44, 0x6a, 0xd2, 0xce, 0x5a, 0x42, 0x93, 0x44, 0xe8, + 0x31, 0xe4, 0x0e, 0xe4, 0xa4, 0x42, 0xe5, 0x16, 0xaa, 0x8e, 0xcc, 0x1a, 0xcc, 0x3a, 0x74, 0x2d, + 0xa1, 0x45, 0x74, 0xe8, 0x11, 0x64, 0x77, 0x4d, 0x6a, 0xba, 0x5d, 0x62, 0xc8, 0x9d, 0x75, 0x7b, + 0x64, 0xea, 0x15, 0x49, 0xb0, 0x96, 0xd0, 0x42, 0x32, 0xb4, 0x05, 0x99, 0xb6, 0x18, 0x87, 0x88, + 0x21, 0x4f, 0xb0, 0x8f, 0x47, 0xe6, 0xad, 0xfb, 0xf8, 0xb5, 0x84, 0x16, 0x50, 0x95, 0xb2, 0x90, + 0xf6, 0xcb, 0x53, 0xba, 0x0c, 0xb9, 0x30, 0xa5, 0xd8, 0x8c, 0xa6, 0xc4, 0x67, 0xb4, 0xd2, 0x67, + 0x90, 0x0d, 0x82, 0x8b, 0x0f, 0x4b, 0xca, 0xb9, 0x87, 0xa5, 0xd2, 0x23, 0xc8, 0xc8, 0xf0, 0xfe, + 0x5b, 0xe2, 0x5a, 0x06, 0xc6, 0x5d, 0x91, 0xbd, 0x7a, 0x34, 0x06, 0xd3, 0x27, 0xac, 0x50, 0x13, + 0xd2, 0x36, 0x76, 0x5d, 0x62, 0x48, 0x4f, 0xb7, 0x47, 0xf7, 0x54, 0x6e, 0x78, 0x04, 0xa2, 0xbd, + 0x7c, 0x2a, 0x41, 0xba, 0x8b, 0x4d, 0x8b, 0x18, 0xb2, 0x63, 0xcf, 0x42, 0xba, 0xe2, 0x11, 0x08, + 0x52, 0x9f, 0x0a, 0x6d, 0x43, 0xc6, 0xb5, 0xb0, 0xd7, 0x56, 0xa3, 0x77, 0x6c, 0xc0, 0xda, 0xf4, + 0x19, 0x44, 0x03, 0x48, 0x32, 0xd1, 0x00, 0x7e, 0x02, 0xa5, 0x2f, 0x20, 0xed, 0x7b, 0x45, 0xb7, + 0xe0, 0xf5, 0xb0, 0xa1, 0x75, 0xf1, 0xa4, 0xc7, 0x9b, 0x61, 0x2d, 0xa1, 0xbd, 0x16, 0xbe, 0x16, + 0x2d, 0xa3, 0x79, 0x2f, 0xbf, 0x56, 0x94, 0x5a, 0x11, 0x2e, 0xea, 0xcf, 0x45, 0x96, 0x76, 0x20, + 0x23, 0x9d, 0xbf, 0x02, 0xf6, 0x5a, 0x2e, 0xec, 0x18, 0xb5, 0x0e, 0xe3, 0x5b, 0xd8, 0xb2, 0x06, + 0xa8, 0x00, 0x63, 0x03, 0xe2, 0xca, 0x0b, 0x56, 0x3c, 0x8a, 0xdb, 0x99, 0x32, 0x79, 0x9f, 0x26, + 0x29, 0x43, 0x45, 0xc8, 0xe0, 0x96, 0xcb, 0xb1, 0xe9, 0x1f, 0x02, 0x29, 0x2d, 0x10, 0xd5, 0xef, + 0xd3, 0x90, 0x0d, 0x6a, 0x27, 0x60, 0xa6, 0xbf, 0x97, 0x53, 0x5a, 0xd2, 0x34, 0xd0, 0x0c, 0x8c, + 0x73, 0x93, 0x5b, 0x44, 0x6e, 0x0d, 0x5f, 0x40, 0x73, 0x30, 0x61, 0x10, 0xb7, 0xed, 0x98, 0x76, + 0x78, 0x6b, 0xe7, 0xb4, 0xb8, 0x0a, 0x35, 0x21, 0xe7, 0x8a, 0xe9, 0xcd, 0x12, 0x67, 0x99, 0xbf, + 0x85, 0x3f, 0x1a, 0x61, 0x0d, 0xcb, 0xcd, 0x00, 0xac, 0x45, 0x3c, 0x82, 0x94, 0xf4, 0x88, 0xd3, + 0x21, 0xb4, 0x3d, 0x90, 0xb7, 0xe9, 0x48, 0xa4, 0xcb, 0x01, 0x58, 0x8b, 0x78, 0xd0, 0x2e, 0x14, + 0x6c, 0xec, 0xe0, 0x1e, 0xe1, 0xc4, 0xd1, 0xdb, 0x5d, 0x4c, 0x3b, 0xc4, 0xbb, 0x5e, 0x27, 0x16, + 0xee, 0x8c, 0xc2, 0xdd, 0x08, 0x38, 0xea, 0x1e, 0x85, 0x36, 0x6d, 0x1f, 0x57, 0xa0, 0x87, 0x90, + 0x33, 0x30, 0xd3, 0x5d, 0x71, 0xaf, 0x16, 0xb3, 0x2f, 0x3d, 0x56, 0x87, 0x0e, 0x82, 0x3b, 0x59, + 0xcb, 0x1a, 0xf2, 0xa9, 0x74, 0x13, 0x72, 0x61, 0x9d, 0xd0, 0x9b, 0x90, 0x6e, 0xb3, 0x5e, 0xcf, + 0xe4, 0x61, 0x6b, 0x49, 0x59, 0x74, 0x53, 0x0e, 0x32, 0xba, 0x2f, 0x95, 0xae, 0x41, 0x2e, 0xac, + 0x03, 0x7a, 0x1b, 0xa0, 0x8b, 0x2d, 0xae, 0x7b, 0x1f, 0xe3, 0x1e, 0x30, 0xab, 0xe5, 0x84, 0xa6, + 0x2e, 0x14, 0xa5, 0x9f, 0x14, 0x98, 0x3e, 0x91, 0x18, 0xda, 0x82, 0x3c, 0xb3, 0x0c, 0x3d, 0x4c, + 0xcf, 0x95, 0xa7, 0xc9, 0xf5, 0x93, 0x77, 0xb2, 0xf7, 0x7d, 0x1f, 0xe6, 0xe1, 0x11, 0x86, 0x5c, + 0xae, 0x36, 0xc5, 0x2c, 0x23, 0x12, 0x05, 0x2b, 0x25, 0x07, 0x71, 0xd6, 0xe4, 0x99, 0x58, 0x29, + 0x39, 0x88, 0xc4, 0xd2, 0xbd, 0xd8, 0x28, 0xf3, 0x09, 0x14, 0xb8, 0x83, 0xa9, 0x8b, 0xdb, 0xa2, + 0x41, 0x75, 0xdb, 0xc2, 0x54, 0xfa, 0x98, 0x29, 0xfb, 0xff, 0x3b, 0xca, 0xc1, 0xff, 0x8e, 0xf2, + 0x22, 0x1d, 0x68, 0xd3, 0x31, 0x6b, 0x31, 0xc9, 0xd6, 0x7e, 0x4f, 0xfe, 0x7c, 0x38, 0xab, 0x3c, + 0x3d, 0x9c, 0x55, 0xfe, 0x38, 0x9c, 0x55, 0x9e, 0x1c, 0xcd, 0x26, 0x9e, 0x1e, 0xcd, 0x26, 0x9e, + 0x1d, 0xcd, 0x26, 0xe0, 0x6a, 0x9b, 0xf5, 0x86, 0xaf, 0x65, 0x6d, 0x3a, 0xfa, 0x08, 0x6b, 0x08, + 0x57, 0x0d, 0xe5, 0xf1, 0x97, 0x1d, 0x93, 0x77, 0xfb, 0xad, 0x72, 0x9b, 0xf5, 0x2a, 0x6d, 0xe6, + 0xf6, 0x98, 0x5b, 0x71, 0x88, 0x85, 0x07, 0xc4, 0xa9, 0xec, 0x2f, 0x84, 0x8f, 0x5e, 0xd6, 0x6e, + 0x65, 0xe8, 0xdf, 0x9e, 0x3b, 0x91, 0x2e, 0x50, 0x7d, 0x97, 0x1c, 0x6b, 0xd4, 0x57, 0x7f, 0x4c, + 0x5e, 0x6a, 0x04, 0xe1, 0xd5, 0x45, 0x78, 0x51, 0x24, 0xe5, 0x6d, 0x69, 0xf9, 0x4b, 0x64, 0xb3, + 0x23, 0x6c, 0x76, 0x22, 0x9b, 0x9d, 0xc0, 0xe6, 0x30, 0x79, 0x7d, 0xa8, 0xcd, 0xce, 0x6a, 0xa3, + 0xf6, 0x80, 0x70, 0x6c, 0x60, 0x8e, 0xff, 0x4c, 0x5e, 0x09, 0xec, 0xab, 0x55, 0x01, 0xa8, 0x56, + 0x23, 0x44, 0xb5, 0x1a, 0x40, 0x5a, 0x69, 0xaf, 0xf4, 0x37, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, + 0x57, 0x45, 0x3e, 0x65, 0xd1, 0x12, 0x00, 0x00, +} + +func (m *ProposalSubmit) 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 *ProposalSubmit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProposalSubmit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.DepositAmount != nil { + { + size, err := m.DepositAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Proposal != nil { + { + size, err := m.Proposal.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ProposalWithdraw) 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 *ProposalWithdraw) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProposalWithdraw) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Reason) > 0 { + i -= len(m.Reason) + copy(dAtA[i:], m.Reason) + i = encodeVarintGovernance(dAtA, i, uint64(len(m.Reason))) + i-- + dAtA[i] = 0x12 + } + if m.Proposal != 0 { + i = encodeVarintGovernance(dAtA, i, uint64(m.Proposal)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ProposalDepositClaim) 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 *ProposalDepositClaim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProposalDepositClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Outcome != nil { + { + size, err := m.Outcome.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.DepositAmount != nil { + { + size, err := m.DepositAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Proposal != 0 { + i = encodeVarintGovernance(dAtA, i, uint64(m.Proposal)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ValidatorVote) 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 *ValidatorVote) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AuthSig != nil { + { + size, err := m.AuthSig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Body != nil { + { + size, err := m.Body.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ValidatorVoteBody) 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 *ValidatorVoteBody) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorVoteBody) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.GovernanceKey != nil { + { + size, err := m.GovernanceKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.IdentityKey != nil { + { + size, err := m.IdentityKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Vote != nil { + { + size, err := m.Vote.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Proposal != 0 { + i = encodeVarintGovernance(dAtA, i, uint64(m.Proposal)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DelegatorVote) 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 *DelegatorVote) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DelegatorVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Proof != nil { + { + size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.AuthSig != nil { + { + size, err := m.AuthSig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Body != nil { + { + size, err := m.Body.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DelegatorVoteBody) 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 *DelegatorVoteBody) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DelegatorVoteBody) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Rk) > 0 { + i -= len(m.Rk) + copy(dAtA[i:], m.Rk) + i = encodeVarintGovernance(dAtA, i, uint64(len(m.Rk))) + i-- + dAtA[i] = 0x3a + } + if len(m.Nullifier) > 0 { + i -= len(m.Nullifier) + copy(dAtA[i:], m.Nullifier) + i = encodeVarintGovernance(dAtA, i, uint64(len(m.Nullifier))) + i-- + dAtA[i] = 0x32 + } + if m.UnbondedAmount != nil { + { + size, err := m.UnbondedAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Value != nil { + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Vote != nil { + { + size, err := m.Vote.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.StartPosition != 0 { + i = encodeVarintGovernance(dAtA, i, uint64(m.StartPosition)) + i-- + dAtA[i] = 0x10 + } + if m.Proposal != 0 { + i = encodeVarintGovernance(dAtA, i, uint64(m.Proposal)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DelegatorVotePlan) 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 *DelegatorVotePlan) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DelegatorVotePlan) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Randomizer) > 0 { + i -= len(m.Randomizer) + copy(dAtA[i:], m.Randomizer) + i = encodeVarintGovernance(dAtA, i, uint64(len(m.Randomizer))) + i-- + dAtA[i] = 0x3a + } + if m.UnbondedAmount != nil { + { + size, err := m.UnbondedAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.StakedNotePosition != 0 { + i = encodeVarintGovernance(dAtA, i, uint64(m.StakedNotePosition)) + i-- + dAtA[i] = 0x28 + } + if m.StakedNote != nil { + { + size, err := m.StakedNote.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Vote != nil { + { + size, err := m.Vote.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.StartPosition != 0 { + i = encodeVarintGovernance(dAtA, i, uint64(m.StartPosition)) + i-- + dAtA[i] = 0x10 + } + if m.Proposal != 0 { + i = encodeVarintGovernance(dAtA, i, uint64(m.Proposal)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DaoDeposit) 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 *DaoDeposit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DaoDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Value != nil { + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DaoSpend) 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 *DaoSpend) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DaoSpend) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Value != nil { + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DaoOutput) 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 *DaoOutput) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DaoOutput) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Address != nil { + { + size, err := m.Address.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Value != nil { + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Vote) 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 *Vote) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Vote != 0 { + i = encodeVarintGovernance(dAtA, i, uint64(m.Vote)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ProposalState) 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 *ProposalState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProposalState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.State != nil { + { + size := m.State.Size() + i -= size + if _, err := m.State.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *ProposalState_Voting_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProposalState_Voting_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Voting != nil { + { + size, err := m.Voting.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *ProposalState_Withdrawn_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProposalState_Withdrawn_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Withdrawn != nil { + { + size, err := m.Withdrawn.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *ProposalState_Finished_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProposalState_Finished_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Finished != nil { + { + size, err := m.Finished.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *ProposalState_Claimed_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProposalState_Claimed_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Claimed != nil { + { + size, err := m.Claimed.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} +func (m *ProposalState_Voting) 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 *ProposalState_Voting) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProposalState_Voting) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *ProposalState_Withdrawn) 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 *ProposalState_Withdrawn) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProposalState_Withdrawn) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Reason) > 0 { + i -= len(m.Reason) + copy(dAtA[i:], m.Reason) + i = encodeVarintGovernance(dAtA, i, uint64(len(m.Reason))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ProposalState_Finished) 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 *ProposalState_Finished) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProposalState_Finished) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Outcome != nil { + { + size, err := m.Outcome.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ProposalState_Claimed) 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 *ProposalState_Claimed) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProposalState_Claimed) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Outcome != nil { + { + size, err := m.Outcome.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ProposalOutcome) 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 *ProposalOutcome) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProposalOutcome) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Outcome != nil { + { + size := m.Outcome.Size() + i -= size + if _, err := m.Outcome.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *ProposalOutcome_Passed_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProposalOutcome_Passed_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Passed != nil { + { + size, err := m.Passed.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *ProposalOutcome_Failed_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProposalOutcome_Failed_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Failed != nil { + { + size, err := m.Failed.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *ProposalOutcome_Slashed_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProposalOutcome_Slashed_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Slashed != nil { + { + size, err := m.Slashed.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *ProposalOutcome_Passed) 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 *ProposalOutcome_Passed) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProposalOutcome_Passed) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *ProposalOutcome_Failed) 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 *ProposalOutcome_Failed) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProposalOutcome_Failed) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XWithdrawnWithReason != nil { + { + size := m.XWithdrawnWithReason.Size() + i -= size + if _, err := m.XWithdrawnWithReason.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *ProposalOutcome_Failed_WithdrawnWithReason) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProposalOutcome_Failed_WithdrawnWithReason) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.WithdrawnWithReason) + copy(dAtA[i:], m.WithdrawnWithReason) + i = encodeVarintGovernance(dAtA, i, uint64(len(m.WithdrawnWithReason))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} +func (m *ProposalOutcome_Slashed) 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 *ProposalOutcome_Slashed) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProposalOutcome_Slashed) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XWithdrawnWithReason != nil { + { + size := m.XWithdrawnWithReason.Size() + i -= size + if _, err := m.XWithdrawnWithReason.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *ProposalOutcome_Slashed_WithdrawnWithReason) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProposalOutcome_Slashed_WithdrawnWithReason) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.WithdrawnWithReason) + copy(dAtA[i:], m.WithdrawnWithReason) + i = encodeVarintGovernance(dAtA, i, uint64(len(m.WithdrawnWithReason))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} +func (m *Tally) 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 *Tally) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Tally) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Abstain != 0 { + i = encodeVarintGovernance(dAtA, i, uint64(m.Abstain)) + i-- + dAtA[i] = 0x18 + } + if m.No != 0 { + i = encodeVarintGovernance(dAtA, i, uint64(m.No)) + i-- + dAtA[i] = 0x10 + } + if m.Yes != 0 { + i = encodeVarintGovernance(dAtA, i, uint64(m.Yes)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Proposal) 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 *Proposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.DaoSpend != nil { + { + size, err := m.DaoSpend.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.ParameterChange != nil { + { + size, err := m.ParameterChange.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.Emergency != nil { + { + size, err := m.Emergency.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.Signaling != nil { + { + size, err := m.Signaling.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Id != 0 { + i = encodeVarintGovernance(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x20 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintGovernance(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintGovernance(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Proposal_Signaling) 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 *Proposal_Signaling) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Proposal_Signaling) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XCommit != nil { + { + size := m.XCommit.Size() + i -= size + if _, err := m.XCommit.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *Proposal_Signaling_Commit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Proposal_Signaling_Commit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Commit) + copy(dAtA[i:], m.Commit) + i = encodeVarintGovernance(dAtA, i, uint64(len(m.Commit))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} +func (m *Proposal_Emergency) 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 *Proposal_Emergency) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Proposal_Emergency) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.HaltChain { + i-- + if m.HaltChain { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Proposal_ParameterChange) 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 *Proposal_ParameterChange) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Proposal_ParameterChange) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NewParameters != nil { + { + size, err := m.NewParameters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.OldParameters != nil { + { + size, err := m.OldParameters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Proposal_DaoSpend) 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 *Proposal_DaoSpend) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Proposal_DaoSpend) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TransactionPlan != nil { + { + size, err := m.TransactionPlan.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGovernance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} + +func encodeVarintGovernance(dAtA []byte, offset int, v uint64) int { + offset -= sovGovernance(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ProposalSubmit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Proposal != nil { + l = m.Proposal.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + if m.DepositAmount != nil { + l = m.DepositAmount.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + return n +} + +func (m *ProposalWithdraw) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Proposal != 0 { + n += 1 + sovGovernance(uint64(m.Proposal)) + } + l = len(m.Reason) + if l > 0 { + n += 1 + l + sovGovernance(uint64(l)) + } + return n +} + +func (m *ProposalDepositClaim) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Proposal != 0 { + n += 1 + sovGovernance(uint64(m.Proposal)) + } + if m.DepositAmount != nil { + l = m.DepositAmount.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + if m.Outcome != nil { + l = m.Outcome.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + return n +} + +func (m *ValidatorVote) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Body != nil { + l = m.Body.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + if m.AuthSig != nil { + l = m.AuthSig.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + return n +} + +func (m *ValidatorVoteBody) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Proposal != 0 { + n += 1 + sovGovernance(uint64(m.Proposal)) + } + if m.Vote != nil { + l = m.Vote.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + if m.IdentityKey != nil { + l = m.IdentityKey.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + if m.GovernanceKey != nil { + l = m.GovernanceKey.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + return n +} + +func (m *DelegatorVote) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Body != nil { + l = m.Body.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + if m.AuthSig != nil { + l = m.AuthSig.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + if m.Proof != nil { + l = m.Proof.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + return n +} + +func (m *DelegatorVoteBody) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Proposal != 0 { + n += 1 + sovGovernance(uint64(m.Proposal)) + } + if m.StartPosition != 0 { + n += 1 + sovGovernance(uint64(m.StartPosition)) + } + if m.Vote != nil { + l = m.Vote.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + if m.Value != nil { + l = m.Value.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + if m.UnbondedAmount != nil { + l = m.UnbondedAmount.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + l = len(m.Nullifier) + if l > 0 { + n += 1 + l + sovGovernance(uint64(l)) + } + l = len(m.Rk) + if l > 0 { + n += 1 + l + sovGovernance(uint64(l)) + } + return n +} + +func (m *DelegatorVotePlan) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Proposal != 0 { + n += 1 + sovGovernance(uint64(m.Proposal)) + } + if m.StartPosition != 0 { + n += 1 + sovGovernance(uint64(m.StartPosition)) + } + if m.Vote != nil { + l = m.Vote.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + if m.StakedNote != nil { + l = m.StakedNote.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + if m.StakedNotePosition != 0 { + n += 1 + sovGovernance(uint64(m.StakedNotePosition)) + } + if m.UnbondedAmount != nil { + l = m.UnbondedAmount.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + l = len(m.Randomizer) + if l > 0 { + n += 1 + l + sovGovernance(uint64(l)) + } + return n +} + +func (m *DaoDeposit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != nil { + l = m.Value.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + return n +} + +func (m *DaoSpend) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != nil { + l = m.Value.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + return n +} + +func (m *DaoOutput) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != nil { + l = m.Value.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + if m.Address != nil { + l = m.Address.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + return n +} + +func (m *Vote) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Vote != 0 { + n += 1 + sovGovernance(uint64(m.Vote)) + } + return n +} + +func (m *ProposalState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.State != nil { + n += m.State.Size() + } + return n +} + +func (m *ProposalState_Voting_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Voting != nil { + l = m.Voting.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + return n +} +func (m *ProposalState_Withdrawn_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Withdrawn != nil { + l = m.Withdrawn.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + return n +} +func (m *ProposalState_Finished_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Finished != nil { + l = m.Finished.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + return n +} +func (m *ProposalState_Claimed_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Claimed != nil { + l = m.Claimed.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + return n +} +func (m *ProposalState_Voting) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *ProposalState_Withdrawn) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Reason) + if l > 0 { + n += 1 + l + sovGovernance(uint64(l)) + } + return n +} + +func (m *ProposalState_Finished) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Outcome != nil { + l = m.Outcome.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + return n +} + +func (m *ProposalState_Claimed) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Outcome != nil { + l = m.Outcome.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + return n +} + +func (m *ProposalOutcome) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Outcome != nil { + n += m.Outcome.Size() + } + return n +} + +func (m *ProposalOutcome_Passed_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Passed != nil { + l = m.Passed.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + return n +} +func (m *ProposalOutcome_Failed_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Failed != nil { + l = m.Failed.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + return n +} +func (m *ProposalOutcome_Slashed_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Slashed != nil { + l = m.Slashed.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + return n +} +func (m *ProposalOutcome_Passed) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *ProposalOutcome_Failed) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XWithdrawnWithReason != nil { + n += m.XWithdrawnWithReason.Size() + } + return n +} + +func (m *ProposalOutcome_Failed_WithdrawnWithReason) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.WithdrawnWithReason) + n += 1 + l + sovGovernance(uint64(l)) + return n +} +func (m *ProposalOutcome_Slashed) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XWithdrawnWithReason != nil { + n += m.XWithdrawnWithReason.Size() + } + return n +} + +func (m *ProposalOutcome_Slashed_WithdrawnWithReason) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.WithdrawnWithReason) + n += 1 + l + sovGovernance(uint64(l)) + return n +} +func (m *Tally) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Yes != 0 { + n += 1 + sovGovernance(uint64(m.Yes)) + } + if m.No != 0 { + n += 1 + sovGovernance(uint64(m.No)) + } + if m.Abstain != 0 { + n += 1 + sovGovernance(uint64(m.Abstain)) + } + return n +} + +func (m *Proposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovGovernance(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovGovernance(uint64(l)) + } + if m.Id != 0 { + n += 1 + sovGovernance(uint64(m.Id)) + } + if m.Signaling != nil { + l = m.Signaling.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + if m.Emergency != nil { + l = m.Emergency.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + if m.ParameterChange != nil { + l = m.ParameterChange.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + if m.DaoSpend != nil { + l = m.DaoSpend.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + return n +} + +func (m *Proposal_Signaling) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XCommit != nil { + n += m.XCommit.Size() + } + return n +} + +func (m *Proposal_Signaling_Commit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Commit) + n += 1 + l + sovGovernance(uint64(l)) + return n +} +func (m *Proposal_Emergency) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.HaltChain { + n += 2 + } + return n +} + +func (m *Proposal_ParameterChange) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.OldParameters != nil { + l = m.OldParameters.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + if m.NewParameters != nil { + l = m.NewParameters.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + return n +} + +func (m *Proposal_DaoSpend) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TransactionPlan != nil { + l = m.TransactionPlan.Size() + n += 1 + l + sovGovernance(uint64(l)) + } + return n +} + +func sovGovernance(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGovernance(x uint64) (n int) { + return sovGovernance(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ProposalSubmit) 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 ErrIntOverflowGovernance + } + 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: ProposalSubmit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProposalSubmit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Proposal == nil { + m.Proposal = &Proposal{} + } + if err := m.Proposal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DepositAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DepositAmount == nil { + m.DepositAmount = &v1alpha1.Amount{} + } + if err := m.DepositAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProposalWithdraw) 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 ErrIntOverflowGovernance + } + 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: ProposalWithdraw: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProposalWithdraw: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) + } + m.Proposal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Proposal |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + 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 ErrInvalidLengthGovernance + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProposalDepositClaim) 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 ErrIntOverflowGovernance + } + 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: ProposalDepositClaim: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProposalDepositClaim: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) + } + m.Proposal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Proposal |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DepositAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DepositAmount == nil { + m.DepositAmount = &v1alpha1.Amount{} + } + if err := m.DepositAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Outcome", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Outcome == nil { + m.Outcome = &ProposalOutcome{} + } + if err := m.Outcome.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatorVote) 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 ErrIntOverflowGovernance + } + 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: ValidatorVote: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorVote: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Body", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Body == nil { + m.Body = &ValidatorVoteBody{} + } + if err := m.Body.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthSig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuthSig == nil { + m.AuthSig = &v1alpha1.SpendAuthSignature{} + } + if err := m.AuthSig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatorVoteBody) 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 ErrIntOverflowGovernance + } + 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: ValidatorVoteBody: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorVoteBody: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) + } + m.Proposal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Proposal |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Vote == nil { + m.Vote = &Vote{} + } + if err := m.Vote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IdentityKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.IdentityKey == nil { + m.IdentityKey = &v1alpha1.IdentityKey{} + } + if err := m.IdentityKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GovernanceKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.GovernanceKey == nil { + m.GovernanceKey = &v1alpha1.GovernanceKey{} + } + if err := m.GovernanceKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DelegatorVote) 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 ErrIntOverflowGovernance + } + 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: DelegatorVote: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DelegatorVote: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Body", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Body == nil { + m.Body = &DelegatorVoteBody{} + } + if err := m.Body.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthSig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuthSig == nil { + m.AuthSig = &v1alpha1.SpendAuthSignature{} + } + if err := m.AuthSig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Proof == nil { + m.Proof = &v1alpha1.ZKDelegatorVoteProof{} + } + if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DelegatorVoteBody) 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 ErrIntOverflowGovernance + } + 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: DelegatorVoteBody: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DelegatorVoteBody: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) + } + m.Proposal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Proposal |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartPosition", wireType) + } + m.StartPosition = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartPosition |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Vote == nil { + m.Vote = &Vote{} + } + if err := m.Vote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Value == nil { + m.Value = &v1alpha1.Value{} + } + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondedAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.UnbondedAmount == nil { + m.UnbondedAmount = &v1alpha1.Amount{} + } + if err := m.UnbondedAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nullifier", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Nullifier = append(m.Nullifier[:0], dAtA[iNdEx:postIndex]...) + if m.Nullifier == nil { + m.Nullifier = []byte{} + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rk", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rk = append(m.Rk[:0], dAtA[iNdEx:postIndex]...) + if m.Rk == nil { + m.Rk = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DelegatorVotePlan) 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 ErrIntOverflowGovernance + } + 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: DelegatorVotePlan: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DelegatorVotePlan: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) + } + m.Proposal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Proposal |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartPosition", wireType) + } + m.StartPosition = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartPosition |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Vote == nil { + m.Vote = &Vote{} + } + if err := m.Vote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StakedNote", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.StakedNote == nil { + m.StakedNote = &v1alpha1.Note{} + } + if err := m.StakedNote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StakedNotePosition", wireType) + } + m.StakedNotePosition = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StakedNotePosition |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondedAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.UnbondedAmount == nil { + m.UnbondedAmount = &v1alpha1.Amount{} + } + if err := m.UnbondedAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Randomizer", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Randomizer = append(m.Randomizer[:0], dAtA[iNdEx:postIndex]...) + if m.Randomizer == nil { + m.Randomizer = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DaoDeposit) 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 ErrIntOverflowGovernance + } + 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: DaoDeposit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DaoDeposit: 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 msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Value == nil { + m.Value = &v1alpha1.Value{} + } + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DaoSpend) 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 ErrIntOverflowGovernance + } + 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: DaoSpend: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DaoSpend: 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 msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Value == nil { + m.Value = &v1alpha1.Value{} + } + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DaoOutput) 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 ErrIntOverflowGovernance + } + 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: DaoOutput: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DaoOutput: 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 msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Value == nil { + m.Value = &v1alpha1.Value{} + } + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Address == nil { + m.Address = &v1alpha1.Address{} + } + if err := m.Address.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Vote) 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 ErrIntOverflowGovernance + } + 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: Vote: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Vote: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType) + } + m.Vote = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Vote |= Vote_Vote(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProposalState) 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 ErrIntOverflowGovernance + } + 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: ProposalState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProposalState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Voting", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &ProposalState_Voting{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.State = &ProposalState_Voting_{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Withdrawn", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &ProposalState_Withdrawn{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.State = &ProposalState_Withdrawn_{v} + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Finished", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &ProposalState_Finished{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.State = &ProposalState_Finished_{v} + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Claimed", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &ProposalState_Claimed{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.State = &ProposalState_Claimed_{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProposalState_Voting) 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 ErrIntOverflowGovernance + } + 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: Voting: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Voting: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProposalState_Withdrawn) 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 ErrIntOverflowGovernance + } + 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: Withdrawn: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Withdrawn: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + 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 ErrInvalidLengthGovernance + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProposalState_Finished) 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 ErrIntOverflowGovernance + } + 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: Finished: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Finished: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Outcome", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Outcome == nil { + m.Outcome = &ProposalOutcome{} + } + if err := m.Outcome.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProposalState_Claimed) 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 ErrIntOverflowGovernance + } + 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: Claimed: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Claimed: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Outcome", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Outcome == nil { + m.Outcome = &ProposalOutcome{} + } + if err := m.Outcome.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProposalOutcome) 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 ErrIntOverflowGovernance + } + 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: ProposalOutcome: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProposalOutcome: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Passed", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &ProposalOutcome_Passed{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Outcome = &ProposalOutcome_Passed_{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Failed", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &ProposalOutcome_Failed{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Outcome = &ProposalOutcome_Failed_{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Slashed", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &ProposalOutcome_Slashed{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Outcome = &ProposalOutcome_Slashed_{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProposalOutcome_Passed) 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 ErrIntOverflowGovernance + } + 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: Passed: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Passed: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProposalOutcome_Failed) 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 ErrIntOverflowGovernance + } + 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: Failed: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Failed: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WithdrawnWithReason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + 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 ErrInvalidLengthGovernance + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.XWithdrawnWithReason = &ProposalOutcome_Failed_WithdrawnWithReason{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProposalOutcome_Slashed) 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 ErrIntOverflowGovernance + } + 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: Slashed: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Slashed: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WithdrawnWithReason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + 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 ErrInvalidLengthGovernance + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.XWithdrawnWithReason = &ProposalOutcome_Slashed_WithdrawnWithReason{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Tally) 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 ErrIntOverflowGovernance + } + 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: Tally: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Tally: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Yes", wireType) + } + m.Yes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Yes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field No", wireType) + } + m.No = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.No |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Abstain", wireType) + } + m.Abstain = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Abstain |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Proposal) 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 ErrIntOverflowGovernance + } + 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: Proposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Proposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + 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 ErrInvalidLengthGovernance + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + 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 ErrInvalidLengthGovernance + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signaling", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Signaling == nil { + m.Signaling = &Proposal_Signaling{} + } + if err := m.Signaling.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Emergency", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Emergency == nil { + m.Emergency = &Proposal_Emergency{} + } + if err := m.Emergency.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParameterChange", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ParameterChange == nil { + m.ParameterChange = &Proposal_ParameterChange{} + } + if err := m.ParameterChange.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DaoSpend", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DaoSpend == nil { + m.DaoSpend = &Proposal_DaoSpend{} + } + if err := m.DaoSpend.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Proposal_Signaling) 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 ErrIntOverflowGovernance + } + 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: Signaling: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Signaling: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + 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 ErrInvalidLengthGovernance + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.XCommit = &Proposal_Signaling_Commit{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Proposal_Emergency) 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 ErrIntOverflowGovernance + } + 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: Emergency: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Emergency: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HaltChain", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.HaltChain = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Proposal_ParameterChange) 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 ErrIntOverflowGovernance + } + 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: ParameterChange: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ParameterChange: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OldParameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.OldParameters == nil { + m.OldParameters = &v1alpha11.ChainParameters{} + } + if err := m.OldParameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewParameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NewParameters == nil { + m.NewParameters = &v1alpha11.ChainParameters{} + } + if err := m.NewParameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Proposal_DaoSpend) 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 ErrIntOverflowGovernance + } + 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: DaoSpend: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DaoSpend: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TransactionPlan", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGovernance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGovernance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGovernance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TransactionPlan == nil { + m.TransactionPlan = &types.Any{} + } + if err := m.TransactionPlan.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGovernance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGovernance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGovernance(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, ErrIntOverflowGovernance + } + 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, ErrIntOverflowGovernance + } + 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, ErrIntOverflowGovernance + } + 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, ErrInvalidLengthGovernance + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGovernance + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGovernance + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGovernance = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGovernance = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGovernance = fmt.Errorf("proto: unexpected end of group") +) diff --git a/relayer/chains/penumbra/core/ibc/v1alpha1/ibc.pb.go b/relayer/chains/penumbra/core/ibc/v1alpha1/ibc.pb.go new file mode 100644 index 000000000..9f95c7e73 --- /dev/null +++ b/relayer/chains/penumbra/core/ibc/v1alpha1/ibc.pb.go @@ -0,0 +1,2465 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: penumbra/core/ibc/v1alpha1/ibc.proto + +package ibcv1alpha1 + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" + proto "github.com/cosmos/gogoproto/proto" + types1 "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + v1alpha1 "github.com/cosmos/relayer/v2/relayer/chains/penumbra/core/crypto/v1alpha1" + 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 IbcAction struct { + // + // oneof action { + // .ibc.core.connection.v1.MsgConnectionOpenInit connection_open_init = 1; + // .ibc.core.connection.v1.MsgConnectionOpenTry connection_open_try = 2; + // .ibc.core.connection.v1.MsgConnectionOpenAck connection_open_ack = 3; + // .ibc.core.connection.v1.MsgConnectionOpenConfirm connection_open_confirm = 4; + // + // .ibc.core.channel.v1.MsgChannelOpenInit channel_open_init = 5; + // .ibc.core.channel.v1.MsgChannelOpenTry channel_open_try = 6; + // .ibc.core.channel.v1.MsgChannelOpenAck channel_open_ack = 7; + // .ibc.core.channel.v1.MsgChannelOpenConfirm channel_open_confirm = 8; + // .ibc.core.channel.v1.MsgChannelCloseInit channel_close_init = 9; + // .ibc.core.channel.v1.MsgChannelCloseConfirm channel_close_confirm = 10; + // + // .ibc.core.channel.v1.MsgRecvPacket recv_packet = 11; + // .ibc.core.channel.v1.MsgTimeout timeout = 12; + // .ibc.core.channel.v1.MsgAcknowledgement acknowledgement = 13; + // + // .ibc.core.client.v1.MsgCreateClient create_client = 14; + // .ibc.core.client.v1.MsgUpdateClient update_client = 15; + // .ibc.core.client.v1.MsgUpgradeClient upgrade_client = 16; + // .ibc.core.client.v1.MsgSubmitMisbehaviour submit_misbehaviour = 17; + // } + RawAction *types.Any `protobuf:"bytes,1,opt,name=raw_action,json=rawAction,proto3" json:"raw_action,omitempty"` +} + +func (m *IbcAction) Reset() { *m = IbcAction{} } +func (m *IbcAction) String() string { return proto.CompactTextString(m) } +func (*IbcAction) ProtoMessage() {} +func (*IbcAction) Descriptor() ([]byte, []int) { + return fileDescriptor_6509740287584c65, []int{0} +} +func (m *IbcAction) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IbcAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IbcAction.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 *IbcAction) XXX_Merge(src proto.Message) { + xxx_messageInfo_IbcAction.Merge(m, src) +} +func (m *IbcAction) XXX_Size() int { + return m.Size() +} +func (m *IbcAction) XXX_DiscardUnknown() { + xxx_messageInfo_IbcAction.DiscardUnknown(m) +} + +var xxx_messageInfo_IbcAction proto.InternalMessageInfo + +func (m *IbcAction) GetRawAction() *types.Any { + if m != nil { + return m.RawAction + } + return nil +} + +// FungibleTokenPacketData defines a struct for the packet payload +// See FungibleTokenPacketData spec: +// https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures +type FungibleTokenPacketData struct { + // the token denomination to be transferred + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + // the token amount to be transferred + Amount string `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"` + // the sender address + Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"` + // the recipient address on the destination chain + Receiver string `protobuf:"bytes,4,opt,name=receiver,proto3" json:"receiver,omitempty"` +} + +func (m *FungibleTokenPacketData) Reset() { *m = FungibleTokenPacketData{} } +func (m *FungibleTokenPacketData) String() string { return proto.CompactTextString(m) } +func (*FungibleTokenPacketData) ProtoMessage() {} +func (*FungibleTokenPacketData) Descriptor() ([]byte, []int) { + return fileDescriptor_6509740287584c65, []int{1} +} +func (m *FungibleTokenPacketData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FungibleTokenPacketData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FungibleTokenPacketData.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 *FungibleTokenPacketData) XXX_Merge(src proto.Message) { + xxx_messageInfo_FungibleTokenPacketData.Merge(m, src) +} +func (m *FungibleTokenPacketData) XXX_Size() int { + return m.Size() +} +func (m *FungibleTokenPacketData) XXX_DiscardUnknown() { + xxx_messageInfo_FungibleTokenPacketData.DiscardUnknown(m) +} + +var xxx_messageInfo_FungibleTokenPacketData proto.InternalMessageInfo + +func (m *FungibleTokenPacketData) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *FungibleTokenPacketData) GetAmount() string { + if m != nil { + return m.Amount + } + return "" +} + +func (m *FungibleTokenPacketData) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +func (m *FungibleTokenPacketData) GetReceiver() string { + if m != nil { + return m.Receiver + } + return "" +} + +type Ics20Withdrawal struct { + // the chain ID of the destination chain for this ICS20 transfer + DestinationChainId string `protobuf:"bytes,1,opt,name=destination_chain_id,json=destinationChainId,proto3" json:"destination_chain_id,omitempty"` + Amount *v1alpha1.Amount `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"` + Denom *v1alpha1.Denom `protobuf:"bytes,3,opt,name=denom,proto3" json:"denom,omitempty"` + // the address on the destination chain to send the transfer to + DestinationChainAddress string `protobuf:"bytes,4,opt,name=destination_chain_address,json=destinationChainAddress,proto3" json:"destination_chain_address,omitempty"` + // a "sender" penumbra address to use to return funds from this withdrawal. + // this should be an ephemeral address + ReturnAddress *v1alpha1.Address `protobuf:"bytes,5,opt,name=return_address,json=returnAddress,proto3" json:"return_address,omitempty"` + // the height (on Penumbra) at which this transfer expires (and funds are sent + // back to the sender address?). NOTE: if funds are sent back to the sender, + // we MUST verify a nonexistence proof before accepting the timeout, to + // prevent relayer censorship attacks. The core IBC implementation does this + // in its handling of validation of timeouts. + TimeoutHeight uint64 `protobuf:"varint,6,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height,omitempty"` + // the timestamp at which this transfer expires. + TimeoutTime uint64 `protobuf:"varint,7,opt,name=timeout_time,json=timeoutTime,proto3" json:"timeout_time,omitempty"` + // the source port that identifies the channel used for the withdrawal + SourcePort string `protobuf:"bytes,8,opt,name=source_port,json=sourcePort,proto3" json:"source_port,omitempty"` + // the source channel used for the withdrawal + SourceChannel string `protobuf:"bytes,9,opt,name=source_channel,json=sourceChannel,proto3" json:"source_channel,omitempty"` +} + +func (m *Ics20Withdrawal) Reset() { *m = Ics20Withdrawal{} } +func (m *Ics20Withdrawal) String() string { return proto.CompactTextString(m) } +func (*Ics20Withdrawal) ProtoMessage() {} +func (*Ics20Withdrawal) Descriptor() ([]byte, []int) { + return fileDescriptor_6509740287584c65, []int{2} +} +func (m *Ics20Withdrawal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Ics20Withdrawal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Ics20Withdrawal.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 *Ics20Withdrawal) XXX_Merge(src proto.Message) { + xxx_messageInfo_Ics20Withdrawal.Merge(m, src) +} +func (m *Ics20Withdrawal) XXX_Size() int { + return m.Size() +} +func (m *Ics20Withdrawal) XXX_DiscardUnknown() { + xxx_messageInfo_Ics20Withdrawal.DiscardUnknown(m) +} + +var xxx_messageInfo_Ics20Withdrawal proto.InternalMessageInfo + +func (m *Ics20Withdrawal) GetDestinationChainId() string { + if m != nil { + return m.DestinationChainId + } + return "" +} + +func (m *Ics20Withdrawal) GetAmount() *v1alpha1.Amount { + if m != nil { + return m.Amount + } + return nil +} + +func (m *Ics20Withdrawal) GetDenom() *v1alpha1.Denom { + if m != nil { + return m.Denom + } + return nil +} + +func (m *Ics20Withdrawal) GetDestinationChainAddress() string { + if m != nil { + return m.DestinationChainAddress + } + return "" +} + +func (m *Ics20Withdrawal) GetReturnAddress() *v1alpha1.Address { + if m != nil { + return m.ReturnAddress + } + return nil +} + +func (m *Ics20Withdrawal) GetTimeoutHeight() uint64 { + if m != nil { + return m.TimeoutHeight + } + return 0 +} + +func (m *Ics20Withdrawal) GetTimeoutTime() uint64 { + if m != nil { + return m.TimeoutTime + } + return 0 +} + +func (m *Ics20Withdrawal) GetSourcePort() string { + if m != nil { + return m.SourcePort + } + return "" +} + +func (m *Ics20Withdrawal) GetSourceChannel() string { + if m != nil { + return m.SourceChannel + } + return "" +} + +type ClientData struct { + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + ClientState *types.Any `protobuf:"bytes,2,opt,name=client_state,json=clientState,proto3" json:"client_state,omitempty"` + ProcessedTime string `protobuf:"bytes,3,opt,name=processed_time,json=processedTime,proto3" json:"processed_time,omitempty"` + ProcessedHeight uint64 `protobuf:"varint,4,opt,name=processed_height,json=processedHeight,proto3" json:"processed_height,omitempty"` +} + +func (m *ClientData) Reset() { *m = ClientData{} } +func (m *ClientData) String() string { return proto.CompactTextString(m) } +func (*ClientData) ProtoMessage() {} +func (*ClientData) Descriptor() ([]byte, []int) { + return fileDescriptor_6509740287584c65, []int{3} +} +func (m *ClientData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClientData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ClientData.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 *ClientData) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClientData.Merge(m, src) +} +func (m *ClientData) XXX_Size() int { + return m.Size() +} +func (m *ClientData) XXX_DiscardUnknown() { + xxx_messageInfo_ClientData.DiscardUnknown(m) +} + +var xxx_messageInfo_ClientData proto.InternalMessageInfo + +func (m *ClientData) GetClientId() string { + if m != nil { + return m.ClientId + } + return "" +} + +func (m *ClientData) GetClientState() *types.Any { + if m != nil { + return m.ClientState + } + return nil +} + +func (m *ClientData) GetProcessedTime() string { + if m != nil { + return m.ProcessedTime + } + return "" +} + +func (m *ClientData) GetProcessedHeight() uint64 { + if m != nil { + return m.ProcessedHeight + } + return 0 +} + +type ClientCounter struct { + Counter uint64 `protobuf:"varint,1,opt,name=counter,proto3" json:"counter,omitempty"` +} + +func (m *ClientCounter) Reset() { *m = ClientCounter{} } +func (m *ClientCounter) String() string { return proto.CompactTextString(m) } +func (*ClientCounter) ProtoMessage() {} +func (*ClientCounter) Descriptor() ([]byte, []int) { + return fileDescriptor_6509740287584c65, []int{4} +} +func (m *ClientCounter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClientCounter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ClientCounter.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 *ClientCounter) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClientCounter.Merge(m, src) +} +func (m *ClientCounter) XXX_Size() int { + return m.Size() +} +func (m *ClientCounter) XXX_DiscardUnknown() { + xxx_messageInfo_ClientCounter.DiscardUnknown(m) +} + +var xxx_messageInfo_ClientCounter proto.InternalMessageInfo + +func (m *ClientCounter) GetCounter() uint64 { + if m != nil { + return m.Counter + } + return 0 +} + +type ConsensusState struct { + ConsensusState *types.Any `protobuf:"bytes,1,opt,name=consensus_state,json=consensusState,proto3" json:"consensus_state,omitempty"` +} + +func (m *ConsensusState) Reset() { *m = ConsensusState{} } +func (m *ConsensusState) String() string { return proto.CompactTextString(m) } +func (*ConsensusState) ProtoMessage() {} +func (*ConsensusState) Descriptor() ([]byte, []int) { + return fileDescriptor_6509740287584c65, []int{5} +} +func (m *ConsensusState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConsensusState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConsensusState.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 *ConsensusState) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsensusState.Merge(m, src) +} +func (m *ConsensusState) XXX_Size() int { + return m.Size() +} +func (m *ConsensusState) XXX_DiscardUnknown() { + xxx_messageInfo_ConsensusState.DiscardUnknown(m) +} + +var xxx_messageInfo_ConsensusState proto.InternalMessageInfo + +func (m *ConsensusState) GetConsensusState() *types.Any { + if m != nil { + return m.ConsensusState + } + return nil +} + +type VerifiedHeights struct { + Heights []*types1.Height `protobuf:"bytes,1,rep,name=heights,proto3" json:"heights,omitempty"` +} + +func (m *VerifiedHeights) Reset() { *m = VerifiedHeights{} } +func (m *VerifiedHeights) String() string { return proto.CompactTextString(m) } +func (*VerifiedHeights) ProtoMessage() {} +func (*VerifiedHeights) Descriptor() ([]byte, []int) { + return fileDescriptor_6509740287584c65, []int{6} +} +func (m *VerifiedHeights) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VerifiedHeights) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VerifiedHeights.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 *VerifiedHeights) XXX_Merge(src proto.Message) { + xxx_messageInfo_VerifiedHeights.Merge(m, src) +} +func (m *VerifiedHeights) XXX_Size() int { + return m.Size() +} +func (m *VerifiedHeights) XXX_DiscardUnknown() { + xxx_messageInfo_VerifiedHeights.DiscardUnknown(m) +} + +var xxx_messageInfo_VerifiedHeights proto.InternalMessageInfo + +func (m *VerifiedHeights) GetHeights() []*types1.Height { + if m != nil { + return m.Heights + } + return nil +} + +type ConnectionCounter struct { + Counter uint64 `protobuf:"varint,1,opt,name=counter,proto3" json:"counter,omitempty"` +} + +func (m *ConnectionCounter) Reset() { *m = ConnectionCounter{} } +func (m *ConnectionCounter) String() string { return proto.CompactTextString(m) } +func (*ConnectionCounter) ProtoMessage() {} +func (*ConnectionCounter) Descriptor() ([]byte, []int) { + return fileDescriptor_6509740287584c65, []int{7} +} +func (m *ConnectionCounter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConnectionCounter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConnectionCounter.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 *ConnectionCounter) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConnectionCounter.Merge(m, src) +} +func (m *ConnectionCounter) XXX_Size() int { + return m.Size() +} +func (m *ConnectionCounter) XXX_DiscardUnknown() { + xxx_messageInfo_ConnectionCounter.DiscardUnknown(m) +} + +var xxx_messageInfo_ConnectionCounter proto.InternalMessageInfo + +func (m *ConnectionCounter) GetCounter() uint64 { + if m != nil { + return m.Counter + } + return 0 +} + +type ClientConnections struct { + Connections []string `protobuf:"bytes,1,rep,name=connections,proto3" json:"connections,omitempty"` +} + +func (m *ClientConnections) Reset() { *m = ClientConnections{} } +func (m *ClientConnections) String() string { return proto.CompactTextString(m) } +func (*ClientConnections) ProtoMessage() {} +func (*ClientConnections) Descriptor() ([]byte, []int) { + return fileDescriptor_6509740287584c65, []int{8} +} +func (m *ClientConnections) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClientConnections) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ClientConnections.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 *ClientConnections) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClientConnections.Merge(m, src) +} +func (m *ClientConnections) XXX_Size() int { + return m.Size() +} +func (m *ClientConnections) XXX_DiscardUnknown() { + xxx_messageInfo_ClientConnections.DiscardUnknown(m) +} + +var xxx_messageInfo_ClientConnections proto.InternalMessageInfo + +func (m *ClientConnections) GetConnections() []string { + if m != nil { + return m.Connections + } + return nil +} + +func init() { + proto.RegisterType((*IbcAction)(nil), "penumbra.core.ibc.v1alpha1.IbcAction") + proto.RegisterType((*FungibleTokenPacketData)(nil), "penumbra.core.ibc.v1alpha1.FungibleTokenPacketData") + proto.RegisterType((*Ics20Withdrawal)(nil), "penumbra.core.ibc.v1alpha1.Ics20Withdrawal") + proto.RegisterType((*ClientData)(nil), "penumbra.core.ibc.v1alpha1.ClientData") + proto.RegisterType((*ClientCounter)(nil), "penumbra.core.ibc.v1alpha1.ClientCounter") + proto.RegisterType((*ConsensusState)(nil), "penumbra.core.ibc.v1alpha1.ConsensusState") + proto.RegisterType((*VerifiedHeights)(nil), "penumbra.core.ibc.v1alpha1.VerifiedHeights") + proto.RegisterType((*ConnectionCounter)(nil), "penumbra.core.ibc.v1alpha1.ConnectionCounter") + proto.RegisterType((*ClientConnections)(nil), "penumbra.core.ibc.v1alpha1.ClientConnections") +} + +func init() { + proto.RegisterFile("penumbra/core/ibc/v1alpha1/ibc.proto", fileDescriptor_6509740287584c65) +} + +var fileDescriptor_6509740287584c65 = []byte{ + // 803 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0x41, 0x8f, 0x1b, 0x35, + 0x14, 0xde, 0x49, 0xb6, 0xbb, 0x1b, 0xa7, 0x49, 0xe8, 0x68, 0x45, 0xa7, 0x41, 0xa4, 0x61, 0xd4, + 0x56, 0x5b, 0x24, 0x66, 0x9a, 0x14, 0x84, 0x34, 0xa8, 0x12, 0xd9, 0xa9, 0x28, 0x73, 0xa8, 0x88, + 0x86, 0xaa, 0x48, 0x28, 0x52, 0xe4, 0xf1, 0xb8, 0x89, 0xd5, 0x8c, 0x1d, 0xd9, 0x9e, 0xac, 0x22, + 0xfe, 0x04, 0x7f, 0x01, 0x8e, 0x9c, 0xf9, 0x11, 0x88, 0x53, 0x8f, 0x48, 0x5c, 0x50, 0xf6, 0xc6, + 0xaf, 0x40, 0xb6, 0xc7, 0x49, 0x03, 0x6c, 0xf7, 0x14, 0xbf, 0xef, 0xfb, 0xde, 0xcb, 0xf7, 0x9e, + 0xdf, 0x18, 0xdc, 0x5b, 0x62, 0x5a, 0x16, 0x19, 0x87, 0x21, 0x62, 0x1c, 0x87, 0x24, 0x43, 0xe1, + 0x6a, 0x00, 0x17, 0xcb, 0x39, 0x1c, 0xa8, 0x20, 0x58, 0x72, 0x26, 0x99, 0xdb, 0xb5, 0xaa, 0x40, + 0xa9, 0x02, 0x45, 0x58, 0x55, 0xf7, 0xe3, 0xfd, 0x0a, 0x88, 0xaf, 0x97, 0x92, 0xed, 0x8a, 0x98, + 0xd8, 0xd4, 0xe9, 0xde, 0x55, 0xf5, 0x8d, 0x6c, 0x41, 0x30, 0x95, 0xe1, 0x6a, 0x50, 0x9d, 0x2a, + 0xc1, 0x9d, 0x19, 0x63, 0xb3, 0x05, 0x0e, 0x75, 0x94, 0x95, 0xaf, 0x42, 0x48, 0xd7, 0x86, 0xf2, + 0xbf, 0x04, 0x8d, 0x24, 0x43, 0x23, 0x24, 0x09, 0xa3, 0xee, 0x63, 0x00, 0x38, 0xbc, 0x98, 0x42, + 0x1d, 0x79, 0x4e, 0xdf, 0x39, 0x6b, 0x0e, 0x4f, 0x03, 0x93, 0x1c, 0xd8, 0xe4, 0x60, 0x44, 0xd7, + 0x69, 0x83, 0xc3, 0x0b, 0x93, 0xe4, 0xff, 0x00, 0x6e, 0x7f, 0x55, 0xd2, 0x19, 0xc9, 0x16, 0xf8, + 0x05, 0x7b, 0x8d, 0xe9, 0x18, 0xa2, 0xd7, 0x58, 0x3e, 0x85, 0x12, 0xba, 0xa7, 0xe0, 0x46, 0x8e, + 0x29, 0x2b, 0x74, 0xa9, 0x46, 0x6a, 0x02, 0xf7, 0x7d, 0x70, 0x04, 0x0b, 0x56, 0x52, 0xe9, 0xd5, + 0x34, 0x5c, 0x45, 0x0a, 0x17, 0x98, 0xe6, 0x98, 0x7b, 0x75, 0x83, 0x9b, 0xc8, 0xed, 0x82, 0x13, + 0x8e, 0x11, 0x26, 0x2b, 0xcc, 0xbd, 0x43, 0xcd, 0x6c, 0x63, 0xff, 0xcf, 0x3a, 0xe8, 0x24, 0x48, + 0x0c, 0x1f, 0x7d, 0x47, 0xe4, 0x3c, 0xe7, 0xf0, 0x02, 0x2e, 0xdc, 0x47, 0xe0, 0x34, 0xc7, 0x42, + 0x12, 0x0a, 0x95, 0xbf, 0x29, 0x9a, 0x43, 0x42, 0xa7, 0x24, 0xaf, 0x4c, 0xb8, 0x6f, 0x71, 0xb1, + 0xa2, 0x92, 0xdc, 0x7d, 0xb2, 0xe7, 0xa8, 0x39, 0xbc, 0x1f, 0xec, 0xdf, 0x4c, 0x35, 0x6d, 0x3b, + 0xfd, 0x60, 0xa4, 0xc5, 0x5b, 0xe3, 0x91, 0x6d, 0xb3, 0xae, 0xb3, 0xef, 0x5d, 0x93, 0xfd, 0x54, + 0x69, 0xed, 0x30, 0x22, 0x70, 0xe7, 0xbf, 0x66, 0x61, 0x9e, 0x73, 0x2c, 0x44, 0xd5, 0xed, 0xed, + 0x7f, 0x3b, 0x1e, 0x19, 0xda, 0x7d, 0x0e, 0xda, 0x1c, 0xcb, 0x92, 0xef, 0x12, 0x6e, 0x68, 0x03, + 0x0f, 0xae, 0xb3, 0x6f, 0xd4, 0x69, 0xcb, 0x64, 0xdb, 0x72, 0xf7, 0x41, 0x5b, 0x92, 0x02, 0xb3, + 0x52, 0x4e, 0xe7, 0x98, 0xcc, 0xe6, 0xd2, 0x3b, 0xea, 0x3b, 0x67, 0x87, 0x69, 0xab, 0x42, 0xbf, + 0xd6, 0xa0, 0xfb, 0x11, 0xb8, 0x69, 0x65, 0xea, 0xd7, 0x3b, 0xd6, 0xa2, 0x66, 0x85, 0xbd, 0x20, + 0x05, 0x76, 0xef, 0x82, 0xa6, 0x60, 0x25, 0x47, 0x78, 0xba, 0x64, 0x5c, 0x7a, 0x27, 0xba, 0x0d, + 0x60, 0xa0, 0x31, 0xe3, 0x52, 0xfd, 0x55, 0x25, 0x40, 0x73, 0x48, 0x29, 0x5e, 0x78, 0x0d, 0xad, + 0x69, 0x19, 0x34, 0x36, 0xa0, 0xff, 0xab, 0x03, 0x40, 0xac, 0x17, 0x59, 0xaf, 0xd3, 0x07, 0xa0, + 0x61, 0xd6, 0x7a, 0x77, 0x9b, 0x27, 0x06, 0x48, 0x72, 0xf7, 0x73, 0x70, 0xb3, 0x22, 0x85, 0x84, + 0x12, 0x57, 0x37, 0xf9, 0xff, 0xdb, 0xdb, 0x34, 0xca, 0x6f, 0x95, 0x50, 0x79, 0x59, 0x72, 0x86, + 0xb0, 0x10, 0x38, 0x37, 0x1d, 0x99, 0xf5, 0x6b, 0x6d, 0x51, 0xdd, 0xd3, 0x43, 0xf0, 0xde, 0x4e, + 0x56, 0xcd, 0xe7, 0x50, 0xb7, 0xde, 0xd9, 0xe2, 0x66, 0x42, 0xfe, 0x43, 0xd0, 0x32, 0xae, 0x63, + 0xb5, 0x1e, 0x98, 0xbb, 0x1e, 0x38, 0x46, 0xe6, 0xa8, 0x6d, 0x1f, 0xa6, 0x36, 0xf4, 0xbf, 0x01, + 0xed, 0x98, 0x51, 0x81, 0xa9, 0x28, 0x85, 0xb1, 0xf3, 0x04, 0x74, 0x90, 0x45, 0xaa, 0x56, 0xde, + 0xf5, 0x21, 0xb6, 0xd1, 0x5e, 0xba, 0xff, 0x0c, 0x74, 0x5e, 0x62, 0x4e, 0x5e, 0x11, 0xeb, 0x46, + 0xb8, 0x9f, 0x82, 0x63, 0xe3, 0x57, 0x78, 0x4e, 0xbf, 0x7e, 0xd6, 0x1c, 0x76, 0xf5, 0x53, 0x63, + 0x56, 0xc3, 0x3c, 0x13, 0xab, 0x41, 0x60, 0xd4, 0xa9, 0x95, 0xfa, 0x9f, 0x80, 0x5b, 0x31, 0xa3, + 0x14, 0xeb, 0x8f, 0xfc, 0xfa, 0x46, 0x3e, 0x03, 0xb7, 0x6c, 0xcf, 0x36, 0x49, 0xb8, 0x7d, 0xd0, + 0x44, 0xbb, 0x50, 0xff, 0x7b, 0x23, 0x7d, 0x1b, 0x3a, 0xff, 0xa9, 0xf6, 0xdb, 0xa6, 0xe7, 0xbc, + 0xd9, 0xf4, 0x9c, 0xbf, 0x36, 0x3d, 0xe7, 0xc7, 0xcb, 0xde, 0xc1, 0x9b, 0xcb, 0xde, 0xc1, 0x1f, + 0x97, 0xbd, 0x03, 0xd0, 0x43, 0xac, 0x08, 0xae, 0x7e, 0x21, 0xcf, 0x4f, 0x92, 0x0c, 0x8d, 0xd5, + 0x28, 0xc6, 0xce, 0xf7, 0xe9, 0x8c, 0xc8, 0x79, 0x99, 0x05, 0x88, 0x15, 0x21, 0x62, 0xa2, 0x60, + 0x22, 0xe4, 0x78, 0x01, 0xd7, 0x98, 0x87, 0xab, 0xe1, 0xf6, 0xa8, 0x3f, 0x2e, 0x11, 0x5e, 0xfd, + 0x36, 0x7f, 0x41, 0x32, 0x64, 0xcf, 0x3f, 0xd7, 0xea, 0xe3, 0x38, 0xf9, 0xa5, 0xd6, 0x1d, 0x5b, + 0x0b, 0xb1, 0xb2, 0x90, 0x64, 0x28, 0x78, 0x59, 0x49, 0x7e, 0xdf, 0x91, 0x13, 0x45, 0x4e, 0x92, + 0x0c, 0x4d, 0x2c, 0xb9, 0xa9, 0x3d, 0xb8, 0x9a, 0x9c, 0x3c, 0x1b, 0x9f, 0x3f, 0xc7, 0x12, 0xe6, + 0x50, 0xc2, 0xbf, 0x6b, 0x1f, 0x5a, 0x61, 0x14, 0x29, 0x65, 0x14, 0x25, 0x19, 0x8a, 0x22, 0xab, + 0xcd, 0x8e, 0xf4, 0x85, 0x3f, 0xfe, 0x27, 0x00, 0x00, 0xff, 0xff, 0x7d, 0x96, 0x37, 0xa5, 0x55, + 0x06, 0x00, 0x00, +} + +func (m *IbcAction) 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 *IbcAction) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IbcAction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.RawAction != nil { + { + size, err := m.RawAction.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintIbc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *FungibleTokenPacketData) 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 *FungibleTokenPacketData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FungibleTokenPacketData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Receiver) > 0 { + i -= len(m.Receiver) + copy(dAtA[i:], m.Receiver) + i = encodeVarintIbc(dAtA, i, uint64(len(m.Receiver))) + i-- + dAtA[i] = 0x22 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintIbc(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x1a + } + if len(m.Amount) > 0 { + i -= len(m.Amount) + copy(dAtA[i:], m.Amount) + i = encodeVarintIbc(dAtA, i, uint64(len(m.Amount))) + i-- + dAtA[i] = 0x12 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintIbc(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Ics20Withdrawal) 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 *Ics20Withdrawal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Ics20Withdrawal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SourceChannel) > 0 { + i -= len(m.SourceChannel) + copy(dAtA[i:], m.SourceChannel) + i = encodeVarintIbc(dAtA, i, uint64(len(m.SourceChannel))) + i-- + dAtA[i] = 0x4a + } + if len(m.SourcePort) > 0 { + i -= len(m.SourcePort) + copy(dAtA[i:], m.SourcePort) + i = encodeVarintIbc(dAtA, i, uint64(len(m.SourcePort))) + i-- + dAtA[i] = 0x42 + } + if m.TimeoutTime != 0 { + i = encodeVarintIbc(dAtA, i, uint64(m.TimeoutTime)) + i-- + dAtA[i] = 0x38 + } + if m.TimeoutHeight != 0 { + i = encodeVarintIbc(dAtA, i, uint64(m.TimeoutHeight)) + i-- + dAtA[i] = 0x30 + } + if m.ReturnAddress != nil { + { + size, err := m.ReturnAddress.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintIbc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.DestinationChainAddress) > 0 { + i -= len(m.DestinationChainAddress) + copy(dAtA[i:], m.DestinationChainAddress) + i = encodeVarintIbc(dAtA, i, uint64(len(m.DestinationChainAddress))) + i-- + dAtA[i] = 0x22 + } + if m.Denom != nil { + { + size, err := m.Denom.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintIbc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Amount != nil { + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintIbc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.DestinationChainId) > 0 { + i -= len(m.DestinationChainId) + copy(dAtA[i:], m.DestinationChainId) + i = encodeVarintIbc(dAtA, i, uint64(len(m.DestinationChainId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ClientData) 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 *ClientData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClientData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProcessedHeight != 0 { + i = encodeVarintIbc(dAtA, i, uint64(m.ProcessedHeight)) + i-- + dAtA[i] = 0x20 + } + if len(m.ProcessedTime) > 0 { + i -= len(m.ProcessedTime) + copy(dAtA[i:], m.ProcessedTime) + i = encodeVarintIbc(dAtA, i, uint64(len(m.ProcessedTime))) + i-- + dAtA[i] = 0x1a + } + if m.ClientState != nil { + { + size, err := m.ClientState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintIbc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintIbc(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ClientCounter) 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 *ClientCounter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClientCounter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Counter != 0 { + i = encodeVarintIbc(dAtA, i, uint64(m.Counter)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ConsensusState) 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 *ConsensusState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConsensusState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ConsensusState != nil { + { + size, err := m.ConsensusState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintIbc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *VerifiedHeights) 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 *VerifiedHeights) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VerifiedHeights) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Heights) > 0 { + for iNdEx := len(m.Heights) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Heights[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintIbc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ConnectionCounter) 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 *ConnectionCounter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConnectionCounter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Counter != 0 { + i = encodeVarintIbc(dAtA, i, uint64(m.Counter)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ClientConnections) 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 *ClientConnections) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClientConnections) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Connections) > 0 { + for iNdEx := len(m.Connections) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Connections[iNdEx]) + copy(dAtA[i:], m.Connections[iNdEx]) + i = encodeVarintIbc(dAtA, i, uint64(len(m.Connections[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintIbc(dAtA []byte, offset int, v uint64) int { + offset -= sovIbc(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *IbcAction) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RawAction != nil { + l = m.RawAction.Size() + n += 1 + l + sovIbc(uint64(l)) + } + return n +} + +func (m *FungibleTokenPacketData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovIbc(uint64(l)) + } + l = len(m.Amount) + if l > 0 { + n += 1 + l + sovIbc(uint64(l)) + } + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovIbc(uint64(l)) + } + l = len(m.Receiver) + if l > 0 { + n += 1 + l + sovIbc(uint64(l)) + } + return n +} + +func (m *Ics20Withdrawal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DestinationChainId) + if l > 0 { + n += 1 + l + sovIbc(uint64(l)) + } + if m.Amount != nil { + l = m.Amount.Size() + n += 1 + l + sovIbc(uint64(l)) + } + if m.Denom != nil { + l = m.Denom.Size() + n += 1 + l + sovIbc(uint64(l)) + } + l = len(m.DestinationChainAddress) + if l > 0 { + n += 1 + l + sovIbc(uint64(l)) + } + if m.ReturnAddress != nil { + l = m.ReturnAddress.Size() + n += 1 + l + sovIbc(uint64(l)) + } + if m.TimeoutHeight != 0 { + n += 1 + sovIbc(uint64(m.TimeoutHeight)) + } + if m.TimeoutTime != 0 { + n += 1 + sovIbc(uint64(m.TimeoutTime)) + } + l = len(m.SourcePort) + if l > 0 { + n += 1 + l + sovIbc(uint64(l)) + } + l = len(m.SourceChannel) + if l > 0 { + n += 1 + l + sovIbc(uint64(l)) + } + return n +} + +func (m *ClientData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovIbc(uint64(l)) + } + if m.ClientState != nil { + l = m.ClientState.Size() + n += 1 + l + sovIbc(uint64(l)) + } + l = len(m.ProcessedTime) + if l > 0 { + n += 1 + l + sovIbc(uint64(l)) + } + if m.ProcessedHeight != 0 { + n += 1 + sovIbc(uint64(m.ProcessedHeight)) + } + return n +} + +func (m *ClientCounter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Counter != 0 { + n += 1 + sovIbc(uint64(m.Counter)) + } + return n +} + +func (m *ConsensusState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ConsensusState != nil { + l = m.ConsensusState.Size() + n += 1 + l + sovIbc(uint64(l)) + } + return n +} + +func (m *VerifiedHeights) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Heights) > 0 { + for _, e := range m.Heights { + l = e.Size() + n += 1 + l + sovIbc(uint64(l)) + } + } + return n +} + +func (m *ConnectionCounter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Counter != 0 { + n += 1 + sovIbc(uint64(m.Counter)) + } + return n +} + +func (m *ClientConnections) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Connections) > 0 { + for _, s := range m.Connections { + l = len(s) + n += 1 + l + sovIbc(uint64(l)) + } + } + return n +} + +func sovIbc(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozIbc(x uint64) (n int) { + return sovIbc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *IbcAction) 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 ErrIntOverflowIbc + } + 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: IbcAction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IbcAction: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RawAction", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIbc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthIbc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthIbc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RawAction == nil { + m.RawAction = &types.Any{} + } + if err := m.RawAction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipIbc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthIbc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FungibleTokenPacketData) 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 ErrIntOverflowIbc + } + 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: FungibleTokenPacketData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FungibleTokenPacketData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIbc + } + 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 ErrInvalidLengthIbc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthIbc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIbc + } + 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 ErrInvalidLengthIbc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthIbc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Amount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIbc + } + 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 ErrInvalidLengthIbc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthIbc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIbc + } + 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 ErrInvalidLengthIbc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthIbc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Receiver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipIbc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthIbc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Ics20Withdrawal) 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 ErrIntOverflowIbc + } + 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: Ics20Withdrawal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Ics20Withdrawal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DestinationChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIbc + } + 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 ErrInvalidLengthIbc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthIbc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DestinationChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIbc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthIbc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthIbc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Amount == nil { + m.Amount = &v1alpha1.Amount{} + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIbc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthIbc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthIbc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Denom == nil { + m.Denom = &v1alpha1.Denom{} + } + if err := m.Denom.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DestinationChainAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIbc + } + 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 ErrInvalidLengthIbc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthIbc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DestinationChainAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReturnAddress", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIbc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthIbc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthIbc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ReturnAddress == nil { + m.ReturnAddress = &v1alpha1.Address{} + } + if err := m.ReturnAddress.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutHeight", wireType) + } + m.TimeoutHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIbc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TimeoutHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutTime", wireType) + } + m.TimeoutTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIbc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TimeoutTime |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourcePort", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIbc + } + 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 ErrInvalidLengthIbc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthIbc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourcePort = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourceChannel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIbc + } + 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 ErrInvalidLengthIbc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthIbc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourceChannel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipIbc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthIbc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ClientData) 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 ErrIntOverflowIbc + } + 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: ClientData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClientData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIbc + } + 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 ErrInvalidLengthIbc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthIbc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientState", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIbc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthIbc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthIbc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClientState == nil { + m.ClientState = &types.Any{} + } + if err := m.ClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProcessedTime", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIbc + } + 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 ErrInvalidLengthIbc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthIbc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProcessedTime = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProcessedHeight", wireType) + } + m.ProcessedHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIbc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProcessedHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipIbc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthIbc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ClientCounter) 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 ErrIntOverflowIbc + } + 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: ClientCounter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClientCounter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Counter", wireType) + } + m.Counter = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIbc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Counter |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipIbc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthIbc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConsensusState) 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 ErrIntOverflowIbc + } + 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: ConsensusState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConsensusState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusState", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIbc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthIbc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthIbc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConsensusState == nil { + m.ConsensusState = &types.Any{} + } + if err := m.ConsensusState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipIbc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthIbc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VerifiedHeights) 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 ErrIntOverflowIbc + } + 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: VerifiedHeights: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VerifiedHeights: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Heights", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIbc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthIbc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthIbc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Heights = append(m.Heights, &types1.Height{}) + if err := m.Heights[len(m.Heights)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipIbc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthIbc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConnectionCounter) 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 ErrIntOverflowIbc + } + 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: ConnectionCounter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConnectionCounter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Counter", wireType) + } + m.Counter = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIbc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Counter |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipIbc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthIbc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ClientConnections) 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 ErrIntOverflowIbc + } + 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: ClientConnections: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClientConnections: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Connections", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIbc + } + 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 ErrInvalidLengthIbc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthIbc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Connections = append(m.Connections, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipIbc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthIbc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipIbc(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, ErrIntOverflowIbc + } + 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, ErrIntOverflowIbc + } + 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, ErrIntOverflowIbc + } + 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, ErrInvalidLengthIbc + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupIbc + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthIbc + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthIbc = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowIbc = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupIbc = fmt.Errorf("proto: unexpected end of group") +) diff --git a/relayer/chains/penumbra/core/stake/v1alpha1/stake.pb.go b/relayer/chains/penumbra/core/stake/v1alpha1/stake.pb.go new file mode 100644 index 000000000..2228a0a81 --- /dev/null +++ b/relayer/chains/penumbra/core/stake/v1alpha1/stake.pb.go @@ -0,0 +1,6026 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: penumbra/core/stake/v1alpha1/stake.proto + +package stakev1alpha1 + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + v1alpha1 "github.com/cosmos/relayer/v2/relayer/chains/penumbra/core/crypto/v1alpha1" + 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 BondingState_BondingStateEnum int32 + +const ( + BondingState_BONDING_STATE_ENUM_UNSPECIFIED BondingState_BondingStateEnum = 0 + BondingState_BONDING_STATE_ENUM_BONDED BondingState_BondingStateEnum = 1 + BondingState_BONDING_STATE_ENUM_UNBONDING BondingState_BondingStateEnum = 2 + BondingState_BONDING_STATE_ENUM_UNBONDED BondingState_BondingStateEnum = 3 +) + +var BondingState_BondingStateEnum_name = map[int32]string{ + 0: "BONDING_STATE_ENUM_UNSPECIFIED", + 1: "BONDING_STATE_ENUM_BONDED", + 2: "BONDING_STATE_ENUM_UNBONDING", + 3: "BONDING_STATE_ENUM_UNBONDED", +} + +var BondingState_BondingStateEnum_value = map[string]int32{ + "BONDING_STATE_ENUM_UNSPECIFIED": 0, + "BONDING_STATE_ENUM_BONDED": 1, + "BONDING_STATE_ENUM_UNBONDING": 2, + "BONDING_STATE_ENUM_UNBONDED": 3, +} + +func (x BondingState_BondingStateEnum) String() string { + return proto.EnumName(BondingState_BondingStateEnum_name, int32(x)) +} + +func (BondingState_BondingStateEnum) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_022d012c8e7b3ca5, []int{6, 0} +} + +type ValidatorState_ValidatorStateEnum int32 + +const ( + ValidatorState_VALIDATOR_STATE_ENUM_UNSPECIFIED ValidatorState_ValidatorStateEnum = 0 + ValidatorState_VALIDATOR_STATE_ENUM_INACTIVE ValidatorState_ValidatorStateEnum = 1 + ValidatorState_VALIDATOR_STATE_ENUM_ACTIVE ValidatorState_ValidatorStateEnum = 2 + ValidatorState_VALIDATOR_STATE_ENUM_JAILED ValidatorState_ValidatorStateEnum = 3 + ValidatorState_VALIDATOR_STATE_ENUM_TOMBSTONED ValidatorState_ValidatorStateEnum = 4 + ValidatorState_VALIDATOR_STATE_ENUM_DISABLED ValidatorState_ValidatorStateEnum = 5 +) + +var ValidatorState_ValidatorStateEnum_name = map[int32]string{ + 0: "VALIDATOR_STATE_ENUM_UNSPECIFIED", + 1: "VALIDATOR_STATE_ENUM_INACTIVE", + 2: "VALIDATOR_STATE_ENUM_ACTIVE", + 3: "VALIDATOR_STATE_ENUM_JAILED", + 4: "VALIDATOR_STATE_ENUM_TOMBSTONED", + 5: "VALIDATOR_STATE_ENUM_DISABLED", +} + +var ValidatorState_ValidatorStateEnum_value = map[string]int32{ + "VALIDATOR_STATE_ENUM_UNSPECIFIED": 0, + "VALIDATOR_STATE_ENUM_INACTIVE": 1, + "VALIDATOR_STATE_ENUM_ACTIVE": 2, + "VALIDATOR_STATE_ENUM_JAILED": 3, + "VALIDATOR_STATE_ENUM_TOMBSTONED": 4, + "VALIDATOR_STATE_ENUM_DISABLED": 5, +} + +func (x ValidatorState_ValidatorStateEnum) String() string { + return proto.EnumName(ValidatorState_ValidatorStateEnum_name, int32(x)) +} + +func (ValidatorState_ValidatorStateEnum) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_022d012c8e7b3ca5, []int{7, 0} +} + +// Describes a validator's configuration data. +type Validator struct { + // The validator's identity verification key. + IdentityKey *v1alpha1.IdentityKey `protobuf:"bytes,1,opt,name=identity_key,json=identityKey,proto3" json:"identity_key,omitempty"` + // The validator's consensus pubkey for use in Tendermint (Ed25519). + ConsensusKey []byte `protobuf:"bytes,2,opt,name=consensus_key,json=consensusKey,proto3" json:"consensus_key,omitempty"` + // The validator's (human-readable) name. + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + // The validator's website. + Website string `protobuf:"bytes,4,opt,name=website,proto3" json:"website,omitempty"` + // The validator's description. + Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` + // Whether the validator is enabled or not. + // + // Disabled validators cannot be delegated to, and immediately begin unbonding. + Enabled bool `protobuf:"varint,8,opt,name=enabled,proto3" json:"enabled,omitempty"` + // A list of funding streams describing the validator's commission. + FundingStreams []*FundingStream `protobuf:"bytes,6,rep,name=funding_streams,json=fundingStreams,proto3" json:"funding_streams,omitempty"` + // The sequence number determines which validator data takes priority, and + // prevents replay attacks. The chain only accepts new validator definitions + // with increasing sequence numbers. + SequenceNumber uint32 `protobuf:"varint,7,opt,name=sequence_number,json=sequenceNumber,proto3" json:"sequence_number,omitempty"` + // The validator's governance key. + GovernanceKey *v1alpha1.GovernanceKey `protobuf:"bytes,9,opt,name=governance_key,json=governanceKey,proto3" json:"governance_key,omitempty"` +} + +func (m *Validator) Reset() { *m = Validator{} } +func (m *Validator) String() string { return proto.CompactTextString(m) } +func (*Validator) ProtoMessage() {} +func (*Validator) Descriptor() ([]byte, []int) { + return fileDescriptor_022d012c8e7b3ca5, []int{0} +} +func (m *Validator) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Validator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Validator.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 *Validator) XXX_Merge(src proto.Message) { + xxx_messageInfo_Validator.Merge(m, src) +} +func (m *Validator) XXX_Size() int { + return m.Size() +} +func (m *Validator) XXX_DiscardUnknown() { + xxx_messageInfo_Validator.DiscardUnknown(m) +} + +var xxx_messageInfo_Validator proto.InternalMessageInfo + +func (m *Validator) GetIdentityKey() *v1alpha1.IdentityKey { + if m != nil { + return m.IdentityKey + } + return nil +} + +func (m *Validator) GetConsensusKey() []byte { + if m != nil { + return m.ConsensusKey + } + return nil +} + +func (m *Validator) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Validator) GetWebsite() string { + if m != nil { + return m.Website + } + return "" +} + +func (m *Validator) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Validator) GetEnabled() bool { + if m != nil { + return m.Enabled + } + return false +} + +func (m *Validator) GetFundingStreams() []*FundingStream { + if m != nil { + return m.FundingStreams + } + return nil +} + +func (m *Validator) GetSequenceNumber() uint32 { + if m != nil { + return m.SequenceNumber + } + return 0 +} + +func (m *Validator) GetGovernanceKey() *v1alpha1.GovernanceKey { + if m != nil { + return m.GovernanceKey + } + return nil +} + +// For storing the list of keys of known validators. +type ValidatorList struct { + ValidatorKeys []*v1alpha1.IdentityKey `protobuf:"bytes,1,rep,name=validator_keys,json=validatorKeys,proto3" json:"validator_keys,omitempty"` +} + +func (m *ValidatorList) Reset() { *m = ValidatorList{} } +func (m *ValidatorList) String() string { return proto.CompactTextString(m) } +func (*ValidatorList) ProtoMessage() {} +func (*ValidatorList) Descriptor() ([]byte, []int) { + return fileDescriptor_022d012c8e7b3ca5, []int{1} +} +func (m *ValidatorList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorList.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 *ValidatorList) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorList.Merge(m, src) +} +func (m *ValidatorList) XXX_Size() int { + return m.Size() +} +func (m *ValidatorList) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorList.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorList proto.InternalMessageInfo + +func (m *ValidatorList) GetValidatorKeys() []*v1alpha1.IdentityKey { + if m != nil { + return m.ValidatorKeys + } + return nil +} + +// A portion of a validator's commission. +type FundingStream struct { + // The recipient of the funding stream. + // + // Types that are valid to be assigned to Recipient: + // *FundingStream_ToAddress_ + // *FundingStream_ToDao_ + Recipient isFundingStream_Recipient `protobuf_oneof:"recipient"` +} + +func (m *FundingStream) Reset() { *m = FundingStream{} } +func (m *FundingStream) String() string { return proto.CompactTextString(m) } +func (*FundingStream) ProtoMessage() {} +func (*FundingStream) Descriptor() ([]byte, []int) { + return fileDescriptor_022d012c8e7b3ca5, []int{2} +} +func (m *FundingStream) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FundingStream) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FundingStream.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 *FundingStream) XXX_Merge(src proto.Message) { + xxx_messageInfo_FundingStream.Merge(m, src) +} +func (m *FundingStream) XXX_Size() int { + return m.Size() +} +func (m *FundingStream) XXX_DiscardUnknown() { + xxx_messageInfo_FundingStream.DiscardUnknown(m) +} + +var xxx_messageInfo_FundingStream proto.InternalMessageInfo + +type isFundingStream_Recipient interface { + isFundingStream_Recipient() + MarshalTo([]byte) (int, error) + Size() int +} + +type FundingStream_ToAddress_ struct { + ToAddress *FundingStream_ToAddress `protobuf:"bytes,1,opt,name=to_address,json=toAddress,proto3,oneof" json:"to_address,omitempty"` +} +type FundingStream_ToDao_ struct { + ToDao *FundingStream_ToDao `protobuf:"bytes,2,opt,name=to_dao,json=toDao,proto3,oneof" json:"to_dao,omitempty"` +} + +func (*FundingStream_ToAddress_) isFundingStream_Recipient() {} +func (*FundingStream_ToDao_) isFundingStream_Recipient() {} + +func (m *FundingStream) GetRecipient() isFundingStream_Recipient { + if m != nil { + return m.Recipient + } + return nil +} + +func (m *FundingStream) GetToAddress() *FundingStream_ToAddress { + if x, ok := m.GetRecipient().(*FundingStream_ToAddress_); ok { + return x.ToAddress + } + return nil +} + +func (m *FundingStream) GetToDao() *FundingStream_ToDao { + if x, ok := m.GetRecipient().(*FundingStream_ToDao_); ok { + return x.ToDao + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*FundingStream) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*FundingStream_ToAddress_)(nil), + (*FundingStream_ToDao_)(nil), + } +} + +type FundingStream_ToAddress struct { + // The destination address for the funding stream. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // The portion of the staking reward for the entire delegation pool + // allocated to this funding stream, specified in basis points. + RateBps uint32 `protobuf:"varint,2,opt,name=rate_bps,json=rateBps,proto3" json:"rate_bps,omitempty"` +} + +func (m *FundingStream_ToAddress) Reset() { *m = FundingStream_ToAddress{} } +func (m *FundingStream_ToAddress) String() string { return proto.CompactTextString(m) } +func (*FundingStream_ToAddress) ProtoMessage() {} +func (*FundingStream_ToAddress) Descriptor() ([]byte, []int) { + return fileDescriptor_022d012c8e7b3ca5, []int{2, 0} +} +func (m *FundingStream_ToAddress) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FundingStream_ToAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FundingStream_ToAddress.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 *FundingStream_ToAddress) XXX_Merge(src proto.Message) { + xxx_messageInfo_FundingStream_ToAddress.Merge(m, src) +} +func (m *FundingStream_ToAddress) XXX_Size() int { + return m.Size() +} +func (m *FundingStream_ToAddress) XXX_DiscardUnknown() { + xxx_messageInfo_FundingStream_ToAddress.DiscardUnknown(m) +} + +var xxx_messageInfo_FundingStream_ToAddress proto.InternalMessageInfo + +func (m *FundingStream_ToAddress) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *FundingStream_ToAddress) GetRateBps() uint32 { + if m != nil { + return m.RateBps + } + return 0 +} + +type FundingStream_ToDao struct { + // The portion of the staking reward for the entire delegation pool + // allocated to this funding stream, specified in basis points. + RateBps uint32 `protobuf:"varint,2,opt,name=rate_bps,json=rateBps,proto3" json:"rate_bps,omitempty"` +} + +func (m *FundingStream_ToDao) Reset() { *m = FundingStream_ToDao{} } +func (m *FundingStream_ToDao) String() string { return proto.CompactTextString(m) } +func (*FundingStream_ToDao) ProtoMessage() {} +func (*FundingStream_ToDao) Descriptor() ([]byte, []int) { + return fileDescriptor_022d012c8e7b3ca5, []int{2, 1} +} +func (m *FundingStream_ToDao) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FundingStream_ToDao) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FundingStream_ToDao.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 *FundingStream_ToDao) XXX_Merge(src proto.Message) { + xxx_messageInfo_FundingStream_ToDao.Merge(m, src) +} +func (m *FundingStream_ToDao) XXX_Size() int { + return m.Size() +} +func (m *FundingStream_ToDao) XXX_DiscardUnknown() { + xxx_messageInfo_FundingStream_ToDao.DiscardUnknown(m) +} + +var xxx_messageInfo_FundingStream_ToDao proto.InternalMessageInfo + +func (m *FundingStream_ToDao) GetRateBps() uint32 { + if m != nil { + return m.RateBps + } + return 0 +} + +// Describes the reward and exchange rates and voting power for a validator in some epoch. +type RateData struct { + IdentityKey *v1alpha1.IdentityKey `protobuf:"bytes,1,opt,name=identity_key,json=identityKey,proto3" json:"identity_key,omitempty"` + EpochIndex uint64 `protobuf:"varint,2,opt,name=epoch_index,json=epochIndex,proto3" json:"epoch_index,omitempty"` + ValidatorRewardRate uint64 `protobuf:"varint,4,opt,name=validator_reward_rate,json=validatorRewardRate,proto3" json:"validator_reward_rate,omitempty"` + ValidatorExchangeRate uint64 `protobuf:"varint,5,opt,name=validator_exchange_rate,json=validatorExchangeRate,proto3" json:"validator_exchange_rate,omitempty"` +} + +func (m *RateData) Reset() { *m = RateData{} } +func (m *RateData) String() string { return proto.CompactTextString(m) } +func (*RateData) ProtoMessage() {} +func (*RateData) Descriptor() ([]byte, []int) { + return fileDescriptor_022d012c8e7b3ca5, []int{3} +} +func (m *RateData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RateData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RateData.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 *RateData) XXX_Merge(src proto.Message) { + xxx_messageInfo_RateData.Merge(m, src) +} +func (m *RateData) XXX_Size() int { + return m.Size() +} +func (m *RateData) XXX_DiscardUnknown() { + xxx_messageInfo_RateData.DiscardUnknown(m) +} + +var xxx_messageInfo_RateData proto.InternalMessageInfo + +func (m *RateData) GetIdentityKey() *v1alpha1.IdentityKey { + if m != nil { + return m.IdentityKey + } + return nil +} + +func (m *RateData) GetEpochIndex() uint64 { + if m != nil { + return m.EpochIndex + } + return 0 +} + +func (m *RateData) GetValidatorRewardRate() uint64 { + if m != nil { + return m.ValidatorRewardRate + } + return 0 +} + +func (m *RateData) GetValidatorExchangeRate() uint64 { + if m != nil { + return m.ValidatorExchangeRate + } + return 0 +} + +// Describes the base reward and exchange rates in some epoch. +type BaseRateData struct { + EpochIndex uint64 `protobuf:"varint,1,opt,name=epoch_index,json=epochIndex,proto3" json:"epoch_index,omitempty"` + BaseRewardRate uint64 `protobuf:"varint,2,opt,name=base_reward_rate,json=baseRewardRate,proto3" json:"base_reward_rate,omitempty"` + BaseExchangeRate uint64 `protobuf:"varint,3,opt,name=base_exchange_rate,json=baseExchangeRate,proto3" json:"base_exchange_rate,omitempty"` +} + +func (m *BaseRateData) Reset() { *m = BaseRateData{} } +func (m *BaseRateData) String() string { return proto.CompactTextString(m) } +func (*BaseRateData) ProtoMessage() {} +func (*BaseRateData) Descriptor() ([]byte, []int) { + return fileDescriptor_022d012c8e7b3ca5, []int{4} +} +func (m *BaseRateData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BaseRateData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BaseRateData.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 *BaseRateData) XXX_Merge(src proto.Message) { + xxx_messageInfo_BaseRateData.Merge(m, src) +} +func (m *BaseRateData) XXX_Size() int { + return m.Size() +} +func (m *BaseRateData) XXX_DiscardUnknown() { + xxx_messageInfo_BaseRateData.DiscardUnknown(m) +} + +var xxx_messageInfo_BaseRateData proto.InternalMessageInfo + +func (m *BaseRateData) GetEpochIndex() uint64 { + if m != nil { + return m.EpochIndex + } + return 0 +} + +func (m *BaseRateData) GetBaseRewardRate() uint64 { + if m != nil { + return m.BaseRewardRate + } + return 0 +} + +func (m *BaseRateData) GetBaseExchangeRate() uint64 { + if m != nil { + return m.BaseExchangeRate + } + return 0 +} + +// Describes the current state of a validator on-chain +type ValidatorStatus struct { + IdentityKey *v1alpha1.IdentityKey `protobuf:"bytes,1,opt,name=identity_key,json=identityKey,proto3" json:"identity_key,omitempty"` + State *ValidatorState `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` + VotingPower uint64 `protobuf:"varint,3,opt,name=voting_power,json=votingPower,proto3" json:"voting_power,omitempty"` + BondingState *BondingState `protobuf:"bytes,4,opt,name=bonding_state,json=bondingState,proto3" json:"bonding_state,omitempty"` +} + +func (m *ValidatorStatus) Reset() { *m = ValidatorStatus{} } +func (m *ValidatorStatus) String() string { return proto.CompactTextString(m) } +func (*ValidatorStatus) ProtoMessage() {} +func (*ValidatorStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_022d012c8e7b3ca5, []int{5} +} +func (m *ValidatorStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorStatus.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 *ValidatorStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorStatus.Merge(m, src) +} +func (m *ValidatorStatus) XXX_Size() int { + return m.Size() +} +func (m *ValidatorStatus) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorStatus proto.InternalMessageInfo + +func (m *ValidatorStatus) GetIdentityKey() *v1alpha1.IdentityKey { + if m != nil { + return m.IdentityKey + } + return nil +} + +func (m *ValidatorStatus) GetState() *ValidatorState { + if m != nil { + return m.State + } + return nil +} + +func (m *ValidatorStatus) GetVotingPower() uint64 { + if m != nil { + return m.VotingPower + } + return 0 +} + +func (m *ValidatorStatus) GetBondingState() *BondingState { + if m != nil { + return m.BondingState + } + return nil +} + +// Describes the unbonding state of a validator's stake pool. +type BondingState struct { + State BondingState_BondingStateEnum `protobuf:"varint,1,opt,name=state,proto3,enum=penumbra.core.stake.v1alpha1.BondingState_BondingStateEnum" json:"state,omitempty"` + // Types that are valid to be assigned to XUnbondingEpoch: + // *BondingState_UnbondingEpoch + XUnbondingEpoch isBondingState_XUnbondingEpoch `protobuf_oneof:"_unbonding_epoch"` +} + +func (m *BondingState) Reset() { *m = BondingState{} } +func (m *BondingState) String() string { return proto.CompactTextString(m) } +func (*BondingState) ProtoMessage() {} +func (*BondingState) Descriptor() ([]byte, []int) { + return fileDescriptor_022d012c8e7b3ca5, []int{6} +} +func (m *BondingState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BondingState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BondingState.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 *BondingState) XXX_Merge(src proto.Message) { + xxx_messageInfo_BondingState.Merge(m, src) +} +func (m *BondingState) XXX_Size() int { + return m.Size() +} +func (m *BondingState) XXX_DiscardUnknown() { + xxx_messageInfo_BondingState.DiscardUnknown(m) +} + +var xxx_messageInfo_BondingState proto.InternalMessageInfo + +type isBondingState_XUnbondingEpoch interface { + isBondingState_XUnbondingEpoch() + MarshalTo([]byte) (int, error) + Size() int +} + +type BondingState_UnbondingEpoch struct { + UnbondingEpoch uint64 `protobuf:"varint,2,opt,name=unbonding_epoch,json=unbondingEpoch,proto3,oneof" json:"unbonding_epoch,omitempty"` +} + +func (*BondingState_UnbondingEpoch) isBondingState_XUnbondingEpoch() {} + +func (m *BondingState) GetXUnbondingEpoch() isBondingState_XUnbondingEpoch { + if m != nil { + return m.XUnbondingEpoch + } + return nil +} + +func (m *BondingState) GetState() BondingState_BondingStateEnum { + if m != nil { + return m.State + } + return BondingState_BONDING_STATE_ENUM_UNSPECIFIED +} + +func (m *BondingState) GetUnbondingEpoch() uint64 { + if x, ok := m.GetXUnbondingEpoch().(*BondingState_UnbondingEpoch); ok { + return x.UnbondingEpoch + } + return 0 +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*BondingState) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*BondingState_UnbondingEpoch)(nil), + } +} + +// Describes the state of a validator +type ValidatorState struct { + State ValidatorState_ValidatorStateEnum `protobuf:"varint,1,opt,name=state,proto3,enum=penumbra.core.stake.v1alpha1.ValidatorState_ValidatorStateEnum" json:"state,omitempty"` +} + +func (m *ValidatorState) Reset() { *m = ValidatorState{} } +func (m *ValidatorState) String() string { return proto.CompactTextString(m) } +func (*ValidatorState) ProtoMessage() {} +func (*ValidatorState) Descriptor() ([]byte, []int) { + return fileDescriptor_022d012c8e7b3ca5, []int{7} +} +func (m *ValidatorState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorState.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 *ValidatorState) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorState.Merge(m, src) +} +func (m *ValidatorState) XXX_Size() int { + return m.Size() +} +func (m *ValidatorState) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorState.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorState proto.InternalMessageInfo + +func (m *ValidatorState) GetState() ValidatorState_ValidatorStateEnum { + if m != nil { + return m.State + } + return ValidatorState_VALIDATOR_STATE_ENUM_UNSPECIFIED +} + +// Combines all validator info into a single packet. +type ValidatorInfo struct { + Validator *Validator `protobuf:"bytes,1,opt,name=validator,proto3" json:"validator,omitempty"` + Status *ValidatorStatus `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + RateData *RateData `protobuf:"bytes,3,opt,name=rate_data,json=rateData,proto3" json:"rate_data,omitempty"` +} + +func (m *ValidatorInfo) Reset() { *m = ValidatorInfo{} } +func (m *ValidatorInfo) String() string { return proto.CompactTextString(m) } +func (*ValidatorInfo) ProtoMessage() {} +func (*ValidatorInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_022d012c8e7b3ca5, []int{8} +} +func (m *ValidatorInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorInfo.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 *ValidatorInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorInfo.Merge(m, src) +} +func (m *ValidatorInfo) XXX_Size() int { + return m.Size() +} +func (m *ValidatorInfo) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorInfo proto.InternalMessageInfo + +func (m *ValidatorInfo) GetValidator() *Validator { + if m != nil { + return m.Validator + } + return nil +} + +func (m *ValidatorInfo) GetStatus() *ValidatorStatus { + if m != nil { + return m.Status + } + return nil +} + +func (m *ValidatorInfo) GetRateData() *RateData { + if m != nil { + return m.RateData + } + return nil +} + +// A transaction action (re)defining a validator. +type ValidatorDefinition struct { + // The configuration data for the validator. + Validator *Validator `protobuf:"bytes,1,opt,name=validator,proto3" json:"validator,omitempty"` + // A signature by the validator's identity key over the validator data. + AuthSig []byte `protobuf:"bytes,2,opt,name=auth_sig,json=authSig,proto3" json:"auth_sig,omitempty"` +} + +func (m *ValidatorDefinition) Reset() { *m = ValidatorDefinition{} } +func (m *ValidatorDefinition) String() string { return proto.CompactTextString(m) } +func (*ValidatorDefinition) ProtoMessage() {} +func (*ValidatorDefinition) Descriptor() ([]byte, []int) { + return fileDescriptor_022d012c8e7b3ca5, []int{9} +} +func (m *ValidatorDefinition) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorDefinition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorDefinition.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 *ValidatorDefinition) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorDefinition.Merge(m, src) +} +func (m *ValidatorDefinition) XXX_Size() int { + return m.Size() +} +func (m *ValidatorDefinition) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorDefinition.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorDefinition proto.InternalMessageInfo + +func (m *ValidatorDefinition) GetValidator() *Validator { + if m != nil { + return m.Validator + } + return nil +} + +func (m *ValidatorDefinition) GetAuthSig() []byte { + if m != nil { + return m.AuthSig + } + return nil +} + +// A transaction action adding stake to a validator's delegation pool. +type Delegate struct { + // The identity key of the validator to delegate to. + ValidatorIdentity *v1alpha1.IdentityKey `protobuf:"bytes,1,opt,name=validator_identity,json=validatorIdentity,proto3" json:"validator_identity,omitempty"` + // The index of the epoch in which this delegation was performed. + // The delegation takes effect in the next epoch. + EpochIndex uint64 `protobuf:"varint,2,opt,name=epoch_index,json=epochIndex,proto3" json:"epoch_index,omitempty"` + // The delegation amount, in units of unbonded stake. + // TODO: use flow aggregation to hide this, replacing it with bytes amount_ciphertext; + UnbondedAmount *v1alpha1.Amount `protobuf:"bytes,3,opt,name=unbonded_amount,json=unbondedAmount,proto3" json:"unbonded_amount,omitempty"` + // The amount of delegation tokens produced by this action. + // + // This is implied by the validator's exchange rate in the specified epoch + // (and should be checked in transaction validation!), but including it allows + // stateless verification that the transaction is internally consistent. + DelegationAmount *v1alpha1.Amount `protobuf:"bytes,4,opt,name=delegation_amount,json=delegationAmount,proto3" json:"delegation_amount,omitempty"` +} + +func (m *Delegate) Reset() { *m = Delegate{} } +func (m *Delegate) String() string { return proto.CompactTextString(m) } +func (*Delegate) ProtoMessage() {} +func (*Delegate) Descriptor() ([]byte, []int) { + return fileDescriptor_022d012c8e7b3ca5, []int{10} +} +func (m *Delegate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Delegate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Delegate.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 *Delegate) XXX_Merge(src proto.Message) { + xxx_messageInfo_Delegate.Merge(m, src) +} +func (m *Delegate) XXX_Size() int { + return m.Size() +} +func (m *Delegate) XXX_DiscardUnknown() { + xxx_messageInfo_Delegate.DiscardUnknown(m) +} + +var xxx_messageInfo_Delegate proto.InternalMessageInfo + +func (m *Delegate) GetValidatorIdentity() *v1alpha1.IdentityKey { + if m != nil { + return m.ValidatorIdentity + } + return nil +} + +func (m *Delegate) GetEpochIndex() uint64 { + if m != nil { + return m.EpochIndex + } + return 0 +} + +func (m *Delegate) GetUnbondedAmount() *v1alpha1.Amount { + if m != nil { + return m.UnbondedAmount + } + return nil +} + +func (m *Delegate) GetDelegationAmount() *v1alpha1.Amount { + if m != nil { + return m.DelegationAmount + } + return nil +} + +// A transaction action withdrawing stake from a validator's delegation pool. +type Undelegate struct { + // The identity key of the validator to undelegate from. + ValidatorIdentity *v1alpha1.IdentityKey `protobuf:"bytes,1,opt,name=validator_identity,json=validatorIdentity,proto3" json:"validator_identity,omitempty"` + // The index of the epoch in which this undelegation was performed. + StartEpochIndex uint64 `protobuf:"varint,2,opt,name=start_epoch_index,json=startEpochIndex,proto3" json:"start_epoch_index,omitempty"` + // The amount to undelegate, in units of unbonding tokens. + UnbondedAmount *v1alpha1.Amount `protobuf:"bytes,3,opt,name=unbonded_amount,json=unbondedAmount,proto3" json:"unbonded_amount,omitempty"` + // The amount of delegation tokens consumed by this action. + // + // This is implied by the validator's exchange rate in the specified epoch + // (and should be checked in transaction validation!), but including it allows + // stateless verification that the transaction is internally consistent. + DelegationAmount *v1alpha1.Amount `protobuf:"bytes,4,opt,name=delegation_amount,json=delegationAmount,proto3" json:"delegation_amount,omitempty"` +} + +func (m *Undelegate) Reset() { *m = Undelegate{} } +func (m *Undelegate) String() string { return proto.CompactTextString(m) } +func (*Undelegate) ProtoMessage() {} +func (*Undelegate) Descriptor() ([]byte, []int) { + return fileDescriptor_022d012c8e7b3ca5, []int{11} +} +func (m *Undelegate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Undelegate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Undelegate.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 *Undelegate) XXX_Merge(src proto.Message) { + xxx_messageInfo_Undelegate.Merge(m, src) +} +func (m *Undelegate) XXX_Size() int { + return m.Size() +} +func (m *Undelegate) XXX_DiscardUnknown() { + xxx_messageInfo_Undelegate.DiscardUnknown(m) +} + +var xxx_messageInfo_Undelegate proto.InternalMessageInfo + +func (m *Undelegate) GetValidatorIdentity() *v1alpha1.IdentityKey { + if m != nil { + return m.ValidatorIdentity + } + return nil +} + +func (m *Undelegate) GetStartEpochIndex() uint64 { + if m != nil { + return m.StartEpochIndex + } + return 0 +} + +func (m *Undelegate) GetUnbondedAmount() *v1alpha1.Amount { + if m != nil { + return m.UnbondedAmount + } + return nil +} + +func (m *Undelegate) GetDelegationAmount() *v1alpha1.Amount { + if m != nil { + return m.DelegationAmount + } + return nil +} + +// A transaction action finishing an undelegation, converting (slashable) +// "unbonding tokens" to (unslashable) staking tokens. +type UndelegateClaim struct { + Body *UndelegateClaimBody `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + Proof []byte `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` +} + +func (m *UndelegateClaim) Reset() { *m = UndelegateClaim{} } +func (m *UndelegateClaim) String() string { return proto.CompactTextString(m) } +func (*UndelegateClaim) ProtoMessage() {} +func (*UndelegateClaim) Descriptor() ([]byte, []int) { + return fileDescriptor_022d012c8e7b3ca5, []int{12} +} +func (m *UndelegateClaim) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UndelegateClaim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UndelegateClaim.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 *UndelegateClaim) XXX_Merge(src proto.Message) { + xxx_messageInfo_UndelegateClaim.Merge(m, src) +} +func (m *UndelegateClaim) XXX_Size() int { + return m.Size() +} +func (m *UndelegateClaim) XXX_DiscardUnknown() { + xxx_messageInfo_UndelegateClaim.DiscardUnknown(m) +} + +var xxx_messageInfo_UndelegateClaim proto.InternalMessageInfo + +func (m *UndelegateClaim) GetBody() *UndelegateClaimBody { + if m != nil { + return m.Body + } + return nil +} + +func (m *UndelegateClaim) GetProof() []byte { + if m != nil { + return m.Proof + } + return nil +} + +type UndelegateClaimBody struct { + // The identity key of the validator to finish undelegating from. + ValidatorIdentity *v1alpha1.IdentityKey `protobuf:"bytes,1,opt,name=validator_identity,json=validatorIdentity,proto3" json:"validator_identity,omitempty"` + // The epoch in which unbonding began, used to verify the penalty. + StartEpochIndex uint64 `protobuf:"varint,2,opt,name=start_epoch_index,json=startEpochIndex,proto3" json:"start_epoch_index,omitempty"` + // The penalty applied to undelegation, in bps^2 (10e-8). + // In the happy path (no slashing), this is 0. + Penalty *Penalty `protobuf:"bytes,3,opt,name=penalty,proto3" json:"penalty,omitempty"` + // The action's contribution to the transaction's value balance. + BalanceCommitment *v1alpha1.BalanceCommitment `protobuf:"bytes,4,opt,name=balance_commitment,json=balanceCommitment,proto3" json:"balance_commitment,omitempty"` +} + +func (m *UndelegateClaimBody) Reset() { *m = UndelegateClaimBody{} } +func (m *UndelegateClaimBody) String() string { return proto.CompactTextString(m) } +func (*UndelegateClaimBody) ProtoMessage() {} +func (*UndelegateClaimBody) Descriptor() ([]byte, []int) { + return fileDescriptor_022d012c8e7b3ca5, []int{13} +} +func (m *UndelegateClaimBody) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UndelegateClaimBody) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UndelegateClaimBody.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 *UndelegateClaimBody) XXX_Merge(src proto.Message) { + xxx_messageInfo_UndelegateClaimBody.Merge(m, src) +} +func (m *UndelegateClaimBody) XXX_Size() int { + return m.Size() +} +func (m *UndelegateClaimBody) XXX_DiscardUnknown() { + xxx_messageInfo_UndelegateClaimBody.DiscardUnknown(m) +} + +var xxx_messageInfo_UndelegateClaimBody proto.InternalMessageInfo + +func (m *UndelegateClaimBody) GetValidatorIdentity() *v1alpha1.IdentityKey { + if m != nil { + return m.ValidatorIdentity + } + return nil +} + +func (m *UndelegateClaimBody) GetStartEpochIndex() uint64 { + if m != nil { + return m.StartEpochIndex + } + return 0 +} + +func (m *UndelegateClaimBody) GetPenalty() *Penalty { + if m != nil { + return m.Penalty + } + return nil +} + +func (m *UndelegateClaimBody) GetBalanceCommitment() *v1alpha1.BalanceCommitment { + if m != nil { + return m.BalanceCommitment + } + return nil +} + +type UndelegateClaimPlan struct { + // The identity key of the validator to finish undelegating from. + ValidatorIdentity *v1alpha1.IdentityKey `protobuf:"bytes,1,opt,name=validator_identity,json=validatorIdentity,proto3" json:"validator_identity,omitempty"` + // The epoch in which unbonding began, used to verify the penalty. + StartEpochIndex uint64 `protobuf:"varint,2,opt,name=start_epoch_index,json=startEpochIndex,proto3" json:"start_epoch_index,omitempty"` + // The penalty applied to undelegation, in bps^2 (10e-8). + // In the happy path (no slashing), this is 0. + Penalty *Penalty `protobuf:"bytes,4,opt,name=penalty,proto3" json:"penalty,omitempty"` + // The amount of unbonding tokens to claim. + // This is a bare number because its denom is determined by the preceding data. + UnbondingAmount *v1alpha1.Amount `protobuf:"bytes,5,opt,name=unbonding_amount,json=unbondingAmount,proto3" json:"unbonding_amount,omitempty"` + // The blinding factor to use for the balance commitment. + BalanceBlinding []byte `protobuf:"bytes,6,opt,name=balance_blinding,json=balanceBlinding,proto3" json:"balance_blinding,omitempty"` +} + +func (m *UndelegateClaimPlan) Reset() { *m = UndelegateClaimPlan{} } +func (m *UndelegateClaimPlan) String() string { return proto.CompactTextString(m) } +func (*UndelegateClaimPlan) ProtoMessage() {} +func (*UndelegateClaimPlan) Descriptor() ([]byte, []int) { + return fileDescriptor_022d012c8e7b3ca5, []int{14} +} +func (m *UndelegateClaimPlan) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UndelegateClaimPlan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UndelegateClaimPlan.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 *UndelegateClaimPlan) XXX_Merge(src proto.Message) { + xxx_messageInfo_UndelegateClaimPlan.Merge(m, src) +} +func (m *UndelegateClaimPlan) XXX_Size() int { + return m.Size() +} +func (m *UndelegateClaimPlan) XXX_DiscardUnknown() { + xxx_messageInfo_UndelegateClaimPlan.DiscardUnknown(m) +} + +var xxx_messageInfo_UndelegateClaimPlan proto.InternalMessageInfo + +func (m *UndelegateClaimPlan) GetValidatorIdentity() *v1alpha1.IdentityKey { + if m != nil { + return m.ValidatorIdentity + } + return nil +} + +func (m *UndelegateClaimPlan) GetStartEpochIndex() uint64 { + if m != nil { + return m.StartEpochIndex + } + return 0 +} + +func (m *UndelegateClaimPlan) GetPenalty() *Penalty { + if m != nil { + return m.Penalty + } + return nil +} + +func (m *UndelegateClaimPlan) GetUnbondingAmount() *v1alpha1.Amount { + if m != nil { + return m.UnbondingAmount + } + return nil +} + +func (m *UndelegateClaimPlan) GetBalanceBlinding() []byte { + if m != nil { + return m.BalanceBlinding + } + return nil +} + +// A list of pending delegations and undelegations. +type DelegationChanges struct { + Delegations []*Delegate `protobuf:"bytes,1,rep,name=delegations,proto3" json:"delegations,omitempty"` + Undelegations []*Undelegate `protobuf:"bytes,2,rep,name=undelegations,proto3" json:"undelegations,omitempty"` +} + +func (m *DelegationChanges) Reset() { *m = DelegationChanges{} } +func (m *DelegationChanges) String() string { return proto.CompactTextString(m) } +func (*DelegationChanges) ProtoMessage() {} +func (*DelegationChanges) Descriptor() ([]byte, []int) { + return fileDescriptor_022d012c8e7b3ca5, []int{15} +} +func (m *DelegationChanges) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DelegationChanges) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DelegationChanges.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 *DelegationChanges) XXX_Merge(src proto.Message) { + xxx_messageInfo_DelegationChanges.Merge(m, src) +} +func (m *DelegationChanges) XXX_Size() int { + return m.Size() +} +func (m *DelegationChanges) XXX_DiscardUnknown() { + xxx_messageInfo_DelegationChanges.DiscardUnknown(m) +} + +var xxx_messageInfo_DelegationChanges proto.InternalMessageInfo + +func (m *DelegationChanges) GetDelegations() []*Delegate { + if m != nil { + return m.Delegations + } + return nil +} + +func (m *DelegationChanges) GetUndelegations() []*Undelegate { + if m != nil { + return m.Undelegations + } + return nil +} + +// Track's a validator's uptime. +type Uptime struct { + AsOfBlockHeight uint64 `protobuf:"varint,1,opt,name=as_of_block_height,json=asOfBlockHeight,proto3" json:"as_of_block_height,omitempty"` + WindowLen uint32 `protobuf:"varint,2,opt,name=window_len,json=windowLen,proto3" json:"window_len,omitempty"` + Bitvec []byte `protobuf:"bytes,3,opt,name=bitvec,proto3" json:"bitvec,omitempty"` +} + +func (m *Uptime) Reset() { *m = Uptime{} } +func (m *Uptime) String() string { return proto.CompactTextString(m) } +func (*Uptime) ProtoMessage() {} +func (*Uptime) Descriptor() ([]byte, []int) { + return fileDescriptor_022d012c8e7b3ca5, []int{16} +} +func (m *Uptime) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Uptime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Uptime.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 *Uptime) XXX_Merge(src proto.Message) { + xxx_messageInfo_Uptime.Merge(m, src) +} +func (m *Uptime) XXX_Size() int { + return m.Size() +} +func (m *Uptime) XXX_DiscardUnknown() { + xxx_messageInfo_Uptime.DiscardUnknown(m) +} + +var xxx_messageInfo_Uptime proto.InternalMessageInfo + +func (m *Uptime) GetAsOfBlockHeight() uint64 { + if m != nil { + return m.AsOfBlockHeight + } + return 0 +} + +func (m *Uptime) GetWindowLen() uint32 { + if m != nil { + return m.WindowLen + } + return 0 +} + +func (m *Uptime) GetBitvec() []byte { + if m != nil { + return m.Bitvec + } + return nil +} + +// Tracks our view of Tendermint's view of the validator set, so we can keep it +// from getting confused. +type CurrentConsensusKeys struct { + ConsensusKeys []*v1alpha1.ConsensusKey `protobuf:"bytes,1,rep,name=consensus_keys,json=consensusKeys,proto3" json:"consensus_keys,omitempty"` +} + +func (m *CurrentConsensusKeys) Reset() { *m = CurrentConsensusKeys{} } +func (m *CurrentConsensusKeys) String() string { return proto.CompactTextString(m) } +func (*CurrentConsensusKeys) ProtoMessage() {} +func (*CurrentConsensusKeys) Descriptor() ([]byte, []int) { + return fileDescriptor_022d012c8e7b3ca5, []int{17} +} +func (m *CurrentConsensusKeys) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CurrentConsensusKeys) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CurrentConsensusKeys.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 *CurrentConsensusKeys) XXX_Merge(src proto.Message) { + xxx_messageInfo_CurrentConsensusKeys.Merge(m, src) +} +func (m *CurrentConsensusKeys) XXX_Size() int { + return m.Size() +} +func (m *CurrentConsensusKeys) XXX_DiscardUnknown() { + xxx_messageInfo_CurrentConsensusKeys.DiscardUnknown(m) +} + +var xxx_messageInfo_CurrentConsensusKeys proto.InternalMessageInfo + +func (m *CurrentConsensusKeys) GetConsensusKeys() []*v1alpha1.ConsensusKey { + if m != nil { + return m.ConsensusKeys + } + return nil +} + +// Tracks slashing penalties applied to a validator in some epoch. +type Penalty struct { + Inner uint64 `protobuf:"varint,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *Penalty) Reset() { *m = Penalty{} } +func (m *Penalty) String() string { return proto.CompactTextString(m) } +func (*Penalty) ProtoMessage() {} +func (*Penalty) Descriptor() ([]byte, []int) { + return fileDescriptor_022d012c8e7b3ca5, []int{18} +} +func (m *Penalty) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Penalty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Penalty.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 *Penalty) XXX_Merge(src proto.Message) { + xxx_messageInfo_Penalty.Merge(m, src) +} +func (m *Penalty) XXX_Size() int { + return m.Size() +} +func (m *Penalty) XXX_DiscardUnknown() { + xxx_messageInfo_Penalty.DiscardUnknown(m) +} + +var xxx_messageInfo_Penalty proto.InternalMessageInfo + +func (m *Penalty) GetInner() uint64 { + if m != nil { + return m.Inner + } + return 0 +} + +func init() { + proto.RegisterEnum("penumbra.core.stake.v1alpha1.BondingState_BondingStateEnum", BondingState_BondingStateEnum_name, BondingState_BondingStateEnum_value) + proto.RegisterEnum("penumbra.core.stake.v1alpha1.ValidatorState_ValidatorStateEnum", ValidatorState_ValidatorStateEnum_name, ValidatorState_ValidatorStateEnum_value) + proto.RegisterType((*Validator)(nil), "penumbra.core.stake.v1alpha1.Validator") + proto.RegisterType((*ValidatorList)(nil), "penumbra.core.stake.v1alpha1.ValidatorList") + proto.RegisterType((*FundingStream)(nil), "penumbra.core.stake.v1alpha1.FundingStream") + proto.RegisterType((*FundingStream_ToAddress)(nil), "penumbra.core.stake.v1alpha1.FundingStream.ToAddress") + proto.RegisterType((*FundingStream_ToDao)(nil), "penumbra.core.stake.v1alpha1.FundingStream.ToDao") + proto.RegisterType((*RateData)(nil), "penumbra.core.stake.v1alpha1.RateData") + proto.RegisterType((*BaseRateData)(nil), "penumbra.core.stake.v1alpha1.BaseRateData") + proto.RegisterType((*ValidatorStatus)(nil), "penumbra.core.stake.v1alpha1.ValidatorStatus") + proto.RegisterType((*BondingState)(nil), "penumbra.core.stake.v1alpha1.BondingState") + proto.RegisterType((*ValidatorState)(nil), "penumbra.core.stake.v1alpha1.ValidatorState") + proto.RegisterType((*ValidatorInfo)(nil), "penumbra.core.stake.v1alpha1.ValidatorInfo") + proto.RegisterType((*ValidatorDefinition)(nil), "penumbra.core.stake.v1alpha1.ValidatorDefinition") + proto.RegisterType((*Delegate)(nil), "penumbra.core.stake.v1alpha1.Delegate") + proto.RegisterType((*Undelegate)(nil), "penumbra.core.stake.v1alpha1.Undelegate") + proto.RegisterType((*UndelegateClaim)(nil), "penumbra.core.stake.v1alpha1.UndelegateClaim") + proto.RegisterType((*UndelegateClaimBody)(nil), "penumbra.core.stake.v1alpha1.UndelegateClaimBody") + proto.RegisterType((*UndelegateClaimPlan)(nil), "penumbra.core.stake.v1alpha1.UndelegateClaimPlan") + proto.RegisterType((*DelegationChanges)(nil), "penumbra.core.stake.v1alpha1.DelegationChanges") + proto.RegisterType((*Uptime)(nil), "penumbra.core.stake.v1alpha1.Uptime") + proto.RegisterType((*CurrentConsensusKeys)(nil), "penumbra.core.stake.v1alpha1.CurrentConsensusKeys") + proto.RegisterType((*Penalty)(nil), "penumbra.core.stake.v1alpha1.Penalty") +} + +func init() { + proto.RegisterFile("penumbra/core/stake/v1alpha1/stake.proto", fileDescriptor_022d012c8e7b3ca5) +} + +var fileDescriptor_022d012c8e7b3ca5 = []byte{ + // 1554 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0xcd, 0x6f, 0x23, 0x49, + 0x15, 0x4f, 0x3b, 0x76, 0x12, 0x3f, 0x7f, 0xa6, 0x66, 0x01, 0xcf, 0x30, 0x93, 0x78, 0x7b, 0x81, + 0x35, 0x33, 0x83, 0xc3, 0x04, 0xc1, 0x21, 0x7b, 0x58, 0xdc, 0xb6, 0x77, 0xe2, 0xdd, 0xc4, 0xf1, + 0xb6, 0x9d, 0x48, 0xa0, 0x48, 0xad, 0xb2, 0xbb, 0x62, 0x37, 0x63, 0x57, 0x99, 0xae, 0x72, 0xb2, + 0xfe, 0x0b, 0xe0, 0xc8, 0x71, 0xcf, 0x1c, 0x38, 0xac, 0xc4, 0x81, 0x13, 0x27, 0x38, 0x23, 0x4e, + 0xcb, 0x0d, 0x71, 0x42, 0x19, 0x09, 0x24, 0xfe, 0x0a, 0x54, 0xd5, 0x5d, 0xed, 0x8f, 0x7c, 0x4d, + 0x56, 0x23, 0xb4, 0xdc, 0xfa, 0x7d, 0xfd, 0xea, 0xbd, 0xdf, 0xab, 0x57, 0x5d, 0xdd, 0x50, 0x1a, + 0x13, 0x3a, 0x19, 0x75, 0x7d, 0xbc, 0xd3, 0x63, 0x3e, 0xd9, 0xe1, 0x02, 0xbf, 0x22, 0x3b, 0xe7, + 0x2f, 0xf0, 0x70, 0x3c, 0xc0, 0x2f, 0x02, 0xb1, 0x3c, 0xf6, 0x99, 0x60, 0xe8, 0xb1, 0xf6, 0x2c, + 0x4b, 0xcf, 0x72, 0x60, 0xd2, 0x9e, 0x8f, 0x9e, 0x2e, 0xe2, 0xf4, 0xfc, 0xe9, 0x58, 0xb0, 0x19, + 0x50, 0x20, 0x07, 0x48, 0xe6, 0x9f, 0x56, 0x21, 0x79, 0x82, 0x87, 0x9e, 0x8b, 0x05, 0xf3, 0xd1, + 0x21, 0xa4, 0x3d, 0x97, 0x50, 0xe1, 0x89, 0xa9, 0xf3, 0x8a, 0x4c, 0x0b, 0x46, 0xd1, 0x28, 0xa5, + 0x76, 0x9f, 0x96, 0x17, 0x97, 0x0b, 0x01, 0x34, 0x60, 0xb9, 0x11, 0x86, 0x7c, 0x42, 0xa6, 0x76, + 0xca, 0x9b, 0x09, 0xe8, 0x3d, 0xc8, 0xf4, 0x18, 0xe5, 0x84, 0xf2, 0x09, 0x57, 0x78, 0xb1, 0xa2, + 0x51, 0x4a, 0xdb, 0xe9, 0x48, 0x29, 0x9d, 0x10, 0xc4, 0x29, 0x1e, 0x91, 0xc2, 0x6a, 0xd1, 0x28, + 0x25, 0x6d, 0xf5, 0x8c, 0x0a, 0xb0, 0x7e, 0x41, 0xba, 0xdc, 0x13, 0xa4, 0x10, 0x57, 0x6a, 0x2d, + 0xa2, 0x22, 0xa4, 0x5c, 0xc2, 0x7b, 0xbe, 0x37, 0x16, 0x1e, 0xa3, 0x85, 0x84, 0xb2, 0xce, 0xab, + 0x64, 0x2c, 0xa1, 0xb8, 0x3b, 0x24, 0x6e, 0x61, 0xa3, 0x68, 0x94, 0x36, 0x6c, 0x2d, 0xa2, 0x0e, + 0xe4, 0xce, 0x26, 0xd4, 0xf5, 0x68, 0xdf, 0xe1, 0xc2, 0x27, 0x78, 0xc4, 0x0b, 0x6b, 0xc5, 0xd5, + 0x52, 0x6a, 0xf7, 0x59, 0xf9, 0x36, 0x3e, 0xcb, 0x1f, 0x05, 0x41, 0x6d, 0x15, 0x63, 0x67, 0xcf, + 0xe6, 0x45, 0x8e, 0xde, 0x87, 0x1c, 0x27, 0xbf, 0x9c, 0x10, 0xda, 0x23, 0x8e, 0x04, 0x21, 0x7e, + 0x61, 0xbd, 0x68, 0x94, 0x32, 0x76, 0x56, 0xab, 0x9b, 0x4a, 0x8b, 0xda, 0x90, 0xed, 0xb3, 0x73, + 0xe2, 0x53, 0x2c, 0x5d, 0x25, 0x1d, 0x49, 0x45, 0xef, 0xf3, 0x3b, 0xe8, 0x7d, 0x19, 0x05, 0x49, + 0x82, 0x33, 0xfd, 0x79, 0xd1, 0xec, 0x42, 0x26, 0x6a, 0xdf, 0x81, 0xc7, 0x05, 0xfa, 0x14, 0xb2, + 0xe7, 0x5a, 0x21, 0x17, 0xe1, 0x05, 0x43, 0xd5, 0x78, 0x9f, 0x26, 0x66, 0x22, 0x84, 0x4f, 0xc8, + 0x94, 0x9b, 0xbf, 0x8b, 0x41, 0x66, 0x81, 0x03, 0x74, 0x02, 0x20, 0x98, 0x83, 0x5d, 0xd7, 0x27, + 0x9c, 0x87, 0xbb, 0xe4, 0xc7, 0xf7, 0x20, 0xb1, 0xdc, 0x61, 0x95, 0x20, 0x78, 0x7f, 0xc5, 0x4e, + 0x0a, 0x2d, 0xa0, 0x8f, 0x61, 0x4d, 0x30, 0xc7, 0xc5, 0x4c, 0xed, 0x94, 0xd4, 0xee, 0x8b, 0xfb, + 0x61, 0xd6, 0x30, 0xdb, 0x5f, 0xb1, 0x13, 0x42, 0x3e, 0x3c, 0xfa, 0x29, 0x24, 0xa3, 0x55, 0xe4, + 0xa6, 0x98, 0xcf, 0x36, 0x69, 0x6b, 0x11, 0x3d, 0x84, 0x0d, 0x1f, 0x0b, 0xe2, 0x74, 0xc7, 0x5c, + 0x2d, 0x9a, 0xb1, 0xd7, 0xa5, 0x6c, 0x8d, 0xf9, 0x23, 0x13, 0x12, 0x0a, 0xf3, 0x16, 0x1f, 0x2b, + 0x05, 0x49, 0x9f, 0xf4, 0xbc, 0xb1, 0x47, 0xa8, 0x30, 0xff, 0x65, 0xc0, 0x86, 0x8d, 0x05, 0xa9, + 0x61, 0x81, 0xdf, 0xf6, 0x2c, 0x6d, 0x43, 0x8a, 0x8c, 0x59, 0x6f, 0xe0, 0x78, 0xd4, 0x25, 0x9f, + 0xa9, 0x34, 0xe2, 0x36, 0x28, 0x55, 0x43, 0x6a, 0xd0, 0x2e, 0x7c, 0x63, 0xd6, 0x78, 0x9f, 0x5c, + 0x60, 0xdf, 0x75, 0x64, 0x96, 0x6a, 0x82, 0xe2, 0xf6, 0x83, 0xc8, 0x68, 0x2b, 0x9b, 0xcc, 0x13, + 0xfd, 0x04, 0xbe, 0x35, 0x8b, 0x21, 0x9f, 0xf5, 0x06, 0x98, 0xf6, 0x49, 0x10, 0x95, 0x50, 0x51, + 0x33, 0xc8, 0x7a, 0x68, 0x95, 0x71, 0xe6, 0xaf, 0x0c, 0x48, 0x5b, 0x98, 0x93, 0xa8, 0xd8, 0xa5, + 0xec, 0x8c, 0x2b, 0xd9, 0x95, 0x20, 0xdf, 0xc5, 0x9c, 0x2c, 0x24, 0x16, 0xd4, 0x90, 0x95, 0xfa, + 0xb9, 0x9c, 0x9e, 0x03, 0x52, 0x9e, 0x8b, 0xe9, 0xac, 0x2a, 0x5f, 0x85, 0xb1, 0x90, 0xc9, 0xe7, + 0x31, 0xc8, 0x45, 0x03, 0xd0, 0x16, 0x58, 0x4c, 0xf8, 0xdb, 0x66, 0xde, 0x82, 0x04, 0x17, 0x3a, + 0xdf, 0xab, 0xe3, 0xba, 0xb4, 0x27, 0x17, 0x92, 0x21, 0x76, 0x10, 0x8a, 0xde, 0x85, 0xf4, 0x39, + 0x13, 0xf2, 0xe4, 0x19, 0xb3, 0x0b, 0xe2, 0x87, 0xe5, 0xa4, 0x02, 0x5d, 0x4b, 0xaa, 0xd0, 0x11, + 0x64, 0xba, 0x4c, 0x9f, 0x4e, 0xba, 0x6f, 0x57, 0xd3, 0x5e, 0x5a, 0xce, 0x62, 0xe1, 0x08, 0xc8, + 0xc5, 0xd2, 0xdd, 0x39, 0xc9, 0xfc, 0x73, 0x0c, 0xd2, 0xf3, 0x66, 0xf4, 0xa9, 0x2e, 0x44, 0x12, + 0x92, 0xdd, 0xfd, 0xe0, 0xcd, 0x91, 0x17, 0x84, 0x3a, 0x9d, 0x8c, 0x74, 0x5d, 0xcf, 0x21, 0x37, + 0xa1, 0x3a, 0x6d, 0xd5, 0xee, 0xa0, 0xab, 0xfb, 0x2b, 0x76, 0x36, 0x32, 0xd4, 0xa5, 0xfe, 0xd7, + 0x86, 0x61, 0x7e, 0x6e, 0x40, 0x7e, 0x19, 0x09, 0x99, 0xb0, 0x65, 0x1d, 0x35, 0x6b, 0x8d, 0xe6, + 0x4b, 0xa7, 0xdd, 0xa9, 0x74, 0xea, 0x4e, 0xbd, 0x79, 0x7c, 0xe8, 0x1c, 0x37, 0xdb, 0xad, 0x7a, + 0xb5, 0xf1, 0x51, 0xa3, 0x5e, 0xcb, 0xaf, 0xa0, 0x27, 0xf0, 0xf0, 0x1a, 0x1f, 0xa9, 0xaa, 0xd7, + 0xf2, 0x06, 0x2a, 0xc2, 0xe3, 0x6b, 0x21, 0x42, 0x65, 0x3e, 0x86, 0xb6, 0xe1, 0xdb, 0x37, 0x7a, + 0xd4, 0x6b, 0xf9, 0x55, 0x0b, 0x41, 0xde, 0x59, 0xaa, 0xc4, 0xfc, 0x5b, 0x0c, 0xb2, 0x8b, 0xed, + 0x44, 0xc7, 0x8b, 0x14, 0x7e, 0x78, 0x9f, 0xbd, 0xb0, 0x24, 0xce, 0xd1, 0x68, 0xfe, 0xdb, 0x00, + 0x74, 0xd5, 0x8a, 0xbe, 0x03, 0xc5, 0x93, 0xca, 0x41, 0xa3, 0x56, 0xe9, 0x1c, 0xd9, 0x37, 0x93, + 0xf3, 0x2e, 0x3c, 0xb9, 0xd6, 0xab, 0xd1, 0xac, 0x54, 0x3b, 0x8d, 0x93, 0x7a, 0xde, 0x90, 0xe5, + 0x5f, 0xeb, 0x12, 0x3a, 0xc4, 0x6e, 0x74, 0xf8, 0xb8, 0xd2, 0x38, 0x90, 0xfc, 0xa0, 0xf7, 0x60, + 0xfb, 0x5a, 0x87, 0xce, 0xd1, 0xa1, 0xd5, 0xee, 0x1c, 0x35, 0xeb, 0xb5, 0x7c, 0xfc, 0xc6, 0x4c, + 0x6a, 0x8d, 0x76, 0xc5, 0x92, 0x38, 0x09, 0xf3, 0xd2, 0x98, 0x7b, 0x61, 0x35, 0xe8, 0x19, 0x43, + 0x75, 0x48, 0x46, 0x87, 0x4c, 0x38, 0xaa, 0xef, 0xbf, 0x21, 0xad, 0xf6, 0x2c, 0x12, 0xd5, 0x61, + 0x8d, 0xab, 0xf1, 0x0f, 0xc7, 0xf4, 0x07, 0xf7, 0x68, 0xcd, 0x84, 0xdb, 0x61, 0x30, 0xaa, 0x42, + 0x52, 0x1d, 0xf5, 0x2e, 0x16, 0x58, 0x4d, 0x69, 0x6a, 0xf7, 0x7b, 0xb7, 0x23, 0xe9, 0x33, 0xd0, + 0x56, 0xef, 0x08, 0xf9, 0x64, 0x5e, 0xc0, 0x83, 0x08, 0xbf, 0x46, 0xce, 0x3c, 0xea, 0xa9, 0x9b, + 0xc9, 0x5b, 0xaa, 0xf4, 0x21, 0x6c, 0xe0, 0x89, 0x18, 0x38, 0xdc, 0xeb, 0x87, 0x17, 0xaa, 0x75, + 0x29, 0xb7, 0xbd, 0xbe, 0xf9, 0x45, 0x0c, 0x36, 0x6a, 0x64, 0x48, 0xfa, 0x72, 0xaf, 0xfe, 0x0c, + 0xd0, 0xec, 0x70, 0xd7, 0x07, 0xda, 0x57, 0x38, 0x0c, 0x37, 0x23, 0x14, 0xad, 0xbd, 0xfb, 0x65, + 0xd4, 0xd4, 0xe7, 0x02, 0x71, 0x1d, 0x3c, 0x62, 0x13, 0x2a, 0x42, 0x32, 0xbf, 0x7b, 0xc7, 0xc2, + 0x15, 0xe5, 0xac, 0x0f, 0x0f, 0xe2, 0x06, 0x32, 0xb2, 0x61, 0xd3, 0x0d, 0xea, 0xf2, 0x18, 0xd5, + 0x88, 0xf1, 0xfb, 0x20, 0xe6, 0x67, 0xf1, 0x81, 0xc6, 0xfc, 0x63, 0x0c, 0xe0, 0x98, 0xba, 0xff, + 0x03, 0xba, 0x9e, 0xc2, 0x26, 0x17, 0xd8, 0x17, 0xce, 0x55, 0xd2, 0x72, 0xca, 0x50, 0xff, 0xff, + 0x62, 0x8e, 0x42, 0x6e, 0x46, 0x5c, 0x75, 0x88, 0xbd, 0x11, 0xaa, 0x43, 0xbc, 0xcb, 0x5c, 0xcd, + 0xd7, 0x1d, 0xf7, 0xb6, 0xa5, 0x60, 0x8b, 0xb9, 0x53, 0x5b, 0x85, 0xa3, 0x77, 0x20, 0x31, 0xf6, + 0x19, 0x3b, 0x0b, 0x37, 0x76, 0x20, 0xc8, 0x37, 0xd9, 0x83, 0x6b, 0x62, 0xbe, 0x2e, 0x2d, 0xfb, + 0x10, 0xd6, 0xc7, 0x84, 0xe2, 0xa1, 0x98, 0xde, 0xd0, 0xaa, 0xa5, 0xf2, 0x5b, 0x81, 0xb3, 0xad, + 0xa3, 0x90, 0x23, 0xaf, 0x3c, 0x43, 0xf5, 0x59, 0xd0, 0x63, 0xa3, 0x91, 0x27, 0x46, 0x24, 0x6a, + 0xd2, 0x0f, 0xef, 0xa8, 0xc3, 0x0a, 0x02, 0xab, 0x51, 0x9c, 0xbd, 0xd9, 0x5d, 0x56, 0x99, 0xff, + 0xb8, 0x4a, 0x60, 0x6b, 0x88, 0xe9, 0xd7, 0x90, 0xc0, 0xf8, 0x57, 0x22, 0xb0, 0x05, 0xf9, 0xd9, + 0xcb, 0x3b, 0xdc, 0xe3, 0x89, 0xfb, 0xec, 0xf1, 0xd9, 0x2d, 0x26, 0x1c, 0x9b, 0xef, 0xcb, 0xfb, + 0x6a, 0xd0, 0x92, 0xee, 0xd0, 0x53, 0x96, 0xc2, 0x9a, 0xda, 0x93, 0xb9, 0x50, 0x6f, 0x85, 0x6a, + 0xf3, 0xf7, 0x06, 0x6c, 0xd6, 0xa2, 0x11, 0xa9, 0xaa, 0xbb, 0x29, 0x47, 0xfb, 0xf2, 0x43, 0x55, + 0x2b, 0xf5, 0x47, 0xd8, 0x1d, 0xaf, 0x12, 0x7d, 0x74, 0xdb, 0xf3, 0xa1, 0xa8, 0x09, 0x99, 0x09, + 0x9d, 0xc7, 0x8a, 0x29, 0xac, 0xd2, 0x9b, 0xce, 0x98, 0xbd, 0x18, 0x6e, 0x0e, 0x61, 0xed, 0x78, + 0x2c, 0xbc, 0x11, 0x41, 0xcf, 0x00, 0x61, 0xee, 0xb0, 0x33, 0xa7, 0x3b, 0x64, 0xbd, 0x57, 0xce, + 0x80, 0x78, 0xfd, 0x81, 0x08, 0x2f, 0xef, 0x39, 0xcc, 0x8f, 0xce, 0x2c, 0xa9, 0xdf, 0x57, 0x6a, + 0xf4, 0x04, 0xe0, 0xc2, 0xa3, 0x2e, 0xbb, 0x70, 0x86, 0x84, 0x86, 0x9f, 0x41, 0xc9, 0x40, 0x73, + 0x40, 0x28, 0xfa, 0x26, 0xac, 0x75, 0x3d, 0x71, 0x4e, 0x7a, 0x6a, 0x06, 0xd2, 0x76, 0x28, 0x99, + 0xbf, 0x80, 0x77, 0xaa, 0x13, 0xdf, 0x27, 0x54, 0x54, 0xe7, 0xbe, 0xfa, 0x39, 0xb2, 0x21, 0xbb, + 0xf0, 0x6f, 0x40, 0x53, 0xf4, 0xec, 0x8e, 0x86, 0xcd, 0xa3, 0xd8, 0x99, 0xf9, 0x3f, 0x09, 0xdc, + 0xdc, 0x86, 0xf5, 0x70, 0x6b, 0xc8, 0x83, 0xc4, 0xa3, 0x94, 0xf8, 0x61, 0x35, 0x81, 0x60, 0xfd, + 0x21, 0xf6, 0x97, 0xcb, 0x2d, 0xe3, 0xcb, 0xcb, 0x2d, 0xe3, 0x9f, 0x97, 0x5b, 0xc6, 0x6f, 0x5e, + 0x6f, 0xad, 0x7c, 0xf9, 0x7a, 0x6b, 0xe5, 0xef, 0xaf, 0xb7, 0x56, 0xa0, 0xd8, 0x63, 0xa3, 0x5b, + 0x19, 0xb5, 0xa0, 0x2d, 0xe5, 0x96, 0xcf, 0x04, 0x6b, 0x19, 0x3f, 0x3f, 0xe9, 0x7b, 0x62, 0x30, + 0xe9, 0x96, 0x7b, 0x6c, 0xb4, 0xd3, 0x63, 0x7c, 0xc4, 0xf8, 0x8e, 0x4f, 0x86, 0x78, 0x4a, 0xfc, + 0x9d, 0xf3, 0xdd, 0xe8, 0xb1, 0x37, 0xc0, 0x1e, 0xe5, 0x3b, 0xb7, 0xfd, 0xd8, 0xf9, 0x40, 0x89, + 0x5a, 0xfa, 0x6d, 0x6c, 0xb5, 0x55, 0x6d, 0x7f, 0x11, 0x7b, 0xdc, 0xd2, 0xa9, 0x54, 0x65, 0x2a, + 0x6a, 0xe9, 0xf2, 0x49, 0xe8, 0xf4, 0xd7, 0x99, 0xf9, 0x54, 0x9a, 0x4f, 0x95, 0xf9, 0x54, 0x9b, + 0x2f, 0x63, 0xa5, 0xdb, 0xcc, 0xa7, 0x2f, 0x5b, 0xd6, 0x21, 0x11, 0x58, 0x5e, 0x71, 0xfe, 0x13, + 0xdb, 0xd6, 0xae, 0x7b, 0x7b, 0xd2, 0x77, 0x6f, 0x4f, 0x39, 0xef, 0xed, 0x69, 0xef, 0xee, 0x9a, + 0xfa, 0x51, 0xf4, 0xa3, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xba, 0x77, 0x8b, 0xfc, 0x9e, 0x12, + 0x00, 0x00, +} + +func (m *Validator) 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 *Validator) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Validator) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.GovernanceKey != nil { + { + size, err := m.GovernanceKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if m.Enabled { + i-- + if m.Enabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + if m.SequenceNumber != 0 { + i = encodeVarintStake(dAtA, i, uint64(m.SequenceNumber)) + i-- + dAtA[i] = 0x38 + } + if len(m.FundingStreams) > 0 { + for iNdEx := len(m.FundingStreams) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FundingStreams[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintStake(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x2a + } + if len(m.Website) > 0 { + i -= len(m.Website) + copy(dAtA[i:], m.Website) + i = encodeVarintStake(dAtA, i, uint64(len(m.Website))) + i-- + dAtA[i] = 0x22 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintStake(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a + } + if len(m.ConsensusKey) > 0 { + i -= len(m.ConsensusKey) + copy(dAtA[i:], m.ConsensusKey) + i = encodeVarintStake(dAtA, i, uint64(len(m.ConsensusKey))) + i-- + dAtA[i] = 0x12 + } + if m.IdentityKey != nil { + { + size, err := m.IdentityKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ValidatorList) 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 *ValidatorList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ValidatorKeys) > 0 { + for iNdEx := len(m.ValidatorKeys) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ValidatorKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *FundingStream) 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 *FundingStream) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FundingStream) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Recipient != nil { + { + size := m.Recipient.Size() + i -= size + if _, err := m.Recipient.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *FundingStream_ToAddress_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FundingStream_ToAddress_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ToAddress != nil { + { + size, err := m.ToAddress.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *FundingStream_ToDao_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FundingStream_ToDao_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ToDao != nil { + { + size, err := m.ToDao.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *FundingStream_ToAddress) 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 *FundingStream_ToAddress) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FundingStream_ToAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.RateBps != 0 { + i = encodeVarintStake(dAtA, i, uint64(m.RateBps)) + i-- + dAtA[i] = 0x10 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintStake(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *FundingStream_ToDao) 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 *FundingStream_ToDao) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FundingStream_ToDao) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.RateBps != 0 { + i = encodeVarintStake(dAtA, i, uint64(m.RateBps)) + i-- + dAtA[i] = 0x10 + } + return len(dAtA) - i, nil +} + +func (m *RateData) 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 *RateData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RateData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ValidatorExchangeRate != 0 { + i = encodeVarintStake(dAtA, i, uint64(m.ValidatorExchangeRate)) + i-- + dAtA[i] = 0x28 + } + if m.ValidatorRewardRate != 0 { + i = encodeVarintStake(dAtA, i, uint64(m.ValidatorRewardRate)) + i-- + dAtA[i] = 0x20 + } + if m.EpochIndex != 0 { + i = encodeVarintStake(dAtA, i, uint64(m.EpochIndex)) + i-- + dAtA[i] = 0x10 + } + if m.IdentityKey != nil { + { + size, err := m.IdentityKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BaseRateData) 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 *BaseRateData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BaseRateData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BaseExchangeRate != 0 { + i = encodeVarintStake(dAtA, i, uint64(m.BaseExchangeRate)) + i-- + dAtA[i] = 0x18 + } + if m.BaseRewardRate != 0 { + i = encodeVarintStake(dAtA, i, uint64(m.BaseRewardRate)) + i-- + dAtA[i] = 0x10 + } + if m.EpochIndex != 0 { + i = encodeVarintStake(dAtA, i, uint64(m.EpochIndex)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ValidatorStatus) 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 *ValidatorStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BondingState != nil { + { + size, err := m.BondingState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.VotingPower != 0 { + i = encodeVarintStake(dAtA, i, uint64(m.VotingPower)) + i-- + dAtA[i] = 0x18 + } + if m.State != nil { + { + size, err := m.State.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.IdentityKey != nil { + { + size, err := m.IdentityKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BondingState) 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 *BondingState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BondingState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XUnbondingEpoch != nil { + { + size := m.XUnbondingEpoch.Size() + i -= size + if _, err := m.XUnbondingEpoch.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.State != 0 { + i = encodeVarintStake(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *BondingState_UnbondingEpoch) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BondingState_UnbondingEpoch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintStake(dAtA, i, uint64(m.UnbondingEpoch)) + i-- + dAtA[i] = 0x10 + return len(dAtA) - i, nil +} +func (m *ValidatorState) 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 *ValidatorState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.State != 0 { + i = encodeVarintStake(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ValidatorInfo) 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 *ValidatorInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.RateData != nil { + { + size, err := m.RateData.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Status != nil { + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Validator != nil { + { + size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ValidatorDefinition) 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 *ValidatorDefinition) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorDefinition) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AuthSig) > 0 { + i -= len(m.AuthSig) + copy(dAtA[i:], m.AuthSig) + i = encodeVarintStake(dAtA, i, uint64(len(m.AuthSig))) + i-- + dAtA[i] = 0x12 + } + if m.Validator != nil { + { + size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Delegate) 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 *Delegate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Delegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.DelegationAmount != nil { + { + size, err := m.DelegationAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.UnbondedAmount != nil { + { + size, err := m.UnbondedAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.EpochIndex != 0 { + i = encodeVarintStake(dAtA, i, uint64(m.EpochIndex)) + i-- + dAtA[i] = 0x10 + } + if m.ValidatorIdentity != nil { + { + size, err := m.ValidatorIdentity.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Undelegate) 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 *Undelegate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Undelegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.DelegationAmount != nil { + { + size, err := m.DelegationAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.UnbondedAmount != nil { + { + size, err := m.UnbondedAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.StartEpochIndex != 0 { + i = encodeVarintStake(dAtA, i, uint64(m.StartEpochIndex)) + i-- + dAtA[i] = 0x10 + } + if m.ValidatorIdentity != nil { + { + size, err := m.ValidatorIdentity.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UndelegateClaim) 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 *UndelegateClaim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UndelegateClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Proof) > 0 { + i -= len(m.Proof) + copy(dAtA[i:], m.Proof) + i = encodeVarintStake(dAtA, i, uint64(len(m.Proof))) + i-- + dAtA[i] = 0x12 + } + if m.Body != nil { + { + size, err := m.Body.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UndelegateClaimBody) 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 *UndelegateClaimBody) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UndelegateClaimBody) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BalanceCommitment != nil { + { + size, err := m.BalanceCommitment.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Penalty != nil { + { + size, err := m.Penalty.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.StartEpochIndex != 0 { + i = encodeVarintStake(dAtA, i, uint64(m.StartEpochIndex)) + i-- + dAtA[i] = 0x10 + } + if m.ValidatorIdentity != nil { + { + size, err := m.ValidatorIdentity.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UndelegateClaimPlan) 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 *UndelegateClaimPlan) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UndelegateClaimPlan) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BalanceBlinding) > 0 { + i -= len(m.BalanceBlinding) + copy(dAtA[i:], m.BalanceBlinding) + i = encodeVarintStake(dAtA, i, uint64(len(m.BalanceBlinding))) + i-- + dAtA[i] = 0x32 + } + if m.UnbondingAmount != nil { + { + size, err := m.UnbondingAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Penalty != nil { + { + size, err := m.Penalty.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.StartEpochIndex != 0 { + i = encodeVarintStake(dAtA, i, uint64(m.StartEpochIndex)) + i-- + dAtA[i] = 0x10 + } + if m.ValidatorIdentity != nil { + { + size, err := m.ValidatorIdentity.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DelegationChanges) 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 *DelegationChanges) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DelegationChanges) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Undelegations) > 0 { + for iNdEx := len(m.Undelegations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Undelegations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Delegations) > 0 { + for iNdEx := len(m.Delegations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Delegations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Uptime) 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 *Uptime) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Uptime) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Bitvec) > 0 { + i -= len(m.Bitvec) + copy(dAtA[i:], m.Bitvec) + i = encodeVarintStake(dAtA, i, uint64(len(m.Bitvec))) + i-- + dAtA[i] = 0x1a + } + if m.WindowLen != 0 { + i = encodeVarintStake(dAtA, i, uint64(m.WindowLen)) + i-- + dAtA[i] = 0x10 + } + if m.AsOfBlockHeight != 0 { + i = encodeVarintStake(dAtA, i, uint64(m.AsOfBlockHeight)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *CurrentConsensusKeys) 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 *CurrentConsensusKeys) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CurrentConsensusKeys) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ConsensusKeys) > 0 { + for iNdEx := len(m.ConsensusKeys) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ConsensusKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStake(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Penalty) 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 *Penalty) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Penalty) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Inner != 0 { + i = encodeVarintStake(dAtA, i, uint64(m.Inner)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintStake(dAtA []byte, offset int, v uint64) int { + offset -= sovStake(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Validator) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.IdentityKey != nil { + l = m.IdentityKey.Size() + n += 1 + l + sovStake(uint64(l)) + } + l = len(m.ConsensusKey) + if l > 0 { + n += 1 + l + sovStake(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovStake(uint64(l)) + } + l = len(m.Website) + if l > 0 { + n += 1 + l + sovStake(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovStake(uint64(l)) + } + if len(m.FundingStreams) > 0 { + for _, e := range m.FundingStreams { + l = e.Size() + n += 1 + l + sovStake(uint64(l)) + } + } + if m.SequenceNumber != 0 { + n += 1 + sovStake(uint64(m.SequenceNumber)) + } + if m.Enabled { + n += 2 + } + if m.GovernanceKey != nil { + l = m.GovernanceKey.Size() + n += 1 + l + sovStake(uint64(l)) + } + return n +} + +func (m *ValidatorList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ValidatorKeys) > 0 { + for _, e := range m.ValidatorKeys { + l = e.Size() + n += 1 + l + sovStake(uint64(l)) + } + } + return n +} + +func (m *FundingStream) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Recipient != nil { + n += m.Recipient.Size() + } + return n +} + +func (m *FundingStream_ToAddress_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ToAddress != nil { + l = m.ToAddress.Size() + n += 1 + l + sovStake(uint64(l)) + } + return n +} +func (m *FundingStream_ToDao_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ToDao != nil { + l = m.ToDao.Size() + n += 1 + l + sovStake(uint64(l)) + } + return n +} +func (m *FundingStream_ToAddress) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovStake(uint64(l)) + } + if m.RateBps != 0 { + n += 1 + sovStake(uint64(m.RateBps)) + } + return n +} + +func (m *FundingStream_ToDao) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RateBps != 0 { + n += 1 + sovStake(uint64(m.RateBps)) + } + return n +} + +func (m *RateData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.IdentityKey != nil { + l = m.IdentityKey.Size() + n += 1 + l + sovStake(uint64(l)) + } + if m.EpochIndex != 0 { + n += 1 + sovStake(uint64(m.EpochIndex)) + } + if m.ValidatorRewardRate != 0 { + n += 1 + sovStake(uint64(m.ValidatorRewardRate)) + } + if m.ValidatorExchangeRate != 0 { + n += 1 + sovStake(uint64(m.ValidatorExchangeRate)) + } + return n +} + +func (m *BaseRateData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.EpochIndex != 0 { + n += 1 + sovStake(uint64(m.EpochIndex)) + } + if m.BaseRewardRate != 0 { + n += 1 + sovStake(uint64(m.BaseRewardRate)) + } + if m.BaseExchangeRate != 0 { + n += 1 + sovStake(uint64(m.BaseExchangeRate)) + } + return n +} + +func (m *ValidatorStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.IdentityKey != nil { + l = m.IdentityKey.Size() + n += 1 + l + sovStake(uint64(l)) + } + if m.State != nil { + l = m.State.Size() + n += 1 + l + sovStake(uint64(l)) + } + if m.VotingPower != 0 { + n += 1 + sovStake(uint64(m.VotingPower)) + } + if m.BondingState != nil { + l = m.BondingState.Size() + n += 1 + l + sovStake(uint64(l)) + } + return n +} + +func (m *BondingState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.State != 0 { + n += 1 + sovStake(uint64(m.State)) + } + if m.XUnbondingEpoch != nil { + n += m.XUnbondingEpoch.Size() + } + return n +} + +func (m *BondingState_UnbondingEpoch) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovStake(uint64(m.UnbondingEpoch)) + return n +} +func (m *ValidatorState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.State != 0 { + n += 1 + sovStake(uint64(m.State)) + } + return n +} + +func (m *ValidatorInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Validator != nil { + l = m.Validator.Size() + n += 1 + l + sovStake(uint64(l)) + } + if m.Status != nil { + l = m.Status.Size() + n += 1 + l + sovStake(uint64(l)) + } + if m.RateData != nil { + l = m.RateData.Size() + n += 1 + l + sovStake(uint64(l)) + } + return n +} + +func (m *ValidatorDefinition) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Validator != nil { + l = m.Validator.Size() + n += 1 + l + sovStake(uint64(l)) + } + l = len(m.AuthSig) + if l > 0 { + n += 1 + l + sovStake(uint64(l)) + } + return n +} + +func (m *Delegate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ValidatorIdentity != nil { + l = m.ValidatorIdentity.Size() + n += 1 + l + sovStake(uint64(l)) + } + if m.EpochIndex != 0 { + n += 1 + sovStake(uint64(m.EpochIndex)) + } + if m.UnbondedAmount != nil { + l = m.UnbondedAmount.Size() + n += 1 + l + sovStake(uint64(l)) + } + if m.DelegationAmount != nil { + l = m.DelegationAmount.Size() + n += 1 + l + sovStake(uint64(l)) + } + return n +} + +func (m *Undelegate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ValidatorIdentity != nil { + l = m.ValidatorIdentity.Size() + n += 1 + l + sovStake(uint64(l)) + } + if m.StartEpochIndex != 0 { + n += 1 + sovStake(uint64(m.StartEpochIndex)) + } + if m.UnbondedAmount != nil { + l = m.UnbondedAmount.Size() + n += 1 + l + sovStake(uint64(l)) + } + if m.DelegationAmount != nil { + l = m.DelegationAmount.Size() + n += 1 + l + sovStake(uint64(l)) + } + return n +} + +func (m *UndelegateClaim) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Body != nil { + l = m.Body.Size() + n += 1 + l + sovStake(uint64(l)) + } + l = len(m.Proof) + if l > 0 { + n += 1 + l + sovStake(uint64(l)) + } + return n +} + +func (m *UndelegateClaimBody) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ValidatorIdentity != nil { + l = m.ValidatorIdentity.Size() + n += 1 + l + sovStake(uint64(l)) + } + if m.StartEpochIndex != 0 { + n += 1 + sovStake(uint64(m.StartEpochIndex)) + } + if m.Penalty != nil { + l = m.Penalty.Size() + n += 1 + l + sovStake(uint64(l)) + } + if m.BalanceCommitment != nil { + l = m.BalanceCommitment.Size() + n += 1 + l + sovStake(uint64(l)) + } + return n +} + +func (m *UndelegateClaimPlan) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ValidatorIdentity != nil { + l = m.ValidatorIdentity.Size() + n += 1 + l + sovStake(uint64(l)) + } + if m.StartEpochIndex != 0 { + n += 1 + sovStake(uint64(m.StartEpochIndex)) + } + if m.Penalty != nil { + l = m.Penalty.Size() + n += 1 + l + sovStake(uint64(l)) + } + if m.UnbondingAmount != nil { + l = m.UnbondingAmount.Size() + n += 1 + l + sovStake(uint64(l)) + } + l = len(m.BalanceBlinding) + if l > 0 { + n += 1 + l + sovStake(uint64(l)) + } + return n +} + +func (m *DelegationChanges) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Delegations) > 0 { + for _, e := range m.Delegations { + l = e.Size() + n += 1 + l + sovStake(uint64(l)) + } + } + if len(m.Undelegations) > 0 { + for _, e := range m.Undelegations { + l = e.Size() + n += 1 + l + sovStake(uint64(l)) + } + } + return n +} + +func (m *Uptime) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AsOfBlockHeight != 0 { + n += 1 + sovStake(uint64(m.AsOfBlockHeight)) + } + if m.WindowLen != 0 { + n += 1 + sovStake(uint64(m.WindowLen)) + } + l = len(m.Bitvec) + if l > 0 { + n += 1 + l + sovStake(uint64(l)) + } + return n +} + +func (m *CurrentConsensusKeys) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ConsensusKeys) > 0 { + for _, e := range m.ConsensusKeys { + l = e.Size() + n += 1 + l + sovStake(uint64(l)) + } + } + return n +} + +func (m *Penalty) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Inner != 0 { + n += 1 + sovStake(uint64(m.Inner)) + } + return n +} + +func sovStake(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozStake(x uint64) (n int) { + return sovStake(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Validator) 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 ErrIntOverflowStake + } + 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: Validator: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Validator: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IdentityKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.IdentityKey == nil { + m.IdentityKey = &v1alpha1.IdentityKey{} + } + if err := m.IdentityKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsensusKey = append(m.ConsensusKey[:0], dAtA[iNdEx:postIndex]...) + if m.ConsensusKey == nil { + m.ConsensusKey = []byte{} + } + iNdEx = postIndex + case 3: + 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 ErrIntOverflowStake + } + 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 ErrInvalidLengthStake + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Website", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + 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 ErrInvalidLengthStake + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Website = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + 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 ErrInvalidLengthStake + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FundingStreams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FundingStreams = append(m.FundingStreams, &FundingStream{}) + if err := m.FundingStreams[len(m.FundingStreams)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SequenceNumber", wireType) + } + m.SequenceNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SequenceNumber |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Enabled = bool(v != 0) + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GovernanceKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.GovernanceKey == nil { + m.GovernanceKey = &v1alpha1.GovernanceKey{} + } + if err := m.GovernanceKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStake(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStake + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatorList) 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 ErrIntOverflowStake + } + 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: ValidatorList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorKeys", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorKeys = append(m.ValidatorKeys, &v1alpha1.IdentityKey{}) + if err := m.ValidatorKeys[len(m.ValidatorKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStake(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStake + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FundingStream) 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 ErrIntOverflowStake + } + 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: FundingStream: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FundingStream: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ToAddress", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &FundingStream_ToAddress{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Recipient = &FundingStream_ToAddress_{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ToDao", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &FundingStream_ToDao{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Recipient = &FundingStream_ToDao_{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStake(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStake + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FundingStream_ToAddress) 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 ErrIntOverflowStake + } + 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: ToAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ToAddress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + 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 ErrInvalidLengthStake + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RateBps", wireType) + } + m.RateBps = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RateBps |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipStake(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStake + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FundingStream_ToDao) 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 ErrIntOverflowStake + } + 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: ToDao: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ToDao: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RateBps", wireType) + } + m.RateBps = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RateBps |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipStake(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStake + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RateData) 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 ErrIntOverflowStake + } + 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: RateData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RateData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IdentityKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.IdentityKey == nil { + m.IdentityKey = &v1alpha1.IdentityKey{} + } + if err := m.IdentityKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EpochIndex", wireType) + } + m.EpochIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EpochIndex |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorRewardRate", wireType) + } + m.ValidatorRewardRate = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ValidatorRewardRate |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorExchangeRate", wireType) + } + m.ValidatorExchangeRate = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ValidatorExchangeRate |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipStake(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStake + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BaseRateData) 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 ErrIntOverflowStake + } + 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: BaseRateData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BaseRateData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EpochIndex", wireType) + } + m.EpochIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EpochIndex |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseRewardRate", wireType) + } + m.BaseRewardRate = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BaseRewardRate |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseExchangeRate", wireType) + } + m.BaseExchangeRate = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BaseExchangeRate |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipStake(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStake + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatorStatus) 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 ErrIntOverflowStake + } + 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: ValidatorStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IdentityKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.IdentityKey == nil { + m.IdentityKey = &v1alpha1.IdentityKey{} + } + if err := m.IdentityKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.State == nil { + m.State = &ValidatorState{} + } + if err := m.State.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field VotingPower", wireType) + } + m.VotingPower = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.VotingPower |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BondingState", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BondingState == nil { + m.BondingState = &BondingState{} + } + if err := m.BondingState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStake(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStake + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BondingState) 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 ErrIntOverflowStake + } + 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: BondingState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BondingState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + m.State = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.State |= BondingState_BondingStateEnum(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondingEpoch", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.XUnbondingEpoch = &BondingState_UnbondingEpoch{v} + default: + iNdEx = preIndex + skippy, err := skipStake(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStake + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatorState) 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 ErrIntOverflowStake + } + 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: ValidatorState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + m.State = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.State |= ValidatorState_ValidatorStateEnum(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipStake(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStake + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatorInfo) 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 ErrIntOverflowStake + } + 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: ValidatorInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Validator == nil { + m.Validator = &Validator{} + } + if err := m.Validator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Status == nil { + m.Status = &ValidatorStatus{} + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RateData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RateData == nil { + m.RateData = &RateData{} + } + if err := m.RateData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStake(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStake + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatorDefinition) 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 ErrIntOverflowStake + } + 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: ValidatorDefinition: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorDefinition: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Validator == nil { + m.Validator = &Validator{} + } + if err := m.Validator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthSig", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AuthSig = append(m.AuthSig[:0], dAtA[iNdEx:postIndex]...) + if m.AuthSig == nil { + m.AuthSig = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStake(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStake + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Delegate) 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 ErrIntOverflowStake + } + 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: Delegate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Delegate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorIdentity", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ValidatorIdentity == nil { + m.ValidatorIdentity = &v1alpha1.IdentityKey{} + } + if err := m.ValidatorIdentity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EpochIndex", wireType) + } + m.EpochIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EpochIndex |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondedAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.UnbondedAmount == nil { + m.UnbondedAmount = &v1alpha1.Amount{} + } + if err := m.UnbondedAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegationAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DelegationAmount == nil { + m.DelegationAmount = &v1alpha1.Amount{} + } + if err := m.DelegationAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStake(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStake + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Undelegate) 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 ErrIntOverflowStake + } + 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: Undelegate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Undelegate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorIdentity", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ValidatorIdentity == nil { + m.ValidatorIdentity = &v1alpha1.IdentityKey{} + } + if err := m.ValidatorIdentity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartEpochIndex", wireType) + } + m.StartEpochIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartEpochIndex |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondedAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.UnbondedAmount == nil { + m.UnbondedAmount = &v1alpha1.Amount{} + } + if err := m.UnbondedAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegationAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DelegationAmount == nil { + m.DelegationAmount = &v1alpha1.Amount{} + } + if err := m.DelegationAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStake(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStake + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UndelegateClaim) 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 ErrIntOverflowStake + } + 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: UndelegateClaim: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UndelegateClaim: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Body", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Body == nil { + m.Body = &UndelegateClaimBody{} + } + if err := m.Body.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proof = append(m.Proof[:0], dAtA[iNdEx:postIndex]...) + if m.Proof == nil { + m.Proof = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStake(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStake + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UndelegateClaimBody) 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 ErrIntOverflowStake + } + 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: UndelegateClaimBody: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UndelegateClaimBody: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorIdentity", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ValidatorIdentity == nil { + m.ValidatorIdentity = &v1alpha1.IdentityKey{} + } + if err := m.ValidatorIdentity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartEpochIndex", wireType) + } + m.StartEpochIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartEpochIndex |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Penalty", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Penalty == nil { + m.Penalty = &Penalty{} + } + if err := m.Penalty.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BalanceCommitment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BalanceCommitment == nil { + m.BalanceCommitment = &v1alpha1.BalanceCommitment{} + } + if err := m.BalanceCommitment.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStake(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStake + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UndelegateClaimPlan) 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 ErrIntOverflowStake + } + 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: UndelegateClaimPlan: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UndelegateClaimPlan: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorIdentity", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ValidatorIdentity == nil { + m.ValidatorIdentity = &v1alpha1.IdentityKey{} + } + if err := m.ValidatorIdentity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartEpochIndex", wireType) + } + m.StartEpochIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartEpochIndex |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Penalty", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Penalty == nil { + m.Penalty = &Penalty{} + } + if err := m.Penalty.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondingAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.UnbondingAmount == nil { + m.UnbondingAmount = &v1alpha1.Amount{} + } + if err := m.UnbondingAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BalanceBlinding", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BalanceBlinding = append(m.BalanceBlinding[:0], dAtA[iNdEx:postIndex]...) + if m.BalanceBlinding == nil { + m.BalanceBlinding = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStake(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStake + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DelegationChanges) 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 ErrIntOverflowStake + } + 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: DelegationChanges: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DelegationChanges: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Delegations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Delegations = append(m.Delegations, &Delegate{}) + if err := m.Delegations[len(m.Delegations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Undelegations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Undelegations = append(m.Undelegations, &Undelegate{}) + if err := m.Undelegations[len(m.Undelegations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStake(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStake + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Uptime) 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 ErrIntOverflowStake + } + 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: Uptime: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Uptime: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AsOfBlockHeight", wireType) + } + m.AsOfBlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AsOfBlockHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WindowLen", wireType) + } + m.WindowLen = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.WindowLen |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bitvec", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bitvec = append(m.Bitvec[:0], dAtA[iNdEx:postIndex]...) + if m.Bitvec == nil { + m.Bitvec = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStake(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStake + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CurrentConsensusKeys) 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 ErrIntOverflowStake + } + 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: CurrentConsensusKeys: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CurrentConsensusKeys: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusKeys", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStake + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStake + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsensusKeys = append(m.ConsensusKeys, &v1alpha1.ConsensusKey{}) + if err := m.ConsensusKeys[len(m.ConsensusKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStake(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStake + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Penalty) 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 ErrIntOverflowStake + } + 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: Penalty: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Penalty: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + m.Inner = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStake + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Inner |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipStake(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStake + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipStake(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, ErrIntOverflowStake + } + 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, ErrIntOverflowStake + } + 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, ErrIntOverflowStake + } + 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, ErrInvalidLengthStake + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupStake + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthStake + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthStake = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowStake = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupStake = fmt.Errorf("proto: unexpected end of group") +) diff --git a/relayer/chains/penumbra/core/transaction/v1alpha1/transaction.pb.go b/relayer/chains/penumbra/core/transaction/v1alpha1/transaction.pb.go new file mode 100644 index 000000000..027751ff9 --- /dev/null +++ b/relayer/chains/penumbra/core/transaction/v1alpha1/transaction.pb.go @@ -0,0 +1,16110 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: penumbra/core/transaction/v1alpha1/transaction.proto + +package transactionv1alpha1 + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + v1alpha1 "github.com/cosmos/relayer/v2/relayer/chains/penumbra/core/crypto/v1alpha1" + v1alpha11 "github.com/cosmos/relayer/v2/relayer/chains/penumbra/core/dex/v1alpha1" + v1alpha14 "github.com/cosmos/relayer/v2/relayer/chains/penumbra/core/governance/v1alpha1" + v1alpha13 "github.com/cosmos/relayer/v2/relayer/chains/penumbra/core/ibc/v1alpha1" + v1alpha12 "github.com/cosmos/relayer/v2/relayer/chains/penumbra/core/stake/v1alpha1" + 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 + +// A Penumbra transaction. +type Transaction struct { + Body *TransactionBody `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + // The binding signature is stored separately from the transaction body that it signs. + BindingSig []byte `protobuf:"bytes,2,opt,name=binding_sig,json=bindingSig,proto3" json:"binding_sig,omitempty"` + // The root of some previous state of the state commitment tree, used as an anchor for all + // ZK state transition proofs. + Anchor *v1alpha1.MerkleRoot `protobuf:"bytes,3,opt,name=anchor,proto3" json:"anchor,omitempty"` +} + +func (m *Transaction) Reset() { *m = Transaction{} } +func (m *Transaction) String() string { return proto.CompactTextString(m) } +func (*Transaction) ProtoMessage() {} +func (*Transaction) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{0} +} +func (m *Transaction) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Transaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Transaction.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 *Transaction) XXX_Merge(src proto.Message) { + xxx_messageInfo_Transaction.Merge(m, src) +} +func (m *Transaction) XXX_Size() int { + return m.Size() +} +func (m *Transaction) XXX_DiscardUnknown() { + xxx_messageInfo_Transaction.DiscardUnknown(m) +} + +var xxx_messageInfo_Transaction proto.InternalMessageInfo + +func (m *Transaction) GetBody() *TransactionBody { + if m != nil { + return m.Body + } + return nil +} + +func (m *Transaction) GetBindingSig() []byte { + if m != nil { + return m.BindingSig + } + return nil +} + +func (m *Transaction) GetAnchor() *v1alpha1.MerkleRoot { + if m != nil { + return m.Anchor + } + return nil +} + +// A transaction ID, the Sha256 hash of a transaction. +type Id struct { + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` +} + +func (m *Id) Reset() { *m = Id{} } +func (m *Id) String() string { return proto.CompactTextString(m) } +func (*Id) ProtoMessage() {} +func (*Id) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{1} +} +func (m *Id) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Id) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Id.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 *Id) XXX_Merge(src proto.Message) { + xxx_messageInfo_Id.Merge(m, src) +} +func (m *Id) XXX_Size() int { + return m.Size() +} +func (m *Id) XXX_DiscardUnknown() { + xxx_messageInfo_Id.DiscardUnknown(m) +} + +var xxx_messageInfo_Id proto.InternalMessageInfo + +func (m *Id) GetHash() []byte { + if m != nil { + return m.Hash + } + return nil +} + +type EffectHash struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *EffectHash) Reset() { *m = EffectHash{} } +func (m *EffectHash) String() string { return proto.CompactTextString(m) } +func (*EffectHash) ProtoMessage() {} +func (*EffectHash) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{2} +} +func (m *EffectHash) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EffectHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EffectHash.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 *EffectHash) XXX_Merge(src proto.Message) { + xxx_messageInfo_EffectHash.Merge(m, src) +} +func (m *EffectHash) XXX_Size() int { + return m.Size() +} +func (m *EffectHash) XXX_DiscardUnknown() { + xxx_messageInfo_EffectHash.DiscardUnknown(m) +} + +var xxx_messageInfo_EffectHash proto.InternalMessageInfo + +func (m *EffectHash) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +// The body of a transaction. +type TransactionBody struct { + // A list of actions (state changes) performed by this transaction. + Actions []*Action `protobuf:"bytes,1,rep,name=actions,proto3" json:"actions,omitempty"` + // The maximum height that this transaction can be included in the chain. + // + // If zero, there is no maximum. + ExpiryHeight uint64 `protobuf:"varint,2,opt,name=expiry_height,json=expiryHeight,proto3" json:"expiry_height,omitempty"` + // The chain this transaction is intended for. Including this prevents + // replaying a transaction on one chain onto a different chain. + ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // The transaction fee. + Fee *v1alpha1.Fee `protobuf:"bytes,4,opt,name=fee,proto3" json:"fee,omitempty"` + // A list of clues for use with Fuzzy Message Detection. + FmdClues []*v1alpha1.Clue `protobuf:"bytes,5,rep,name=fmd_clues,json=fmdClues,proto3" json:"fmd_clues,omitempty"` + // Types that are valid to be assigned to XEncryptedMemo: + // *TransactionBody_EncryptedMemo + XEncryptedMemo isTransactionBody_XEncryptedMemo `protobuf_oneof:"_encrypted_memo"` +} + +func (m *TransactionBody) Reset() { *m = TransactionBody{} } +func (m *TransactionBody) String() string { return proto.CompactTextString(m) } +func (*TransactionBody) ProtoMessage() {} +func (*TransactionBody) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{3} +} +func (m *TransactionBody) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TransactionBody) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TransactionBody.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 *TransactionBody) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransactionBody.Merge(m, src) +} +func (m *TransactionBody) XXX_Size() int { + return m.Size() +} +func (m *TransactionBody) XXX_DiscardUnknown() { + xxx_messageInfo_TransactionBody.DiscardUnknown(m) +} + +var xxx_messageInfo_TransactionBody proto.InternalMessageInfo + +type isTransactionBody_XEncryptedMemo interface { + isTransactionBody_XEncryptedMemo() + MarshalTo([]byte) (int, error) + Size() int +} + +type TransactionBody_EncryptedMemo struct { + EncryptedMemo []byte `protobuf:"bytes,6,opt,name=encrypted_memo,json=encryptedMemo,proto3,oneof" json:"encrypted_memo,omitempty"` +} + +func (*TransactionBody_EncryptedMemo) isTransactionBody_XEncryptedMemo() {} + +func (m *TransactionBody) GetXEncryptedMemo() isTransactionBody_XEncryptedMemo { + if m != nil { + return m.XEncryptedMemo + } + return nil +} + +func (m *TransactionBody) GetActions() []*Action { + if m != nil { + return m.Actions + } + return nil +} + +func (m *TransactionBody) GetExpiryHeight() uint64 { + if m != nil { + return m.ExpiryHeight + } + return 0 +} + +func (m *TransactionBody) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + +func (m *TransactionBody) GetFee() *v1alpha1.Fee { + if m != nil { + return m.Fee + } + return nil +} + +func (m *TransactionBody) GetFmdClues() []*v1alpha1.Clue { + if m != nil { + return m.FmdClues + } + return nil +} + +func (m *TransactionBody) GetEncryptedMemo() []byte { + if x, ok := m.GetXEncryptedMemo().(*TransactionBody_EncryptedMemo); ok { + return x.EncryptedMemo + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*TransactionBody) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*TransactionBody_EncryptedMemo)(nil), + } +} + +// A state change performed by a transaction. +type Action struct { + // Types that are valid to be assigned to Action: + // *Action_Spend + // *Action_Output + // *Action_Swap + // *Action_SwapClaim + // *Action_ValidatorDefinition + // *Action_IbcAction + // *Action_ProposalSubmit + // *Action_ProposalWithdraw + // *Action_ValidatorVote + // *Action_DelegatorVote + // *Action_ProposalDepositClaim + // *Action_PositionOpen + // *Action_PositionClose + // *Action_PositionWithdraw + // *Action_PositionRewardClaim + // *Action_Delegate + // *Action_Undelegate + // *Action_UndelegateClaim + // *Action_DaoSpend + // *Action_DaoOutput + // *Action_DaoDeposit + // *Action_Ics20Withdrawal + Action isAction_Action `protobuf_oneof:"action"` +} + +func (m *Action) Reset() { *m = Action{} } +func (m *Action) String() string { return proto.CompactTextString(m) } +func (*Action) ProtoMessage() {} +func (*Action) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{4} +} +func (m *Action) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Action) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Action.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 *Action) XXX_Merge(src proto.Message) { + xxx_messageInfo_Action.Merge(m, src) +} +func (m *Action) XXX_Size() int { + return m.Size() +} +func (m *Action) XXX_DiscardUnknown() { + xxx_messageInfo_Action.DiscardUnknown(m) +} + +var xxx_messageInfo_Action proto.InternalMessageInfo + +type isAction_Action interface { + isAction_Action() + MarshalTo([]byte) (int, error) + Size() int +} + +type Action_Spend struct { + Spend *Spend `protobuf:"bytes,1,opt,name=spend,proto3,oneof" json:"spend,omitempty"` +} +type Action_Output struct { + Output *Output `protobuf:"bytes,2,opt,name=output,proto3,oneof" json:"output,omitempty"` +} +type Action_Swap struct { + Swap *v1alpha11.Swap `protobuf:"bytes,3,opt,name=swap,proto3,oneof" json:"swap,omitempty"` +} +type Action_SwapClaim struct { + SwapClaim *v1alpha11.SwapClaim `protobuf:"bytes,4,opt,name=swap_claim,json=swapClaim,proto3,oneof" json:"swap_claim,omitempty"` +} +type Action_ValidatorDefinition struct { + ValidatorDefinition *v1alpha12.ValidatorDefinition `protobuf:"bytes,16,opt,name=validator_definition,json=validatorDefinition,proto3,oneof" json:"validator_definition,omitempty"` +} +type Action_IbcAction struct { + IbcAction *v1alpha13.IbcAction `protobuf:"bytes,17,opt,name=ibc_action,json=ibcAction,proto3,oneof" json:"ibc_action,omitempty"` +} +type Action_ProposalSubmit struct { + ProposalSubmit *v1alpha14.ProposalSubmit `protobuf:"bytes,18,opt,name=proposal_submit,json=proposalSubmit,proto3,oneof" json:"proposal_submit,omitempty"` +} +type Action_ProposalWithdraw struct { + ProposalWithdraw *v1alpha14.ProposalWithdraw `protobuf:"bytes,19,opt,name=proposal_withdraw,json=proposalWithdraw,proto3,oneof" json:"proposal_withdraw,omitempty"` +} +type Action_ValidatorVote struct { + ValidatorVote *v1alpha14.ValidatorVote `protobuf:"bytes,20,opt,name=validator_vote,json=validatorVote,proto3,oneof" json:"validator_vote,omitempty"` +} +type Action_DelegatorVote struct { + DelegatorVote *v1alpha14.DelegatorVote `protobuf:"bytes,21,opt,name=delegator_vote,json=delegatorVote,proto3,oneof" json:"delegator_vote,omitempty"` +} +type Action_ProposalDepositClaim struct { + ProposalDepositClaim *v1alpha14.ProposalDepositClaim `protobuf:"bytes,22,opt,name=proposal_deposit_claim,json=proposalDepositClaim,proto3,oneof" json:"proposal_deposit_claim,omitempty"` +} +type Action_PositionOpen struct { + PositionOpen *v1alpha11.PositionOpen `protobuf:"bytes,30,opt,name=position_open,json=positionOpen,proto3,oneof" json:"position_open,omitempty"` +} +type Action_PositionClose struct { + PositionClose *v1alpha11.PositionClose `protobuf:"bytes,31,opt,name=position_close,json=positionClose,proto3,oneof" json:"position_close,omitempty"` +} +type Action_PositionWithdraw struct { + PositionWithdraw *v1alpha11.PositionWithdraw `protobuf:"bytes,32,opt,name=position_withdraw,json=positionWithdraw,proto3,oneof" json:"position_withdraw,omitempty"` +} +type Action_PositionRewardClaim struct { + PositionRewardClaim *v1alpha11.PositionRewardClaim `protobuf:"bytes,34,opt,name=position_reward_claim,json=positionRewardClaim,proto3,oneof" json:"position_reward_claim,omitempty"` +} +type Action_Delegate struct { + Delegate *v1alpha12.Delegate `protobuf:"bytes,40,opt,name=delegate,proto3,oneof" json:"delegate,omitempty"` +} +type Action_Undelegate struct { + Undelegate *v1alpha12.Undelegate `protobuf:"bytes,41,opt,name=undelegate,proto3,oneof" json:"undelegate,omitempty"` +} +type Action_UndelegateClaim struct { + UndelegateClaim *v1alpha12.UndelegateClaim `protobuf:"bytes,42,opt,name=undelegate_claim,json=undelegateClaim,proto3,oneof" json:"undelegate_claim,omitempty"` +} +type Action_DaoSpend struct { + DaoSpend *v1alpha14.DaoSpend `protobuf:"bytes,50,opt,name=dao_spend,json=daoSpend,proto3,oneof" json:"dao_spend,omitempty"` +} +type Action_DaoOutput struct { + DaoOutput *v1alpha14.DaoOutput `protobuf:"bytes,51,opt,name=dao_output,json=daoOutput,proto3,oneof" json:"dao_output,omitempty"` +} +type Action_DaoDeposit struct { + DaoDeposit *v1alpha14.DaoDeposit `protobuf:"bytes,52,opt,name=dao_deposit,json=daoDeposit,proto3,oneof" json:"dao_deposit,omitempty"` +} +type Action_Ics20Withdrawal struct { + Ics20Withdrawal *v1alpha13.Ics20Withdrawal `protobuf:"bytes,200,opt,name=ics20_withdrawal,json=ics20Withdrawal,proto3,oneof" json:"ics20_withdrawal,omitempty"` +} + +func (*Action_Spend) isAction_Action() {} +func (*Action_Output) isAction_Action() {} +func (*Action_Swap) isAction_Action() {} +func (*Action_SwapClaim) isAction_Action() {} +func (*Action_ValidatorDefinition) isAction_Action() {} +func (*Action_IbcAction) isAction_Action() {} +func (*Action_ProposalSubmit) isAction_Action() {} +func (*Action_ProposalWithdraw) isAction_Action() {} +func (*Action_ValidatorVote) isAction_Action() {} +func (*Action_DelegatorVote) isAction_Action() {} +func (*Action_ProposalDepositClaim) isAction_Action() {} +func (*Action_PositionOpen) isAction_Action() {} +func (*Action_PositionClose) isAction_Action() {} +func (*Action_PositionWithdraw) isAction_Action() {} +func (*Action_PositionRewardClaim) isAction_Action() {} +func (*Action_Delegate) isAction_Action() {} +func (*Action_Undelegate) isAction_Action() {} +func (*Action_UndelegateClaim) isAction_Action() {} +func (*Action_DaoSpend) isAction_Action() {} +func (*Action_DaoOutput) isAction_Action() {} +func (*Action_DaoDeposit) isAction_Action() {} +func (*Action_Ics20Withdrawal) isAction_Action() {} + +func (m *Action) GetAction() isAction_Action { + if m != nil { + return m.Action + } + return nil +} + +func (m *Action) GetSpend() *Spend { + if x, ok := m.GetAction().(*Action_Spend); ok { + return x.Spend + } + return nil +} + +func (m *Action) GetOutput() *Output { + if x, ok := m.GetAction().(*Action_Output); ok { + return x.Output + } + return nil +} + +func (m *Action) GetSwap() *v1alpha11.Swap { + if x, ok := m.GetAction().(*Action_Swap); ok { + return x.Swap + } + return nil +} + +func (m *Action) GetSwapClaim() *v1alpha11.SwapClaim { + if x, ok := m.GetAction().(*Action_SwapClaim); ok { + return x.SwapClaim + } + return nil +} + +func (m *Action) GetValidatorDefinition() *v1alpha12.ValidatorDefinition { + if x, ok := m.GetAction().(*Action_ValidatorDefinition); ok { + return x.ValidatorDefinition + } + return nil +} + +func (m *Action) GetIbcAction() *v1alpha13.IbcAction { + if x, ok := m.GetAction().(*Action_IbcAction); ok { + return x.IbcAction + } + return nil +} + +func (m *Action) GetProposalSubmit() *v1alpha14.ProposalSubmit { + if x, ok := m.GetAction().(*Action_ProposalSubmit); ok { + return x.ProposalSubmit + } + return nil +} + +func (m *Action) GetProposalWithdraw() *v1alpha14.ProposalWithdraw { + if x, ok := m.GetAction().(*Action_ProposalWithdraw); ok { + return x.ProposalWithdraw + } + return nil +} + +func (m *Action) GetValidatorVote() *v1alpha14.ValidatorVote { + if x, ok := m.GetAction().(*Action_ValidatorVote); ok { + return x.ValidatorVote + } + return nil +} + +func (m *Action) GetDelegatorVote() *v1alpha14.DelegatorVote { + if x, ok := m.GetAction().(*Action_DelegatorVote); ok { + return x.DelegatorVote + } + return nil +} + +func (m *Action) GetProposalDepositClaim() *v1alpha14.ProposalDepositClaim { + if x, ok := m.GetAction().(*Action_ProposalDepositClaim); ok { + return x.ProposalDepositClaim + } + return nil +} + +func (m *Action) GetPositionOpen() *v1alpha11.PositionOpen { + if x, ok := m.GetAction().(*Action_PositionOpen); ok { + return x.PositionOpen + } + return nil +} + +func (m *Action) GetPositionClose() *v1alpha11.PositionClose { + if x, ok := m.GetAction().(*Action_PositionClose); ok { + return x.PositionClose + } + return nil +} + +func (m *Action) GetPositionWithdraw() *v1alpha11.PositionWithdraw { + if x, ok := m.GetAction().(*Action_PositionWithdraw); ok { + return x.PositionWithdraw + } + return nil +} + +func (m *Action) GetPositionRewardClaim() *v1alpha11.PositionRewardClaim { + if x, ok := m.GetAction().(*Action_PositionRewardClaim); ok { + return x.PositionRewardClaim + } + return nil +} + +func (m *Action) GetDelegate() *v1alpha12.Delegate { + if x, ok := m.GetAction().(*Action_Delegate); ok { + return x.Delegate + } + return nil +} + +func (m *Action) GetUndelegate() *v1alpha12.Undelegate { + if x, ok := m.GetAction().(*Action_Undelegate); ok { + return x.Undelegate + } + return nil +} + +func (m *Action) GetUndelegateClaim() *v1alpha12.UndelegateClaim { + if x, ok := m.GetAction().(*Action_UndelegateClaim); ok { + return x.UndelegateClaim + } + return nil +} + +func (m *Action) GetDaoSpend() *v1alpha14.DaoSpend { + if x, ok := m.GetAction().(*Action_DaoSpend); ok { + return x.DaoSpend + } + return nil +} + +func (m *Action) GetDaoOutput() *v1alpha14.DaoOutput { + if x, ok := m.GetAction().(*Action_DaoOutput); ok { + return x.DaoOutput + } + return nil +} + +func (m *Action) GetDaoDeposit() *v1alpha14.DaoDeposit { + if x, ok := m.GetAction().(*Action_DaoDeposit); ok { + return x.DaoDeposit + } + return nil +} + +func (m *Action) GetIcs20Withdrawal() *v1alpha13.Ics20Withdrawal { + if x, ok := m.GetAction().(*Action_Ics20Withdrawal); ok { + return x.Ics20Withdrawal + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Action) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*Action_Spend)(nil), + (*Action_Output)(nil), + (*Action_Swap)(nil), + (*Action_SwapClaim)(nil), + (*Action_ValidatorDefinition)(nil), + (*Action_IbcAction)(nil), + (*Action_ProposalSubmit)(nil), + (*Action_ProposalWithdraw)(nil), + (*Action_ValidatorVote)(nil), + (*Action_DelegatorVote)(nil), + (*Action_ProposalDepositClaim)(nil), + (*Action_PositionOpen)(nil), + (*Action_PositionClose)(nil), + (*Action_PositionWithdraw)(nil), + (*Action_PositionRewardClaim)(nil), + (*Action_Delegate)(nil), + (*Action_Undelegate)(nil), + (*Action_UndelegateClaim)(nil), + (*Action_DaoSpend)(nil), + (*Action_DaoOutput)(nil), + (*Action_DaoDeposit)(nil), + (*Action_Ics20Withdrawal)(nil), + } +} + +// A transaction perspective is a bundle of key material and commitment openings +// that allow generating a view of a transaction from that perspective. +type TransactionPerspective struct { + PayloadKeys []*PayloadKeyWithCommitment `protobuf:"bytes,1,rep,name=payload_keys,json=payloadKeys,proto3" json:"payload_keys,omitempty"` + SpendNullifiers []*NullifierWithNote `protobuf:"bytes,2,rep,name=spend_nullifiers,json=spendNullifiers,proto3" json:"spend_nullifiers,omitempty"` + // The openings of note commitments referred to in the transaction + // but not included in the transaction. + AdviceNotes []*v1alpha1.Note `protobuf:"bytes,3,rep,name=advice_notes,json=adviceNotes,proto3" json:"advice_notes,omitempty"` + // Any relevant address views. + AddressViews []*v1alpha1.AddressView `protobuf:"bytes,4,rep,name=address_views,json=addressViews,proto3" json:"address_views,omitempty"` + // Any relevant denoms for viewed assets. + Denoms []*v1alpha1.DenomMetadata `protobuf:"bytes,5,rep,name=denoms,proto3" json:"denoms,omitempty"` + // The transaction ID associated with this TransactionPerspective + TransactionId *Id `protobuf:"bytes,6,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` +} + +func (m *TransactionPerspective) Reset() { *m = TransactionPerspective{} } +func (m *TransactionPerspective) String() string { return proto.CompactTextString(m) } +func (*TransactionPerspective) ProtoMessage() {} +func (*TransactionPerspective) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{5} +} +func (m *TransactionPerspective) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TransactionPerspective) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TransactionPerspective.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 *TransactionPerspective) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransactionPerspective.Merge(m, src) +} +func (m *TransactionPerspective) XXX_Size() int { + return m.Size() +} +func (m *TransactionPerspective) XXX_DiscardUnknown() { + xxx_messageInfo_TransactionPerspective.DiscardUnknown(m) +} + +var xxx_messageInfo_TransactionPerspective proto.InternalMessageInfo + +func (m *TransactionPerspective) GetPayloadKeys() []*PayloadKeyWithCommitment { + if m != nil { + return m.PayloadKeys + } + return nil +} + +func (m *TransactionPerspective) GetSpendNullifiers() []*NullifierWithNote { + if m != nil { + return m.SpendNullifiers + } + return nil +} + +func (m *TransactionPerspective) GetAdviceNotes() []*v1alpha1.Note { + if m != nil { + return m.AdviceNotes + } + return nil +} + +func (m *TransactionPerspective) GetAddressViews() []*v1alpha1.AddressView { + if m != nil { + return m.AddressViews + } + return nil +} + +func (m *TransactionPerspective) GetDenoms() []*v1alpha1.DenomMetadata { + if m != nil { + return m.Denoms + } + return nil +} + +func (m *TransactionPerspective) GetTransactionId() *Id { + if m != nil { + return m.TransactionId + } + return nil +} + +type PayloadKey struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *PayloadKey) Reset() { *m = PayloadKey{} } +func (m *PayloadKey) String() string { return proto.CompactTextString(m) } +func (*PayloadKey) ProtoMessage() {} +func (*PayloadKey) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{6} +} +func (m *PayloadKey) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PayloadKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PayloadKey.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 *PayloadKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_PayloadKey.Merge(m, src) +} +func (m *PayloadKey) XXX_Size() int { + return m.Size() +} +func (m *PayloadKey) XXX_DiscardUnknown() { + xxx_messageInfo_PayloadKey.DiscardUnknown(m) +} + +var xxx_messageInfo_PayloadKey proto.InternalMessageInfo + +func (m *PayloadKey) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +type PayloadKeyWithCommitment struct { + PayloadKey *PayloadKey `protobuf:"bytes,1,opt,name=payload_key,json=payloadKey,proto3" json:"payload_key,omitempty"` + Commitment *v1alpha1.StateCommitment `protobuf:"bytes,2,opt,name=commitment,proto3" json:"commitment,omitempty"` +} + +func (m *PayloadKeyWithCommitment) Reset() { *m = PayloadKeyWithCommitment{} } +func (m *PayloadKeyWithCommitment) String() string { return proto.CompactTextString(m) } +func (*PayloadKeyWithCommitment) ProtoMessage() {} +func (*PayloadKeyWithCommitment) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{7} +} +func (m *PayloadKeyWithCommitment) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PayloadKeyWithCommitment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PayloadKeyWithCommitment.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 *PayloadKeyWithCommitment) XXX_Merge(src proto.Message) { + xxx_messageInfo_PayloadKeyWithCommitment.Merge(m, src) +} +func (m *PayloadKeyWithCommitment) XXX_Size() int { + return m.Size() +} +func (m *PayloadKeyWithCommitment) XXX_DiscardUnknown() { + xxx_messageInfo_PayloadKeyWithCommitment.DiscardUnknown(m) +} + +var xxx_messageInfo_PayloadKeyWithCommitment proto.InternalMessageInfo + +func (m *PayloadKeyWithCommitment) GetPayloadKey() *PayloadKey { + if m != nil { + return m.PayloadKey + } + return nil +} + +func (m *PayloadKeyWithCommitment) GetCommitment() *v1alpha1.StateCommitment { + if m != nil { + return m.Commitment + } + return nil +} + +type NullifierWithNote struct { + Nullifier *v1alpha1.Nullifier `protobuf:"bytes,1,opt,name=nullifier,proto3" json:"nullifier,omitempty"` + Note *v1alpha1.Note `protobuf:"bytes,2,opt,name=note,proto3" json:"note,omitempty"` +} + +func (m *NullifierWithNote) Reset() { *m = NullifierWithNote{} } +func (m *NullifierWithNote) String() string { return proto.CompactTextString(m) } +func (*NullifierWithNote) ProtoMessage() {} +func (*NullifierWithNote) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{8} +} +func (m *NullifierWithNote) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NullifierWithNote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NullifierWithNote.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 *NullifierWithNote) XXX_Merge(src proto.Message) { + xxx_messageInfo_NullifierWithNote.Merge(m, src) +} +func (m *NullifierWithNote) XXX_Size() int { + return m.Size() +} +func (m *NullifierWithNote) XXX_DiscardUnknown() { + xxx_messageInfo_NullifierWithNote.DiscardUnknown(m) +} + +var xxx_messageInfo_NullifierWithNote proto.InternalMessageInfo + +func (m *NullifierWithNote) GetNullifier() *v1alpha1.Nullifier { + if m != nil { + return m.Nullifier + } + return nil +} + +func (m *NullifierWithNote) GetNote() *v1alpha1.Note { + if m != nil { + return m.Note + } + return nil +} + +// View of a Penumbra transaction. +type TransactionView struct { + // View of the transaction body + BodyView *TransactionBodyView `protobuf:"bytes,1,opt,name=body_view,json=bodyView,proto3" json:"body_view,omitempty"` + // The binding signature is stored separately from the transaction body that it signs. + BindingSig []byte `protobuf:"bytes,2,opt,name=binding_sig,json=bindingSig,proto3" json:"binding_sig,omitempty"` + // The root of some previous state of the state commitment tree, used as an anchor for all + // ZK state transition proofs. + Anchor *v1alpha1.MerkleRoot `protobuf:"bytes,3,opt,name=anchor,proto3" json:"anchor,omitempty"` +} + +func (m *TransactionView) Reset() { *m = TransactionView{} } +func (m *TransactionView) String() string { return proto.CompactTextString(m) } +func (*TransactionView) ProtoMessage() {} +func (*TransactionView) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{9} +} +func (m *TransactionView) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TransactionView) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TransactionView.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 *TransactionView) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransactionView.Merge(m, src) +} +func (m *TransactionView) XXX_Size() int { + return m.Size() +} +func (m *TransactionView) XXX_DiscardUnknown() { + xxx_messageInfo_TransactionView.DiscardUnknown(m) +} + +var xxx_messageInfo_TransactionView proto.InternalMessageInfo + +func (m *TransactionView) GetBodyView() *TransactionBodyView { + if m != nil { + return m.BodyView + } + return nil +} + +func (m *TransactionView) GetBindingSig() []byte { + if m != nil { + return m.BindingSig + } + return nil +} + +func (m *TransactionView) GetAnchor() *v1alpha1.MerkleRoot { + if m != nil { + return m.Anchor + } + return nil +} + +type TransactionBodyView struct { + // A list views into of actions (state changes) performed by this transaction. + ActionViews []*ActionView `protobuf:"bytes,1,rep,name=action_views,json=actionViews,proto3" json:"action_views,omitempty"` + // The maximum height that this transaction can be included in the chain. + // + // If zero, there is no maximum. + ExpiryHeight uint64 `protobuf:"varint,2,opt,name=expiry_height,json=expiryHeight,proto3" json:"expiry_height,omitempty"` + // The chain this transaction is intended for. Including this prevents + // replaying a transaction on one chain onto a different chain. + ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // The transaction fee. + Fee *v1alpha1.Fee `protobuf:"bytes,4,opt,name=fee,proto3" json:"fee,omitempty"` + // A list of clues for use with Fuzzy Message Detection. + FmdClues []*v1alpha1.Clue `protobuf:"bytes,5,rep,name=fmd_clues,json=fmdClues,proto3" json:"fmd_clues,omitempty"` + // Types that are valid to be assigned to XMemoView: + // + // *TransactionBodyView_MemoView + XMemoView isTransactionBodyView_XMemoView `protobuf_oneof:"_memo_view"` +} + +func (m *TransactionBodyView) Reset() { *m = TransactionBodyView{} } +func (m *TransactionBodyView) String() string { return proto.CompactTextString(m) } +func (*TransactionBodyView) ProtoMessage() {} +func (*TransactionBodyView) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{10} +} +func (m *TransactionBodyView) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TransactionBodyView) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TransactionBodyView.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 *TransactionBodyView) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransactionBodyView.Merge(m, src) +} +func (m *TransactionBodyView) XXX_Size() int { + return m.Size() +} +func (m *TransactionBodyView) XXX_DiscardUnknown() { + xxx_messageInfo_TransactionBodyView.DiscardUnknown(m) +} + +var xxx_messageInfo_TransactionBodyView proto.InternalMessageInfo + +type isTransactionBodyView_XMemoView interface { + isTransactionBodyView_XMemoView() + MarshalTo([]byte) (int, error) + Size() int +} + +type TransactionBodyView_MemoView struct { + MemoView *MemoView `protobuf:"bytes,6,opt,name=memo_view,json=memoView,proto3,oneof" json:"memo_view,omitempty"` +} + +func (*TransactionBodyView_MemoView) isTransactionBodyView_XMemoView() {} + +func (m *TransactionBodyView) GetXMemoView() isTransactionBodyView_XMemoView { + if m != nil { + return m.XMemoView + } + return nil +} + +func (m *TransactionBodyView) GetActionViews() []*ActionView { + if m != nil { + return m.ActionViews + } + return nil +} + +func (m *TransactionBodyView) GetExpiryHeight() uint64 { + if m != nil { + return m.ExpiryHeight + } + return 0 +} + +func (m *TransactionBodyView) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + +func (m *TransactionBodyView) GetFee() *v1alpha1.Fee { + if m != nil { + return m.Fee + } + return nil +} + +func (m *TransactionBodyView) GetFmdClues() []*v1alpha1.Clue { + if m != nil { + return m.FmdClues + } + return nil +} + +func (m *TransactionBodyView) GetMemoView() *MemoView { + if x, ok := m.GetXMemoView().(*TransactionBodyView_MemoView); ok { + return x.MemoView + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*TransactionBodyView) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*TransactionBodyView_MemoView)(nil), + } +} + +// A view of a specific state change action performed by a transaction. +type ActionView struct { + // Types that are valid to be assigned to ActionView: + // + // *ActionView_Spend + // *ActionView_Output + // *ActionView_Swap + // *ActionView_SwapClaim + // *ActionView_ValidatorDefinition + // *ActionView_IbcAction + // *ActionView_ProposalSubmit + // *ActionView_ProposalWithdraw + // *ActionView_ValidatorVote + // *ActionView_DelegatorVote + // *ActionView_ProposalDepositClaim + // *ActionView_PositionOpen + // *ActionView_PositionClose + // *ActionView_PositionWithdraw + // *ActionView_PositionRewardClaim + // *ActionView_Delegate + // *ActionView_Undelegate + // *ActionView_DaoSpend + // *ActionView_DaoOutput + // *ActionView_DaoDeposit + // *ActionView_UndelegateClaim + // *ActionView_Ics20Withdrawal + ActionView isActionView_ActionView `protobuf_oneof:"action_view"` +} + +func (m *ActionView) Reset() { *m = ActionView{} } +func (m *ActionView) String() string { return proto.CompactTextString(m) } +func (*ActionView) ProtoMessage() {} +func (*ActionView) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{11} +} +func (m *ActionView) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ActionView) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ActionView.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 *ActionView) XXX_Merge(src proto.Message) { + xxx_messageInfo_ActionView.Merge(m, src) +} +func (m *ActionView) XXX_Size() int { + return m.Size() +} +func (m *ActionView) XXX_DiscardUnknown() { + xxx_messageInfo_ActionView.DiscardUnknown(m) +} + +var xxx_messageInfo_ActionView proto.InternalMessageInfo + +type isActionView_ActionView interface { + isActionView_ActionView() + MarshalTo([]byte) (int, error) + Size() int +} + +type ActionView_Spend struct { + Spend *SpendView `protobuf:"bytes,1,opt,name=spend,proto3,oneof" json:"spend,omitempty"` +} +type ActionView_Output struct { + Output *OutputView `protobuf:"bytes,2,opt,name=output,proto3,oneof" json:"output,omitempty"` +} +type ActionView_Swap struct { + Swap *v1alpha11.SwapView `protobuf:"bytes,3,opt,name=swap,proto3,oneof" json:"swap,omitempty"` +} +type ActionView_SwapClaim struct { + SwapClaim *v1alpha11.SwapClaimView `protobuf:"bytes,4,opt,name=swap_claim,json=swapClaim,proto3,oneof" json:"swap_claim,omitempty"` +} +type ActionView_ValidatorDefinition struct { + ValidatorDefinition *v1alpha12.ValidatorDefinition `protobuf:"bytes,16,opt,name=validator_definition,json=validatorDefinition,proto3,oneof" json:"validator_definition,omitempty"` +} +type ActionView_IbcAction struct { + IbcAction *v1alpha13.IbcAction `protobuf:"bytes,17,opt,name=ibc_action,json=ibcAction,proto3,oneof" json:"ibc_action,omitempty"` +} +type ActionView_ProposalSubmit struct { + ProposalSubmit *v1alpha14.ProposalSubmit `protobuf:"bytes,18,opt,name=proposal_submit,json=proposalSubmit,proto3,oneof" json:"proposal_submit,omitempty"` +} +type ActionView_ProposalWithdraw struct { + ProposalWithdraw *v1alpha14.ProposalWithdraw `protobuf:"bytes,19,opt,name=proposal_withdraw,json=proposalWithdraw,proto3,oneof" json:"proposal_withdraw,omitempty"` +} +type ActionView_ValidatorVote struct { + ValidatorVote *v1alpha14.ValidatorVote `protobuf:"bytes,20,opt,name=validator_vote,json=validatorVote,proto3,oneof" json:"validator_vote,omitempty"` +} +type ActionView_DelegatorVote struct { + DelegatorVote *DelegatorVoteView `protobuf:"bytes,21,opt,name=delegator_vote,json=delegatorVote,proto3,oneof" json:"delegator_vote,omitempty"` +} +type ActionView_ProposalDepositClaim struct { + ProposalDepositClaim *v1alpha14.ProposalDepositClaim `protobuf:"bytes,22,opt,name=proposal_deposit_claim,json=proposalDepositClaim,proto3,oneof" json:"proposal_deposit_claim,omitempty"` +} +type ActionView_PositionOpen struct { + PositionOpen *v1alpha11.PositionOpen `protobuf:"bytes,30,opt,name=position_open,json=positionOpen,proto3,oneof" json:"position_open,omitempty"` +} +type ActionView_PositionClose struct { + PositionClose *v1alpha11.PositionClose `protobuf:"bytes,31,opt,name=position_close,json=positionClose,proto3,oneof" json:"position_close,omitempty"` +} +type ActionView_PositionWithdraw struct { + PositionWithdraw *v1alpha11.PositionWithdraw `protobuf:"bytes,32,opt,name=position_withdraw,json=positionWithdraw,proto3,oneof" json:"position_withdraw,omitempty"` +} +type ActionView_PositionRewardClaim struct { + PositionRewardClaim *v1alpha11.PositionRewardClaim `protobuf:"bytes,34,opt,name=position_reward_claim,json=positionRewardClaim,proto3,oneof" json:"position_reward_claim,omitempty"` +} +type ActionView_Delegate struct { + Delegate *v1alpha12.Delegate `protobuf:"bytes,41,opt,name=delegate,proto3,oneof" json:"delegate,omitempty"` +} +type ActionView_Undelegate struct { + Undelegate *v1alpha12.Undelegate `protobuf:"bytes,42,opt,name=undelegate,proto3,oneof" json:"undelegate,omitempty"` +} +type ActionView_DaoSpend struct { + DaoSpend *v1alpha14.DaoSpend `protobuf:"bytes,50,opt,name=dao_spend,json=daoSpend,proto3,oneof" json:"dao_spend,omitempty"` +} +type ActionView_DaoOutput struct { + DaoOutput *v1alpha14.DaoOutput `protobuf:"bytes,51,opt,name=dao_output,json=daoOutput,proto3,oneof" json:"dao_output,omitempty"` +} +type ActionView_DaoDeposit struct { + DaoDeposit *v1alpha14.DaoDeposit `protobuf:"bytes,52,opt,name=dao_deposit,json=daoDeposit,proto3,oneof" json:"dao_deposit,omitempty"` +} +type ActionView_UndelegateClaim struct { + UndelegateClaim *v1alpha12.UndelegateClaim `protobuf:"bytes,43,opt,name=undelegate_claim,json=undelegateClaim,proto3,oneof" json:"undelegate_claim,omitempty"` +} +type ActionView_Ics20Withdrawal struct { + Ics20Withdrawal *v1alpha13.Ics20Withdrawal `protobuf:"bytes,200,opt,name=ics20_withdrawal,json=ics20Withdrawal,proto3,oneof" json:"ics20_withdrawal,omitempty"` +} + +func (*ActionView_Spend) isActionView_ActionView() {} +func (*ActionView_Output) isActionView_ActionView() {} +func (*ActionView_Swap) isActionView_ActionView() {} +func (*ActionView_SwapClaim) isActionView_ActionView() {} +func (*ActionView_ValidatorDefinition) isActionView_ActionView() {} +func (*ActionView_IbcAction) isActionView_ActionView() {} +func (*ActionView_ProposalSubmit) isActionView_ActionView() {} +func (*ActionView_ProposalWithdraw) isActionView_ActionView() {} +func (*ActionView_ValidatorVote) isActionView_ActionView() {} +func (*ActionView_DelegatorVote) isActionView_ActionView() {} +func (*ActionView_ProposalDepositClaim) isActionView_ActionView() {} +func (*ActionView_PositionOpen) isActionView_ActionView() {} +func (*ActionView_PositionClose) isActionView_ActionView() {} +func (*ActionView_PositionWithdraw) isActionView_ActionView() {} +func (*ActionView_PositionRewardClaim) isActionView_ActionView() {} +func (*ActionView_Delegate) isActionView_ActionView() {} +func (*ActionView_Undelegate) isActionView_ActionView() {} +func (*ActionView_DaoSpend) isActionView_ActionView() {} +func (*ActionView_DaoOutput) isActionView_ActionView() {} +func (*ActionView_DaoDeposit) isActionView_ActionView() {} +func (*ActionView_UndelegateClaim) isActionView_ActionView() {} +func (*ActionView_Ics20Withdrawal) isActionView_ActionView() {} + +func (m *ActionView) GetActionView() isActionView_ActionView { + if m != nil { + return m.ActionView + } + return nil +} + +func (m *ActionView) GetSpend() *SpendView { + if x, ok := m.GetActionView().(*ActionView_Spend); ok { + return x.Spend + } + return nil +} + +func (m *ActionView) GetOutput() *OutputView { + if x, ok := m.GetActionView().(*ActionView_Output); ok { + return x.Output + } + return nil +} + +func (m *ActionView) GetSwap() *v1alpha11.SwapView { + if x, ok := m.GetActionView().(*ActionView_Swap); ok { + return x.Swap + } + return nil +} + +func (m *ActionView) GetSwapClaim() *v1alpha11.SwapClaimView { + if x, ok := m.GetActionView().(*ActionView_SwapClaim); ok { + return x.SwapClaim + } + return nil +} + +func (m *ActionView) GetValidatorDefinition() *v1alpha12.ValidatorDefinition { + if x, ok := m.GetActionView().(*ActionView_ValidatorDefinition); ok { + return x.ValidatorDefinition + } + return nil +} + +func (m *ActionView) GetIbcAction() *v1alpha13.IbcAction { + if x, ok := m.GetActionView().(*ActionView_IbcAction); ok { + return x.IbcAction + } + return nil +} + +func (m *ActionView) GetProposalSubmit() *v1alpha14.ProposalSubmit { + if x, ok := m.GetActionView().(*ActionView_ProposalSubmit); ok { + return x.ProposalSubmit + } + return nil +} + +func (m *ActionView) GetProposalWithdraw() *v1alpha14.ProposalWithdraw { + if x, ok := m.GetActionView().(*ActionView_ProposalWithdraw); ok { + return x.ProposalWithdraw + } + return nil +} + +func (m *ActionView) GetValidatorVote() *v1alpha14.ValidatorVote { + if x, ok := m.GetActionView().(*ActionView_ValidatorVote); ok { + return x.ValidatorVote + } + return nil +} + +func (m *ActionView) GetDelegatorVote() *DelegatorVoteView { + if x, ok := m.GetActionView().(*ActionView_DelegatorVote); ok { + return x.DelegatorVote + } + return nil +} + +func (m *ActionView) GetProposalDepositClaim() *v1alpha14.ProposalDepositClaim { + if x, ok := m.GetActionView().(*ActionView_ProposalDepositClaim); ok { + return x.ProposalDepositClaim + } + return nil +} + +func (m *ActionView) GetPositionOpen() *v1alpha11.PositionOpen { + if x, ok := m.GetActionView().(*ActionView_PositionOpen); ok { + return x.PositionOpen + } + return nil +} + +func (m *ActionView) GetPositionClose() *v1alpha11.PositionClose { + if x, ok := m.GetActionView().(*ActionView_PositionClose); ok { + return x.PositionClose + } + return nil +} + +func (m *ActionView) GetPositionWithdraw() *v1alpha11.PositionWithdraw { + if x, ok := m.GetActionView().(*ActionView_PositionWithdraw); ok { + return x.PositionWithdraw + } + return nil +} + +func (m *ActionView) GetPositionRewardClaim() *v1alpha11.PositionRewardClaim { + if x, ok := m.GetActionView().(*ActionView_PositionRewardClaim); ok { + return x.PositionRewardClaim + } + return nil +} + +func (m *ActionView) GetDelegate() *v1alpha12.Delegate { + if x, ok := m.GetActionView().(*ActionView_Delegate); ok { + return x.Delegate + } + return nil +} + +func (m *ActionView) GetUndelegate() *v1alpha12.Undelegate { + if x, ok := m.GetActionView().(*ActionView_Undelegate); ok { + return x.Undelegate + } + return nil +} + +func (m *ActionView) GetDaoSpend() *v1alpha14.DaoSpend { + if x, ok := m.GetActionView().(*ActionView_DaoSpend); ok { + return x.DaoSpend + } + return nil +} + +func (m *ActionView) GetDaoOutput() *v1alpha14.DaoOutput { + if x, ok := m.GetActionView().(*ActionView_DaoOutput); ok { + return x.DaoOutput + } + return nil +} + +func (m *ActionView) GetDaoDeposit() *v1alpha14.DaoDeposit { + if x, ok := m.GetActionView().(*ActionView_DaoDeposit); ok { + return x.DaoDeposit + } + return nil +} + +func (m *ActionView) GetUndelegateClaim() *v1alpha12.UndelegateClaim { + if x, ok := m.GetActionView().(*ActionView_UndelegateClaim); ok { + return x.UndelegateClaim + } + return nil +} + +func (m *ActionView) GetIcs20Withdrawal() *v1alpha13.Ics20Withdrawal { + if x, ok := m.GetActionView().(*ActionView_Ics20Withdrawal); ok { + return x.Ics20Withdrawal + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*ActionView) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*ActionView_Spend)(nil), + (*ActionView_Output)(nil), + (*ActionView_Swap)(nil), + (*ActionView_SwapClaim)(nil), + (*ActionView_ValidatorDefinition)(nil), + (*ActionView_IbcAction)(nil), + (*ActionView_ProposalSubmit)(nil), + (*ActionView_ProposalWithdraw)(nil), + (*ActionView_ValidatorVote)(nil), + (*ActionView_DelegatorVote)(nil), + (*ActionView_ProposalDepositClaim)(nil), + (*ActionView_PositionOpen)(nil), + (*ActionView_PositionClose)(nil), + (*ActionView_PositionWithdraw)(nil), + (*ActionView_PositionRewardClaim)(nil), + (*ActionView_Delegate)(nil), + (*ActionView_Undelegate)(nil), + (*ActionView_DaoSpend)(nil), + (*ActionView_DaoOutput)(nil), + (*ActionView_DaoDeposit)(nil), + (*ActionView_UndelegateClaim)(nil), + (*ActionView_Ics20Withdrawal)(nil), + } +} + +type SpendView struct { + // Types that are valid to be assigned to SpendView: + // + // *SpendView_Visible_ + // *SpendView_Opaque_ + SpendView isSpendView_SpendView `protobuf_oneof:"spend_view"` +} + +func (m *SpendView) Reset() { *m = SpendView{} } +func (m *SpendView) String() string { return proto.CompactTextString(m) } +func (*SpendView) ProtoMessage() {} +func (*SpendView) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{12} +} +func (m *SpendView) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SpendView) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SpendView.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 *SpendView) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpendView.Merge(m, src) +} +func (m *SpendView) XXX_Size() int { + return m.Size() +} +func (m *SpendView) XXX_DiscardUnknown() { + xxx_messageInfo_SpendView.DiscardUnknown(m) +} + +var xxx_messageInfo_SpendView proto.InternalMessageInfo + +type isSpendView_SpendView interface { + isSpendView_SpendView() + MarshalTo([]byte) (int, error) + Size() int +} + +type SpendView_Visible_ struct { + Visible *SpendView_Visible `protobuf:"bytes,1,opt,name=visible,proto3,oneof" json:"visible,omitempty"` +} +type SpendView_Opaque_ struct { + Opaque *SpendView_Opaque `protobuf:"bytes,2,opt,name=opaque,proto3,oneof" json:"opaque,omitempty"` +} + +func (*SpendView_Visible_) isSpendView_SpendView() {} +func (*SpendView_Opaque_) isSpendView_SpendView() {} + +func (m *SpendView) GetSpendView() isSpendView_SpendView { + if m != nil { + return m.SpendView + } + return nil +} + +func (m *SpendView) GetVisible() *SpendView_Visible { + if x, ok := m.GetSpendView().(*SpendView_Visible_); ok { + return x.Visible + } + return nil +} + +func (m *SpendView) GetOpaque() *SpendView_Opaque { + if x, ok := m.GetSpendView().(*SpendView_Opaque_); ok { + return x.Opaque + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*SpendView) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*SpendView_Visible_)(nil), + (*SpendView_Opaque_)(nil), + } +} + +type SpendView_Visible struct { + Spend *Spend `protobuf:"bytes,1,opt,name=spend,proto3" json:"spend,omitempty"` + Note *v1alpha1.NoteView `protobuf:"bytes,2,opt,name=note,proto3" json:"note,omitempty"` +} + +func (m *SpendView_Visible) Reset() { *m = SpendView_Visible{} } +func (m *SpendView_Visible) String() string { return proto.CompactTextString(m) } +func (*SpendView_Visible) ProtoMessage() {} +func (*SpendView_Visible) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{12, 0} +} +func (m *SpendView_Visible) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SpendView_Visible) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SpendView_Visible.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 *SpendView_Visible) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpendView_Visible.Merge(m, src) +} +func (m *SpendView_Visible) XXX_Size() int { + return m.Size() +} +func (m *SpendView_Visible) XXX_DiscardUnknown() { + xxx_messageInfo_SpendView_Visible.DiscardUnknown(m) +} + +var xxx_messageInfo_SpendView_Visible proto.InternalMessageInfo + +func (m *SpendView_Visible) GetSpend() *Spend { + if m != nil { + return m.Spend + } + return nil +} + +func (m *SpendView_Visible) GetNote() *v1alpha1.NoteView { + if m != nil { + return m.Note + } + return nil +} + +type SpendView_Opaque struct { + Spend *Spend `protobuf:"bytes,1,opt,name=spend,proto3" json:"spend,omitempty"` +} + +func (m *SpendView_Opaque) Reset() { *m = SpendView_Opaque{} } +func (m *SpendView_Opaque) String() string { return proto.CompactTextString(m) } +func (*SpendView_Opaque) ProtoMessage() {} +func (*SpendView_Opaque) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{12, 1} +} +func (m *SpendView_Opaque) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SpendView_Opaque) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SpendView_Opaque.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 *SpendView_Opaque) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpendView_Opaque.Merge(m, src) +} +func (m *SpendView_Opaque) XXX_Size() int { + return m.Size() +} +func (m *SpendView_Opaque) XXX_DiscardUnknown() { + xxx_messageInfo_SpendView_Opaque.DiscardUnknown(m) +} + +var xxx_messageInfo_SpendView_Opaque proto.InternalMessageInfo + +func (m *SpendView_Opaque) GetSpend() *Spend { + if m != nil { + return m.Spend + } + return nil +} + +type DelegatorVoteView struct { + // Types that are valid to be assigned to DelegatorVote: + // + // *DelegatorVoteView_Visible_ + // *DelegatorVoteView_Opaque_ + DelegatorVote isDelegatorVoteView_DelegatorVote `protobuf_oneof:"delegator_vote"` +} + +func (m *DelegatorVoteView) Reset() { *m = DelegatorVoteView{} } +func (m *DelegatorVoteView) String() string { return proto.CompactTextString(m) } +func (*DelegatorVoteView) ProtoMessage() {} +func (*DelegatorVoteView) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{13} +} +func (m *DelegatorVoteView) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DelegatorVoteView) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DelegatorVoteView.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 *DelegatorVoteView) XXX_Merge(src proto.Message) { + xxx_messageInfo_DelegatorVoteView.Merge(m, src) +} +func (m *DelegatorVoteView) XXX_Size() int { + return m.Size() +} +func (m *DelegatorVoteView) XXX_DiscardUnknown() { + xxx_messageInfo_DelegatorVoteView.DiscardUnknown(m) +} + +var xxx_messageInfo_DelegatorVoteView proto.InternalMessageInfo + +type isDelegatorVoteView_DelegatorVote interface { + isDelegatorVoteView_DelegatorVote() + MarshalTo([]byte) (int, error) + Size() int +} + +type DelegatorVoteView_Visible_ struct { + Visible *DelegatorVoteView_Visible `protobuf:"bytes,1,opt,name=visible,proto3,oneof" json:"visible,omitempty"` +} +type DelegatorVoteView_Opaque_ struct { + Opaque *DelegatorVoteView_Opaque `protobuf:"bytes,2,opt,name=opaque,proto3,oneof" json:"opaque,omitempty"` +} + +func (*DelegatorVoteView_Visible_) isDelegatorVoteView_DelegatorVote() {} +func (*DelegatorVoteView_Opaque_) isDelegatorVoteView_DelegatorVote() {} + +func (m *DelegatorVoteView) GetDelegatorVote() isDelegatorVoteView_DelegatorVote { + if m != nil { + return m.DelegatorVote + } + return nil +} + +func (m *DelegatorVoteView) GetVisible() *DelegatorVoteView_Visible { + if x, ok := m.GetDelegatorVote().(*DelegatorVoteView_Visible_); ok { + return x.Visible + } + return nil +} + +func (m *DelegatorVoteView) GetOpaque() *DelegatorVoteView_Opaque { + if x, ok := m.GetDelegatorVote().(*DelegatorVoteView_Opaque_); ok { + return x.Opaque + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*DelegatorVoteView) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*DelegatorVoteView_Visible_)(nil), + (*DelegatorVoteView_Opaque_)(nil), + } +} + +type DelegatorVoteView_Visible struct { + DelegatorVote *v1alpha14.DelegatorVote `protobuf:"bytes,1,opt,name=delegator_vote,json=delegatorVote,proto3" json:"delegator_vote,omitempty"` + Note *v1alpha1.NoteView `protobuf:"bytes,2,opt,name=note,proto3" json:"note,omitempty"` +} + +func (m *DelegatorVoteView_Visible) Reset() { *m = DelegatorVoteView_Visible{} } +func (m *DelegatorVoteView_Visible) String() string { return proto.CompactTextString(m) } +func (*DelegatorVoteView_Visible) ProtoMessage() {} +func (*DelegatorVoteView_Visible) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{13, 0} +} +func (m *DelegatorVoteView_Visible) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DelegatorVoteView_Visible) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DelegatorVoteView_Visible.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 *DelegatorVoteView_Visible) XXX_Merge(src proto.Message) { + xxx_messageInfo_DelegatorVoteView_Visible.Merge(m, src) +} +func (m *DelegatorVoteView_Visible) XXX_Size() int { + return m.Size() +} +func (m *DelegatorVoteView_Visible) XXX_DiscardUnknown() { + xxx_messageInfo_DelegatorVoteView_Visible.DiscardUnknown(m) +} + +var xxx_messageInfo_DelegatorVoteView_Visible proto.InternalMessageInfo + +func (m *DelegatorVoteView_Visible) GetDelegatorVote() *v1alpha14.DelegatorVote { + if m != nil { + return m.DelegatorVote + } + return nil +} + +func (m *DelegatorVoteView_Visible) GetNote() *v1alpha1.NoteView { + if m != nil { + return m.Note + } + return nil +} + +type DelegatorVoteView_Opaque struct { + DelegatorVote *v1alpha14.DelegatorVote `protobuf:"bytes,1,opt,name=delegator_vote,json=delegatorVote,proto3" json:"delegator_vote,omitempty"` +} + +func (m *DelegatorVoteView_Opaque) Reset() { *m = DelegatorVoteView_Opaque{} } +func (m *DelegatorVoteView_Opaque) String() string { return proto.CompactTextString(m) } +func (*DelegatorVoteView_Opaque) ProtoMessage() {} +func (*DelegatorVoteView_Opaque) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{13, 1} +} +func (m *DelegatorVoteView_Opaque) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DelegatorVoteView_Opaque) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DelegatorVoteView_Opaque.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 *DelegatorVoteView_Opaque) XXX_Merge(src proto.Message) { + xxx_messageInfo_DelegatorVoteView_Opaque.Merge(m, src) +} +func (m *DelegatorVoteView_Opaque) XXX_Size() int { + return m.Size() +} +func (m *DelegatorVoteView_Opaque) XXX_DiscardUnknown() { + xxx_messageInfo_DelegatorVoteView_Opaque.DiscardUnknown(m) +} + +var xxx_messageInfo_DelegatorVoteView_Opaque proto.InternalMessageInfo + +func (m *DelegatorVoteView_Opaque) GetDelegatorVote() *v1alpha14.DelegatorVote { + if m != nil { + return m.DelegatorVote + } + return nil +} + +type OutputView struct { + // Types that are valid to be assigned to OutputView: + // + // *OutputView_Visible_ + // *OutputView_Opaque_ + OutputView isOutputView_OutputView `protobuf_oneof:"output_view"` +} + +func (m *OutputView) Reset() { *m = OutputView{} } +func (m *OutputView) String() string { return proto.CompactTextString(m) } +func (*OutputView) ProtoMessage() {} +func (*OutputView) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{14} +} +func (m *OutputView) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OutputView) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OutputView.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 *OutputView) XXX_Merge(src proto.Message) { + xxx_messageInfo_OutputView.Merge(m, src) +} +func (m *OutputView) XXX_Size() int { + return m.Size() +} +func (m *OutputView) XXX_DiscardUnknown() { + xxx_messageInfo_OutputView.DiscardUnknown(m) +} + +var xxx_messageInfo_OutputView proto.InternalMessageInfo + +type isOutputView_OutputView interface { + isOutputView_OutputView() + MarshalTo([]byte) (int, error) + Size() int +} + +type OutputView_Visible_ struct { + Visible *OutputView_Visible `protobuf:"bytes,1,opt,name=visible,proto3,oneof" json:"visible,omitempty"` +} +type OutputView_Opaque_ struct { + Opaque *OutputView_Opaque `protobuf:"bytes,2,opt,name=opaque,proto3,oneof" json:"opaque,omitempty"` +} + +func (*OutputView_Visible_) isOutputView_OutputView() {} +func (*OutputView_Opaque_) isOutputView_OutputView() {} + +func (m *OutputView) GetOutputView() isOutputView_OutputView { + if m != nil { + return m.OutputView + } + return nil +} + +func (m *OutputView) GetVisible() *OutputView_Visible { + if x, ok := m.GetOutputView().(*OutputView_Visible_); ok { + return x.Visible + } + return nil +} + +func (m *OutputView) GetOpaque() *OutputView_Opaque { + if x, ok := m.GetOutputView().(*OutputView_Opaque_); ok { + return x.Opaque + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*OutputView) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*OutputView_Visible_)(nil), + (*OutputView_Opaque_)(nil), + } +} + +type OutputView_Visible struct { + Output *Output `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"` + Note *v1alpha1.NoteView `protobuf:"bytes,2,opt,name=note,proto3" json:"note,omitempty"` + PayloadKey *PayloadKey `protobuf:"bytes,3,opt,name=payload_key,json=payloadKey,proto3" json:"payload_key,omitempty"` +} + +func (m *OutputView_Visible) Reset() { *m = OutputView_Visible{} } +func (m *OutputView_Visible) String() string { return proto.CompactTextString(m) } +func (*OutputView_Visible) ProtoMessage() {} +func (*OutputView_Visible) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{14, 0} +} +func (m *OutputView_Visible) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OutputView_Visible) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OutputView_Visible.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 *OutputView_Visible) XXX_Merge(src proto.Message) { + xxx_messageInfo_OutputView_Visible.Merge(m, src) +} +func (m *OutputView_Visible) XXX_Size() int { + return m.Size() +} +func (m *OutputView_Visible) XXX_DiscardUnknown() { + xxx_messageInfo_OutputView_Visible.DiscardUnknown(m) +} + +var xxx_messageInfo_OutputView_Visible proto.InternalMessageInfo + +func (m *OutputView_Visible) GetOutput() *Output { + if m != nil { + return m.Output + } + return nil +} + +func (m *OutputView_Visible) GetNote() *v1alpha1.NoteView { + if m != nil { + return m.Note + } + return nil +} + +func (m *OutputView_Visible) GetPayloadKey() *PayloadKey { + if m != nil { + return m.PayloadKey + } + return nil +} + +type OutputView_Opaque struct { + Output *Output `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"` +} + +func (m *OutputView_Opaque) Reset() { *m = OutputView_Opaque{} } +func (m *OutputView_Opaque) String() string { return proto.CompactTextString(m) } +func (*OutputView_Opaque) ProtoMessage() {} +func (*OutputView_Opaque) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{14, 1} +} +func (m *OutputView_Opaque) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OutputView_Opaque) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OutputView_Opaque.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 *OutputView_Opaque) XXX_Merge(src proto.Message) { + xxx_messageInfo_OutputView_Opaque.Merge(m, src) +} +func (m *OutputView_Opaque) XXX_Size() int { + return m.Size() +} +func (m *OutputView_Opaque) XXX_DiscardUnknown() { + xxx_messageInfo_OutputView_Opaque.DiscardUnknown(m) +} + +var xxx_messageInfo_OutputView_Opaque proto.InternalMessageInfo + +func (m *OutputView_Opaque) GetOutput() *Output { + if m != nil { + return m.Output + } + return nil +} + +// Spends a shielded note. +type Spend struct { + // The effecting data of the spend. + Body *SpendBody `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + // The authorizing signature for the spend. + AuthSig *v1alpha1.SpendAuthSignature `protobuf:"bytes,2,opt,name=auth_sig,json=authSig,proto3" json:"auth_sig,omitempty"` + // The proof that the spend is well-formed is authorizing data. + Proof *v1alpha1.ZKSpendProof `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof,omitempty"` +} + +func (m *Spend) Reset() { *m = Spend{} } +func (m *Spend) String() string { return proto.CompactTextString(m) } +func (*Spend) ProtoMessage() {} +func (*Spend) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{15} +} +func (m *Spend) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Spend) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Spend.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 *Spend) XXX_Merge(src proto.Message) { + xxx_messageInfo_Spend.Merge(m, src) +} +func (m *Spend) XXX_Size() int { + return m.Size() +} +func (m *Spend) XXX_DiscardUnknown() { + xxx_messageInfo_Spend.DiscardUnknown(m) +} + +var xxx_messageInfo_Spend proto.InternalMessageInfo + +func (m *Spend) GetBody() *SpendBody { + if m != nil { + return m.Body + } + return nil +} + +func (m *Spend) GetAuthSig() *v1alpha1.SpendAuthSignature { + if m != nil { + return m.AuthSig + } + return nil +} + +func (m *Spend) GetProof() *v1alpha1.ZKSpendProof { + if m != nil { + return m.Proof + } + return nil +} + +// The body of a spend description, containing only the effecting data +// describing changes to the ledger, and not the authorizing data that allows +// those changes to be performed. +type SpendBody struct { + // A commitment to the value of the input note. + BalanceCommitment *v1alpha1.BalanceCommitment `protobuf:"bytes,1,opt,name=balance_commitment,json=balanceCommitment,proto3" json:"balance_commitment,omitempty"` + // The nullifier of the input note. + Nullifier []byte `protobuf:"bytes,3,opt,name=nullifier,proto3" json:"nullifier,omitempty"` + // The randomized validating key for the spend authorization signature. + Rk []byte `protobuf:"bytes,4,opt,name=rk,proto3" json:"rk,omitempty"` +} + +func (m *SpendBody) Reset() { *m = SpendBody{} } +func (m *SpendBody) String() string { return proto.CompactTextString(m) } +func (*SpendBody) ProtoMessage() {} +func (*SpendBody) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{16} +} +func (m *SpendBody) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SpendBody) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SpendBody.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 *SpendBody) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpendBody.Merge(m, src) +} +func (m *SpendBody) XXX_Size() int { + return m.Size() +} +func (m *SpendBody) XXX_DiscardUnknown() { + xxx_messageInfo_SpendBody.DiscardUnknown(m) +} + +var xxx_messageInfo_SpendBody proto.InternalMessageInfo + +func (m *SpendBody) GetBalanceCommitment() *v1alpha1.BalanceCommitment { + if m != nil { + return m.BalanceCommitment + } + return nil +} + +func (m *SpendBody) GetNullifier() []byte { + if m != nil { + return m.Nullifier + } + return nil +} + +func (m *SpendBody) GetRk() []byte { + if m != nil { + return m.Rk + } + return nil +} + +// Creates a new shielded note. +type Output struct { + // The effecting data for the output. + Body *OutputBody `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + // The output proof is authorizing data. + Proof *v1alpha1.ZKOutputProof `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` +} + +func (m *Output) Reset() { *m = Output{} } +func (m *Output) String() string { return proto.CompactTextString(m) } +func (*Output) ProtoMessage() {} +func (*Output) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{17} +} +func (m *Output) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Output) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Output.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 *Output) XXX_Merge(src proto.Message) { + xxx_messageInfo_Output.Merge(m, src) +} +func (m *Output) XXX_Size() int { + return m.Size() +} +func (m *Output) XXX_DiscardUnknown() { + xxx_messageInfo_Output.DiscardUnknown(m) +} + +var xxx_messageInfo_Output proto.InternalMessageInfo + +func (m *Output) GetBody() *OutputBody { + if m != nil { + return m.Body + } + return nil +} + +func (m *Output) GetProof() *v1alpha1.ZKOutputProof { + if m != nil { + return m.Proof + } + return nil +} + +// The body of an output description, containing only the effecting data +// describing changes to the ledger, and not the authorizing data that allows +// those changes to be performed. +type OutputBody struct { + // The minimal data required to scan and process the new output note. + NotePayload *v1alpha1.NotePayload `protobuf:"bytes,1,opt,name=note_payload,json=notePayload,proto3" json:"note_payload,omitempty"` + // A commitment to the value of the output note. 32 bytes. + BalanceCommitment *v1alpha1.BalanceCommitment `protobuf:"bytes,2,opt,name=balance_commitment,json=balanceCommitment,proto3" json:"balance_commitment,omitempty"` + // An encrypted key for decrypting the memo. + WrappedMemoKey []byte `protobuf:"bytes,3,opt,name=wrapped_memo_key,json=wrappedMemoKey,proto3" json:"wrapped_memo_key,omitempty"` + // The key material used for note encryption, wrapped in encryption to the + // sender's outgoing viewing key. 80 bytes. + OvkWrappedKey []byte `protobuf:"bytes,4,opt,name=ovk_wrapped_key,json=ovkWrappedKey,proto3" json:"ovk_wrapped_key,omitempty"` +} + +func (m *OutputBody) Reset() { *m = OutputBody{} } +func (m *OutputBody) String() string { return proto.CompactTextString(m) } +func (*OutputBody) ProtoMessage() {} +func (*OutputBody) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{18} +} +func (m *OutputBody) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OutputBody) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OutputBody.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 *OutputBody) XXX_Merge(src proto.Message) { + xxx_messageInfo_OutputBody.Merge(m, src) +} +func (m *OutputBody) XXX_Size() int { + return m.Size() +} +func (m *OutputBody) XXX_DiscardUnknown() { + xxx_messageInfo_OutputBody.DiscardUnknown(m) +} + +var xxx_messageInfo_OutputBody proto.InternalMessageInfo + +func (m *OutputBody) GetNotePayload() *v1alpha1.NotePayload { + if m != nil { + return m.NotePayload + } + return nil +} + +func (m *OutputBody) GetBalanceCommitment() *v1alpha1.BalanceCommitment { + if m != nil { + return m.BalanceCommitment + } + return nil +} + +func (m *OutputBody) GetWrappedMemoKey() []byte { + if m != nil { + return m.WrappedMemoKey + } + return nil +} + +func (m *OutputBody) GetOvkWrappedKey() []byte { + if m != nil { + return m.OvkWrappedKey + } + return nil +} + +// The data required to authorize a transaction plan. +type AuthorizationData struct { + // The computed auth hash for the approved transaction plan. + EffectHash *v1alpha1.EffectHash `protobuf:"bytes,1,opt,name=effect_hash,json=effectHash,proto3" json:"effect_hash,omitempty"` + // The required spend authorizations, returned in the same order as the + // Spend actions in the original request. + SpendAuths []*v1alpha1.SpendAuthSignature `protobuf:"bytes,2,rep,name=spend_auths,json=spendAuths,proto3" json:"spend_auths,omitempty"` + // The required delegator vote authorizations, returned in the same order as the + // DelegatorVote actions in the original request. + DelegatorVoteAuths []*v1alpha1.SpendAuthSignature `protobuf:"bytes,3,rep,name=delegator_vote_auths,json=delegatorVoteAuths,proto3" json:"delegator_vote_auths,omitempty"` +} + +func (m *AuthorizationData) Reset() { *m = AuthorizationData{} } +func (m *AuthorizationData) String() string { return proto.CompactTextString(m) } +func (*AuthorizationData) ProtoMessage() {} +func (*AuthorizationData) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{19} +} +func (m *AuthorizationData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthorizationData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthorizationData.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 *AuthorizationData) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthorizationData.Merge(m, src) +} +func (m *AuthorizationData) XXX_Size() int { + return m.Size() +} +func (m *AuthorizationData) XXX_DiscardUnknown() { + xxx_messageInfo_AuthorizationData.DiscardUnknown(m) +} + +var xxx_messageInfo_AuthorizationData proto.InternalMessageInfo + +func (m *AuthorizationData) GetEffectHash() *v1alpha1.EffectHash { + if m != nil { + return m.EffectHash + } + return nil +} + +func (m *AuthorizationData) GetSpendAuths() []*v1alpha1.SpendAuthSignature { + if m != nil { + return m.SpendAuths + } + return nil +} + +func (m *AuthorizationData) GetDelegatorVoteAuths() []*v1alpha1.SpendAuthSignature { + if m != nil { + return m.DelegatorVoteAuths + } + return nil +} + +// The data required for proving when building a transaction from a plan. +type WitnessData struct { + // The anchor for the state transition proofs. + Anchor *v1alpha1.MerkleRoot `protobuf:"bytes,1,opt,name=anchor,proto3" json:"anchor,omitempty"` + // The auth paths for the notes the transaction spends, in the + // same order as the spends in the transaction plan. + StateCommitmentProofs []*v1alpha1.StateCommitmentProof `protobuf:"bytes,2,rep,name=state_commitment_proofs,json=stateCommitmentProofs,proto3" json:"state_commitment_proofs,omitempty"` +} + +func (m *WitnessData) Reset() { *m = WitnessData{} } +func (m *WitnessData) String() string { return proto.CompactTextString(m) } +func (*WitnessData) ProtoMessage() {} +func (*WitnessData) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{20} +} +func (m *WitnessData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WitnessData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WitnessData.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 *WitnessData) XXX_Merge(src proto.Message) { + xxx_messageInfo_WitnessData.Merge(m, src) +} +func (m *WitnessData) XXX_Size() int { + return m.Size() +} +func (m *WitnessData) XXX_DiscardUnknown() { + xxx_messageInfo_WitnessData.DiscardUnknown(m) +} + +var xxx_messageInfo_WitnessData proto.InternalMessageInfo + +func (m *WitnessData) GetAnchor() *v1alpha1.MerkleRoot { + if m != nil { + return m.Anchor + } + return nil +} + +func (m *WitnessData) GetStateCommitmentProofs() []*v1alpha1.StateCommitmentProof { + if m != nil { + return m.StateCommitmentProofs + } + return nil +} + +// Describes a planned transaction. +type TransactionPlan struct { + Actions []*ActionPlan `protobuf:"bytes,1,rep,name=actions,proto3" json:"actions,omitempty"` + ExpiryHeight uint64 `protobuf:"varint,2,opt,name=expiry_height,json=expiryHeight,proto3" json:"expiry_height,omitempty"` + ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + Fee *v1alpha1.Fee `protobuf:"bytes,4,opt,name=fee,proto3" json:"fee,omitempty"` + CluePlans []*CluePlan `protobuf:"bytes,5,rep,name=clue_plans,json=cluePlans,proto3" json:"clue_plans,omitempty"` + MemoPlan *MemoPlan `protobuf:"bytes,6,opt,name=memo_plan,json=memoPlan,proto3" json:"memo_plan,omitempty"` +} + +func (m *TransactionPlan) Reset() { *m = TransactionPlan{} } +func (m *TransactionPlan) String() string { return proto.CompactTextString(m) } +func (*TransactionPlan) ProtoMessage() {} +func (*TransactionPlan) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{21} +} +func (m *TransactionPlan) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TransactionPlan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TransactionPlan.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 *TransactionPlan) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransactionPlan.Merge(m, src) +} +func (m *TransactionPlan) XXX_Size() int { + return m.Size() +} +func (m *TransactionPlan) XXX_DiscardUnknown() { + xxx_messageInfo_TransactionPlan.DiscardUnknown(m) +} + +var xxx_messageInfo_TransactionPlan proto.InternalMessageInfo + +func (m *TransactionPlan) GetActions() []*ActionPlan { + if m != nil { + return m.Actions + } + return nil +} + +func (m *TransactionPlan) GetExpiryHeight() uint64 { + if m != nil { + return m.ExpiryHeight + } + return 0 +} + +func (m *TransactionPlan) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + +func (m *TransactionPlan) GetFee() *v1alpha1.Fee { + if m != nil { + return m.Fee + } + return nil +} + +func (m *TransactionPlan) GetCluePlans() []*CluePlan { + if m != nil { + return m.CluePlans + } + return nil +} + +func (m *TransactionPlan) GetMemoPlan() *MemoPlan { + if m != nil { + return m.MemoPlan + } + return nil +} + +// Describes a planned transaction action. +// +// Some transaction Actions don't have any private data and are treated as being plans +// themselves. +type ActionPlan struct { + // Types that are valid to be assigned to Action: + // + // *ActionPlan_Spend + // *ActionPlan_Output + // *ActionPlan_Swap + // *ActionPlan_SwapClaim + // *ActionPlan_ValidatorDefinition + // *ActionPlan_IbcAction + // *ActionPlan_ProposalSubmit + // *ActionPlan_ProposalWithdraw + // *ActionPlan_ValidatorVote + // *ActionPlan_DelegatorVote + // *ActionPlan_ProposalDepositClaim + // *ActionPlan_Withdrawal + // *ActionPlan_PositionOpen + // *ActionPlan_PositionClose + // *ActionPlan_PositionWithdraw + // *ActionPlan_PositionRewardClaim + // *ActionPlan_Delegate + // *ActionPlan_Undelegate + // *ActionPlan_UndelegateClaim + // *ActionPlan_DaoSpend + // *ActionPlan_DaoOutput + // *ActionPlan_DaoDeposit + Action isActionPlan_Action `protobuf_oneof:"action"` +} + +func (m *ActionPlan) Reset() { *m = ActionPlan{} } +func (m *ActionPlan) String() string { return proto.CompactTextString(m) } +func (*ActionPlan) ProtoMessage() {} +func (*ActionPlan) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{22} +} +func (m *ActionPlan) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ActionPlan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ActionPlan.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 *ActionPlan) XXX_Merge(src proto.Message) { + xxx_messageInfo_ActionPlan.Merge(m, src) +} +func (m *ActionPlan) XXX_Size() int { + return m.Size() +} +func (m *ActionPlan) XXX_DiscardUnknown() { + xxx_messageInfo_ActionPlan.DiscardUnknown(m) +} + +var xxx_messageInfo_ActionPlan proto.InternalMessageInfo + +type isActionPlan_Action interface { + isActionPlan_Action() + MarshalTo([]byte) (int, error) + Size() int +} + +type ActionPlan_Spend struct { + Spend *SpendPlan `protobuf:"bytes,1,opt,name=spend,proto3,oneof" json:"spend,omitempty"` +} +type ActionPlan_Output struct { + Output *OutputPlan `protobuf:"bytes,2,opt,name=output,proto3,oneof" json:"output,omitempty"` +} +type ActionPlan_Swap struct { + Swap *v1alpha11.SwapPlan `protobuf:"bytes,3,opt,name=swap,proto3,oneof" json:"swap,omitempty"` +} +type ActionPlan_SwapClaim struct { + SwapClaim *v1alpha11.SwapClaimPlan `protobuf:"bytes,4,opt,name=swap_claim,json=swapClaim,proto3,oneof" json:"swap_claim,omitempty"` +} +type ActionPlan_ValidatorDefinition struct { + ValidatorDefinition *v1alpha12.ValidatorDefinition `protobuf:"bytes,16,opt,name=validator_definition,json=validatorDefinition,proto3,oneof" json:"validator_definition,omitempty"` +} +type ActionPlan_IbcAction struct { + IbcAction *v1alpha13.IbcAction `protobuf:"bytes,17,opt,name=ibc_action,json=ibcAction,proto3,oneof" json:"ibc_action,omitempty"` +} +type ActionPlan_ProposalSubmit struct { + ProposalSubmit *v1alpha14.ProposalSubmit `protobuf:"bytes,18,opt,name=proposal_submit,json=proposalSubmit,proto3,oneof" json:"proposal_submit,omitempty"` +} +type ActionPlan_ProposalWithdraw struct { + ProposalWithdraw *v1alpha14.ProposalWithdraw `protobuf:"bytes,19,opt,name=proposal_withdraw,json=proposalWithdraw,proto3,oneof" json:"proposal_withdraw,omitempty"` +} +type ActionPlan_ValidatorVote struct { + ValidatorVote *v1alpha14.ValidatorVote `protobuf:"bytes,20,opt,name=validator_vote,json=validatorVote,proto3,oneof" json:"validator_vote,omitempty"` +} +type ActionPlan_DelegatorVote struct { + DelegatorVote *v1alpha14.DelegatorVotePlan `protobuf:"bytes,21,opt,name=delegator_vote,json=delegatorVote,proto3,oneof" json:"delegator_vote,omitempty"` +} +type ActionPlan_ProposalDepositClaim struct { + ProposalDepositClaim *v1alpha14.ProposalDepositClaim `protobuf:"bytes,22,opt,name=proposal_deposit_claim,json=proposalDepositClaim,proto3,oneof" json:"proposal_deposit_claim,omitempty"` +} +type ActionPlan_Withdrawal struct { + Withdrawal *v1alpha13.Ics20Withdrawal `protobuf:"bytes,23,opt,name=withdrawal,proto3,oneof" json:"withdrawal,omitempty"` +} +type ActionPlan_PositionOpen struct { + PositionOpen *v1alpha11.PositionOpen `protobuf:"bytes,30,opt,name=position_open,json=positionOpen,proto3,oneof" json:"position_open,omitempty"` +} +type ActionPlan_PositionClose struct { + PositionClose *v1alpha11.PositionClose `protobuf:"bytes,31,opt,name=position_close,json=positionClose,proto3,oneof" json:"position_close,omitempty"` +} +type ActionPlan_PositionWithdraw struct { + PositionWithdraw *v1alpha11.PositionWithdrawPlan `protobuf:"bytes,32,opt,name=position_withdraw,json=positionWithdraw,proto3,oneof" json:"position_withdraw,omitempty"` +} +type ActionPlan_PositionRewardClaim struct { + PositionRewardClaim *v1alpha11.PositionRewardClaimPlan `protobuf:"bytes,34,opt,name=position_reward_claim,json=positionRewardClaim,proto3,oneof" json:"position_reward_claim,omitempty"` +} +type ActionPlan_Delegate struct { + Delegate *v1alpha12.Delegate `protobuf:"bytes,40,opt,name=delegate,proto3,oneof" json:"delegate,omitempty"` +} +type ActionPlan_Undelegate struct { + Undelegate *v1alpha12.Undelegate `protobuf:"bytes,41,opt,name=undelegate,proto3,oneof" json:"undelegate,omitempty"` +} +type ActionPlan_UndelegateClaim struct { + UndelegateClaim *v1alpha12.UndelegateClaimPlan `protobuf:"bytes,42,opt,name=undelegate_claim,json=undelegateClaim,proto3,oneof" json:"undelegate_claim,omitempty"` +} +type ActionPlan_DaoSpend struct { + DaoSpend *v1alpha14.DaoSpend `protobuf:"bytes,50,opt,name=dao_spend,json=daoSpend,proto3,oneof" json:"dao_spend,omitempty"` +} +type ActionPlan_DaoOutput struct { + DaoOutput *v1alpha14.DaoOutput `protobuf:"bytes,51,opt,name=dao_output,json=daoOutput,proto3,oneof" json:"dao_output,omitempty"` +} +type ActionPlan_DaoDeposit struct { + DaoDeposit *v1alpha14.DaoDeposit `protobuf:"bytes,52,opt,name=dao_deposit,json=daoDeposit,proto3,oneof" json:"dao_deposit,omitempty"` +} + +func (*ActionPlan_Spend) isActionPlan_Action() {} +func (*ActionPlan_Output) isActionPlan_Action() {} +func (*ActionPlan_Swap) isActionPlan_Action() {} +func (*ActionPlan_SwapClaim) isActionPlan_Action() {} +func (*ActionPlan_ValidatorDefinition) isActionPlan_Action() {} +func (*ActionPlan_IbcAction) isActionPlan_Action() {} +func (*ActionPlan_ProposalSubmit) isActionPlan_Action() {} +func (*ActionPlan_ProposalWithdraw) isActionPlan_Action() {} +func (*ActionPlan_ValidatorVote) isActionPlan_Action() {} +func (*ActionPlan_DelegatorVote) isActionPlan_Action() {} +func (*ActionPlan_ProposalDepositClaim) isActionPlan_Action() {} +func (*ActionPlan_Withdrawal) isActionPlan_Action() {} +func (*ActionPlan_PositionOpen) isActionPlan_Action() {} +func (*ActionPlan_PositionClose) isActionPlan_Action() {} +func (*ActionPlan_PositionWithdraw) isActionPlan_Action() {} +func (*ActionPlan_PositionRewardClaim) isActionPlan_Action() {} +func (*ActionPlan_Delegate) isActionPlan_Action() {} +func (*ActionPlan_Undelegate) isActionPlan_Action() {} +func (*ActionPlan_UndelegateClaim) isActionPlan_Action() {} +func (*ActionPlan_DaoSpend) isActionPlan_Action() {} +func (*ActionPlan_DaoOutput) isActionPlan_Action() {} +func (*ActionPlan_DaoDeposit) isActionPlan_Action() {} + +func (m *ActionPlan) GetAction() isActionPlan_Action { + if m != nil { + return m.Action + } + return nil +} + +func (m *ActionPlan) GetSpend() *SpendPlan { + if x, ok := m.GetAction().(*ActionPlan_Spend); ok { + return x.Spend + } + return nil +} + +func (m *ActionPlan) GetOutput() *OutputPlan { + if x, ok := m.GetAction().(*ActionPlan_Output); ok { + return x.Output + } + return nil +} + +func (m *ActionPlan) GetSwap() *v1alpha11.SwapPlan { + if x, ok := m.GetAction().(*ActionPlan_Swap); ok { + return x.Swap + } + return nil +} + +func (m *ActionPlan) GetSwapClaim() *v1alpha11.SwapClaimPlan { + if x, ok := m.GetAction().(*ActionPlan_SwapClaim); ok { + return x.SwapClaim + } + return nil +} + +func (m *ActionPlan) GetValidatorDefinition() *v1alpha12.ValidatorDefinition { + if x, ok := m.GetAction().(*ActionPlan_ValidatorDefinition); ok { + return x.ValidatorDefinition + } + return nil +} + +func (m *ActionPlan) GetIbcAction() *v1alpha13.IbcAction { + if x, ok := m.GetAction().(*ActionPlan_IbcAction); ok { + return x.IbcAction + } + return nil +} + +func (m *ActionPlan) GetProposalSubmit() *v1alpha14.ProposalSubmit { + if x, ok := m.GetAction().(*ActionPlan_ProposalSubmit); ok { + return x.ProposalSubmit + } + return nil +} + +func (m *ActionPlan) GetProposalWithdraw() *v1alpha14.ProposalWithdraw { + if x, ok := m.GetAction().(*ActionPlan_ProposalWithdraw); ok { + return x.ProposalWithdraw + } + return nil +} + +func (m *ActionPlan) GetValidatorVote() *v1alpha14.ValidatorVote { + if x, ok := m.GetAction().(*ActionPlan_ValidatorVote); ok { + return x.ValidatorVote + } + return nil +} + +func (m *ActionPlan) GetDelegatorVote() *v1alpha14.DelegatorVotePlan { + if x, ok := m.GetAction().(*ActionPlan_DelegatorVote); ok { + return x.DelegatorVote + } + return nil +} + +func (m *ActionPlan) GetProposalDepositClaim() *v1alpha14.ProposalDepositClaim { + if x, ok := m.GetAction().(*ActionPlan_ProposalDepositClaim); ok { + return x.ProposalDepositClaim + } + return nil +} + +func (m *ActionPlan) GetWithdrawal() *v1alpha13.Ics20Withdrawal { + if x, ok := m.GetAction().(*ActionPlan_Withdrawal); ok { + return x.Withdrawal + } + return nil +} + +func (m *ActionPlan) GetPositionOpen() *v1alpha11.PositionOpen { + if x, ok := m.GetAction().(*ActionPlan_PositionOpen); ok { + return x.PositionOpen + } + return nil +} + +func (m *ActionPlan) GetPositionClose() *v1alpha11.PositionClose { + if x, ok := m.GetAction().(*ActionPlan_PositionClose); ok { + return x.PositionClose + } + return nil +} + +func (m *ActionPlan) GetPositionWithdraw() *v1alpha11.PositionWithdrawPlan { + if x, ok := m.GetAction().(*ActionPlan_PositionWithdraw); ok { + return x.PositionWithdraw + } + return nil +} + +func (m *ActionPlan) GetPositionRewardClaim() *v1alpha11.PositionRewardClaimPlan { + if x, ok := m.GetAction().(*ActionPlan_PositionRewardClaim); ok { + return x.PositionRewardClaim + } + return nil +} + +func (m *ActionPlan) GetDelegate() *v1alpha12.Delegate { + if x, ok := m.GetAction().(*ActionPlan_Delegate); ok { + return x.Delegate + } + return nil +} + +func (m *ActionPlan) GetUndelegate() *v1alpha12.Undelegate { + if x, ok := m.GetAction().(*ActionPlan_Undelegate); ok { + return x.Undelegate + } + return nil +} + +func (m *ActionPlan) GetUndelegateClaim() *v1alpha12.UndelegateClaimPlan { + if x, ok := m.GetAction().(*ActionPlan_UndelegateClaim); ok { + return x.UndelegateClaim + } + return nil +} + +func (m *ActionPlan) GetDaoSpend() *v1alpha14.DaoSpend { + if x, ok := m.GetAction().(*ActionPlan_DaoSpend); ok { + return x.DaoSpend + } + return nil +} + +func (m *ActionPlan) GetDaoOutput() *v1alpha14.DaoOutput { + if x, ok := m.GetAction().(*ActionPlan_DaoOutput); ok { + return x.DaoOutput + } + return nil +} + +func (m *ActionPlan) GetDaoDeposit() *v1alpha14.DaoDeposit { + if x, ok := m.GetAction().(*ActionPlan_DaoDeposit); ok { + return x.DaoDeposit + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*ActionPlan) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*ActionPlan_Spend)(nil), + (*ActionPlan_Output)(nil), + (*ActionPlan_Swap)(nil), + (*ActionPlan_SwapClaim)(nil), + (*ActionPlan_ValidatorDefinition)(nil), + (*ActionPlan_IbcAction)(nil), + (*ActionPlan_ProposalSubmit)(nil), + (*ActionPlan_ProposalWithdraw)(nil), + (*ActionPlan_ValidatorVote)(nil), + (*ActionPlan_DelegatorVote)(nil), + (*ActionPlan_ProposalDepositClaim)(nil), + (*ActionPlan_Withdrawal)(nil), + (*ActionPlan_PositionOpen)(nil), + (*ActionPlan_PositionClose)(nil), + (*ActionPlan_PositionWithdraw)(nil), + (*ActionPlan_PositionRewardClaim)(nil), + (*ActionPlan_Delegate)(nil), + (*ActionPlan_Undelegate)(nil), + (*ActionPlan_UndelegateClaim)(nil), + (*ActionPlan_DaoSpend)(nil), + (*ActionPlan_DaoOutput)(nil), + (*ActionPlan_DaoDeposit)(nil), + } +} + +// Describes a plan for forming a `Clue`. +type CluePlan struct { + // The address. + Address *v1alpha1.Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // The random seed to use for the clue plan. + Rseed []byte `protobuf:"bytes,2,opt,name=rseed,proto3" json:"rseed,omitempty"` + // The bits of precision. + PrecisionBits uint64 `protobuf:"varint,3,opt,name=precision_bits,json=precisionBits,proto3" json:"precision_bits,omitempty"` +} + +func (m *CluePlan) Reset() { *m = CluePlan{} } +func (m *CluePlan) String() string { return proto.CompactTextString(m) } +func (*CluePlan) ProtoMessage() {} +func (*CluePlan) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{23} +} +func (m *CluePlan) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CluePlan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CluePlan.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 *CluePlan) XXX_Merge(src proto.Message) { + xxx_messageInfo_CluePlan.Merge(m, src) +} +func (m *CluePlan) XXX_Size() int { + return m.Size() +} +func (m *CluePlan) XXX_DiscardUnknown() { + xxx_messageInfo_CluePlan.DiscardUnknown(m) +} + +var xxx_messageInfo_CluePlan proto.InternalMessageInfo + +func (m *CluePlan) GetAddress() *v1alpha1.Address { + if m != nil { + return m.Address + } + return nil +} + +func (m *CluePlan) GetRseed() []byte { + if m != nil { + return m.Rseed + } + return nil +} + +func (m *CluePlan) GetPrecisionBits() uint64 { + if m != nil { + return m.PrecisionBits + } + return 0 +} + +// Describes a plan for forming a `Memo`. +type MemoPlan struct { + // The plaintext. + Plaintext *MemoPlaintext `protobuf:"bytes,1,opt,name=plaintext,proto3" json:"plaintext,omitempty"` + // The key to use to encrypt the memo. + Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` +} + +func (m *MemoPlan) Reset() { *m = MemoPlan{} } +func (m *MemoPlan) String() string { return proto.CompactTextString(m) } +func (*MemoPlan) ProtoMessage() {} +func (*MemoPlan) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{24} +} +func (m *MemoPlan) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MemoPlan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MemoPlan.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 *MemoPlan) XXX_Merge(src proto.Message) { + xxx_messageInfo_MemoPlan.Merge(m, src) +} +func (m *MemoPlan) XXX_Size() int { + return m.Size() +} +func (m *MemoPlan) XXX_DiscardUnknown() { + xxx_messageInfo_MemoPlan.DiscardUnknown(m) +} + +var xxx_messageInfo_MemoPlan proto.InternalMessageInfo + +func (m *MemoPlan) GetPlaintext() *MemoPlaintext { + if m != nil { + return m.Plaintext + } + return nil +} + +func (m *MemoPlan) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +type MemoCiphertext struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *MemoCiphertext) Reset() { *m = MemoCiphertext{} } +func (m *MemoCiphertext) String() string { return proto.CompactTextString(m) } +func (*MemoCiphertext) ProtoMessage() {} +func (*MemoCiphertext) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{25} +} +func (m *MemoCiphertext) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MemoCiphertext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MemoCiphertext.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 *MemoCiphertext) XXX_Merge(src proto.Message) { + xxx_messageInfo_MemoCiphertext.Merge(m, src) +} +func (m *MemoCiphertext) XXX_Size() int { + return m.Size() +} +func (m *MemoCiphertext) XXX_DiscardUnknown() { + xxx_messageInfo_MemoCiphertext.DiscardUnknown(m) +} + +var xxx_messageInfo_MemoCiphertext proto.InternalMessageInfo + +func (m *MemoCiphertext) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +type MemoPlaintext struct { + Sender *v1alpha1.Address `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` +} + +func (m *MemoPlaintext) Reset() { *m = MemoPlaintext{} } +func (m *MemoPlaintext) String() string { return proto.CompactTextString(m) } +func (*MemoPlaintext) ProtoMessage() {} +func (*MemoPlaintext) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{26} +} +func (m *MemoPlaintext) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MemoPlaintext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MemoPlaintext.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 *MemoPlaintext) XXX_Merge(src proto.Message) { + xxx_messageInfo_MemoPlaintext.Merge(m, src) +} +func (m *MemoPlaintext) XXX_Size() int { + return m.Size() +} +func (m *MemoPlaintext) XXX_DiscardUnknown() { + xxx_messageInfo_MemoPlaintext.DiscardUnknown(m) +} + +var xxx_messageInfo_MemoPlaintext proto.InternalMessageInfo + +func (m *MemoPlaintext) GetSender() *v1alpha1.Address { + if m != nil { + return m.Sender + } + return nil +} + +func (m *MemoPlaintext) GetText() string { + if m != nil { + return m.Text + } + return "" +} + +type MemoView struct { + // Types that are valid to be assigned to MemoView: + // + // *MemoView_Visible_ + // *MemoView_Opaque_ + MemoView isMemoView_MemoView `protobuf_oneof:"memo_view"` +} + +func (m *MemoView) Reset() { *m = MemoView{} } +func (m *MemoView) String() string { return proto.CompactTextString(m) } +func (*MemoView) ProtoMessage() {} +func (*MemoView) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{27} +} +func (m *MemoView) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MemoView) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MemoView.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 *MemoView) XXX_Merge(src proto.Message) { + xxx_messageInfo_MemoView.Merge(m, src) +} +func (m *MemoView) XXX_Size() int { + return m.Size() +} +func (m *MemoView) XXX_DiscardUnknown() { + xxx_messageInfo_MemoView.DiscardUnknown(m) +} + +var xxx_messageInfo_MemoView proto.InternalMessageInfo + +type isMemoView_MemoView interface { + isMemoView_MemoView() + MarshalTo([]byte) (int, error) + Size() int +} + +type MemoView_Visible_ struct { + Visible *MemoView_Visible `protobuf:"bytes,1,opt,name=visible,proto3,oneof" json:"visible,omitempty"` +} +type MemoView_Opaque_ struct { + Opaque *MemoView_Opaque `protobuf:"bytes,2,opt,name=opaque,proto3,oneof" json:"opaque,omitempty"` +} + +func (*MemoView_Visible_) isMemoView_MemoView() {} +func (*MemoView_Opaque_) isMemoView_MemoView() {} + +func (m *MemoView) GetMemoView() isMemoView_MemoView { + if m != nil { + return m.MemoView + } + return nil +} + +func (m *MemoView) GetVisible() *MemoView_Visible { + if x, ok := m.GetMemoView().(*MemoView_Visible_); ok { + return x.Visible + } + return nil +} + +func (m *MemoView) GetOpaque() *MemoView_Opaque { + if x, ok := m.GetMemoView().(*MemoView_Opaque_); ok { + return x.Opaque + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*MemoView) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*MemoView_Visible_)(nil), + (*MemoView_Opaque_)(nil), + } +} + +type MemoView_Visible struct { + Ciphertext *MemoCiphertext `protobuf:"bytes,1,opt,name=ciphertext,proto3" json:"ciphertext,omitempty"` + Plaintext *MemoPlaintext `protobuf:"bytes,2,opt,name=plaintext,proto3" json:"plaintext,omitempty"` +} + +func (m *MemoView_Visible) Reset() { *m = MemoView_Visible{} } +func (m *MemoView_Visible) String() string { return proto.CompactTextString(m) } +func (*MemoView_Visible) ProtoMessage() {} +func (*MemoView_Visible) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{27, 0} +} +func (m *MemoView_Visible) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MemoView_Visible) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MemoView_Visible.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 *MemoView_Visible) XXX_Merge(src proto.Message) { + xxx_messageInfo_MemoView_Visible.Merge(m, src) +} +func (m *MemoView_Visible) XXX_Size() int { + return m.Size() +} +func (m *MemoView_Visible) XXX_DiscardUnknown() { + xxx_messageInfo_MemoView_Visible.DiscardUnknown(m) +} + +var xxx_messageInfo_MemoView_Visible proto.InternalMessageInfo + +func (m *MemoView_Visible) GetCiphertext() *MemoCiphertext { + if m != nil { + return m.Ciphertext + } + return nil +} + +func (m *MemoView_Visible) GetPlaintext() *MemoPlaintext { + if m != nil { + return m.Plaintext + } + return nil +} + +type MemoView_Opaque struct { + Ciphertext *MemoCiphertext `protobuf:"bytes,1,opt,name=ciphertext,proto3" json:"ciphertext,omitempty"` +} + +func (m *MemoView_Opaque) Reset() { *m = MemoView_Opaque{} } +func (m *MemoView_Opaque) String() string { return proto.CompactTextString(m) } +func (*MemoView_Opaque) ProtoMessage() {} +func (*MemoView_Opaque) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{27, 1} +} +func (m *MemoView_Opaque) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MemoView_Opaque) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MemoView_Opaque.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 *MemoView_Opaque) XXX_Merge(src proto.Message) { + xxx_messageInfo_MemoView_Opaque.Merge(m, src) +} +func (m *MemoView_Opaque) XXX_Size() int { + return m.Size() +} +func (m *MemoView_Opaque) XXX_DiscardUnknown() { + xxx_messageInfo_MemoView_Opaque.DiscardUnknown(m) +} + +var xxx_messageInfo_MemoView_Opaque proto.InternalMessageInfo + +func (m *MemoView_Opaque) GetCiphertext() *MemoCiphertext { + if m != nil { + return m.Ciphertext + } + return nil +} + +type SpendPlan struct { + // The plaintext note we plan to spend. + Note *v1alpha1.Note `protobuf:"bytes,1,opt,name=note,proto3" json:"note,omitempty"` + // The position of the note we plan to spend. + Position uint64 `protobuf:"varint,2,opt,name=position,proto3" json:"position,omitempty"` + // The randomizer to use for the spend. + Randomizer []byte `protobuf:"bytes,3,opt,name=randomizer,proto3" json:"randomizer,omitempty"` + // The blinding factor to use for the value commitment. + ValueBlinding []byte `protobuf:"bytes,4,opt,name=value_blinding,json=valueBlinding,proto3" json:"value_blinding,omitempty"` +} + +func (m *SpendPlan) Reset() { *m = SpendPlan{} } +func (m *SpendPlan) String() string { return proto.CompactTextString(m) } +func (*SpendPlan) ProtoMessage() {} +func (*SpendPlan) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{28} +} +func (m *SpendPlan) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SpendPlan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SpendPlan.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 *SpendPlan) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpendPlan.Merge(m, src) +} +func (m *SpendPlan) XXX_Size() int { + return m.Size() +} +func (m *SpendPlan) XXX_DiscardUnknown() { + xxx_messageInfo_SpendPlan.DiscardUnknown(m) +} + +var xxx_messageInfo_SpendPlan proto.InternalMessageInfo + +func (m *SpendPlan) GetNote() *v1alpha1.Note { + if m != nil { + return m.Note + } + return nil +} + +func (m *SpendPlan) GetPosition() uint64 { + if m != nil { + return m.Position + } + return 0 +} + +func (m *SpendPlan) GetRandomizer() []byte { + if m != nil { + return m.Randomizer + } + return nil +} + +func (m *SpendPlan) GetValueBlinding() []byte { + if m != nil { + return m.ValueBlinding + } + return nil +} + +type OutputPlan struct { + // The value to send to this output. + Value *v1alpha1.Value `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + // The destination address to send it to. + DestAddress *v1alpha1.Address `protobuf:"bytes,2,opt,name=dest_address,json=destAddress,proto3" json:"dest_address,omitempty"` + // The rseed to use for the new note. + Rseed []byte `protobuf:"bytes,3,opt,name=rseed,proto3" json:"rseed,omitempty"` + // The blinding factor to use for the value commitment. + ValueBlinding []byte `protobuf:"bytes,4,opt,name=value_blinding,json=valueBlinding,proto3" json:"value_blinding,omitempty"` +} + +func (m *OutputPlan) Reset() { *m = OutputPlan{} } +func (m *OutputPlan) String() string { return proto.CompactTextString(m) } +func (*OutputPlan) ProtoMessage() {} +func (*OutputPlan) Descriptor() ([]byte, []int) { + return fileDescriptor_cd20ea79758052c4, []int{29} +} +func (m *OutputPlan) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OutputPlan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OutputPlan.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 *OutputPlan) XXX_Merge(src proto.Message) { + xxx_messageInfo_OutputPlan.Merge(m, src) +} +func (m *OutputPlan) XXX_Size() int { + return m.Size() +} +func (m *OutputPlan) XXX_DiscardUnknown() { + xxx_messageInfo_OutputPlan.DiscardUnknown(m) +} + +var xxx_messageInfo_OutputPlan proto.InternalMessageInfo + +func (m *OutputPlan) GetValue() *v1alpha1.Value { + if m != nil { + return m.Value + } + return nil +} + +func (m *OutputPlan) GetDestAddress() *v1alpha1.Address { + if m != nil { + return m.DestAddress + } + return nil +} + +func (m *OutputPlan) GetRseed() []byte { + if m != nil { + return m.Rseed + } + return nil +} + +func (m *OutputPlan) GetValueBlinding() []byte { + if m != nil { + return m.ValueBlinding + } + return nil +} + +func init() { + proto.RegisterType((*Transaction)(nil), "penumbra.core.transaction.v1alpha1.Transaction") + proto.RegisterType((*Id)(nil), "penumbra.core.transaction.v1alpha1.Id") + proto.RegisterType((*EffectHash)(nil), "penumbra.core.transaction.v1alpha1.EffectHash") + proto.RegisterType((*TransactionBody)(nil), "penumbra.core.transaction.v1alpha1.TransactionBody") + proto.RegisterType((*Action)(nil), "penumbra.core.transaction.v1alpha1.Action") + proto.RegisterType((*TransactionPerspective)(nil), "penumbra.core.transaction.v1alpha1.TransactionPerspective") + proto.RegisterType((*PayloadKey)(nil), "penumbra.core.transaction.v1alpha1.PayloadKey") + proto.RegisterType((*PayloadKeyWithCommitment)(nil), "penumbra.core.transaction.v1alpha1.PayloadKeyWithCommitment") + proto.RegisterType((*NullifierWithNote)(nil), "penumbra.core.transaction.v1alpha1.NullifierWithNote") + proto.RegisterType((*TransactionView)(nil), "penumbra.core.transaction.v1alpha1.TransactionView") + proto.RegisterType((*TransactionBodyView)(nil), "penumbra.core.transaction.v1alpha1.TransactionBodyView") + proto.RegisterType((*ActionView)(nil), "penumbra.core.transaction.v1alpha1.ActionView") + proto.RegisterType((*SpendView)(nil), "penumbra.core.transaction.v1alpha1.SpendView") + proto.RegisterType((*SpendView_Visible)(nil), "penumbra.core.transaction.v1alpha1.SpendView.Visible") + proto.RegisterType((*SpendView_Opaque)(nil), "penumbra.core.transaction.v1alpha1.SpendView.Opaque") + proto.RegisterType((*DelegatorVoteView)(nil), "penumbra.core.transaction.v1alpha1.DelegatorVoteView") + proto.RegisterType((*DelegatorVoteView_Visible)(nil), "penumbra.core.transaction.v1alpha1.DelegatorVoteView.Visible") + proto.RegisterType((*DelegatorVoteView_Opaque)(nil), "penumbra.core.transaction.v1alpha1.DelegatorVoteView.Opaque") + proto.RegisterType((*OutputView)(nil), "penumbra.core.transaction.v1alpha1.OutputView") + proto.RegisterType((*OutputView_Visible)(nil), "penumbra.core.transaction.v1alpha1.OutputView.Visible") + proto.RegisterType((*OutputView_Opaque)(nil), "penumbra.core.transaction.v1alpha1.OutputView.Opaque") + proto.RegisterType((*Spend)(nil), "penumbra.core.transaction.v1alpha1.Spend") + proto.RegisterType((*SpendBody)(nil), "penumbra.core.transaction.v1alpha1.SpendBody") + proto.RegisterType((*Output)(nil), "penumbra.core.transaction.v1alpha1.Output") + proto.RegisterType((*OutputBody)(nil), "penumbra.core.transaction.v1alpha1.OutputBody") + proto.RegisterType((*AuthorizationData)(nil), "penumbra.core.transaction.v1alpha1.AuthorizationData") + proto.RegisterType((*WitnessData)(nil), "penumbra.core.transaction.v1alpha1.WitnessData") + proto.RegisterType((*TransactionPlan)(nil), "penumbra.core.transaction.v1alpha1.TransactionPlan") + proto.RegisterType((*ActionPlan)(nil), "penumbra.core.transaction.v1alpha1.ActionPlan") + proto.RegisterType((*CluePlan)(nil), "penumbra.core.transaction.v1alpha1.CluePlan") + proto.RegisterType((*MemoPlan)(nil), "penumbra.core.transaction.v1alpha1.MemoPlan") + proto.RegisterType((*MemoCiphertext)(nil), "penumbra.core.transaction.v1alpha1.MemoCiphertext") + proto.RegisterType((*MemoPlaintext)(nil), "penumbra.core.transaction.v1alpha1.MemoPlaintext") + proto.RegisterType((*MemoView)(nil), "penumbra.core.transaction.v1alpha1.MemoView") + proto.RegisterType((*MemoView_Visible)(nil), "penumbra.core.transaction.v1alpha1.MemoView.Visible") + proto.RegisterType((*MemoView_Opaque)(nil), "penumbra.core.transaction.v1alpha1.MemoView.Opaque") + proto.RegisterType((*SpendPlan)(nil), "penumbra.core.transaction.v1alpha1.SpendPlan") + proto.RegisterType((*OutputPlan)(nil), "penumbra.core.transaction.v1alpha1.OutputPlan") +} + +func init() { + proto.RegisterFile("penumbra/core/transaction/v1alpha1/transaction.proto", fileDescriptor_cd20ea79758052c4) +} + +var fileDescriptor_cd20ea79758052c4 = []byte{ + // 2656 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5b, 0x4f, 0x6f, 0x1c, 0x49, + 0x15, 0x9f, 0x9e, 0xb1, 0xc7, 0xf6, 0x9b, 0xf1, 0xbf, 0x8a, 0x93, 0x1d, 0x2c, 0xe4, 0x8d, 0x7a, + 0x93, 0xe0, 0x24, 0xbb, 0xe3, 0xc4, 0x76, 0x36, 0x92, 0x77, 0x81, 0xf5, 0xd8, 0x9b, 0x1d, 0x27, + 0xeb, 0x78, 0xb6, 0x13, 0x1c, 0x25, 0x98, 0x6d, 0x6a, 0xba, 0xcb, 0x9e, 0x96, 0x7b, 0xba, 0x9b, + 0xee, 0x9e, 0x71, 0xbc, 0x5f, 0x00, 0xb8, 0xa0, 0x45, 0xe2, 0x80, 0xb8, 0x20, 0x71, 0x41, 0xe2, + 0xc0, 0x07, 0x00, 0x71, 0x66, 0x05, 0x12, 0x8a, 0xc4, 0x05, 0x69, 0x85, 0x04, 0xc9, 0x89, 0x3f, + 0x17, 0xbe, 0x00, 0x42, 0x55, 0x5d, 0xfd, 0x77, 0xda, 0x99, 0x1e, 0x3b, 0x61, 0x95, 0x4d, 0x4e, + 0xae, 0x7a, 0xf3, 0xde, 0xaf, 0xaa, 0xde, 0x7b, 0x55, 0xf5, 0xde, 0xab, 0x36, 0x2c, 0x5b, 0xc4, + 0xe8, 0xb4, 0x9b, 0x36, 0x5e, 0x50, 0x4c, 0x9b, 0x2c, 0xb8, 0x36, 0x36, 0x1c, 0xac, 0xb8, 0x9a, + 0x69, 0x2c, 0x74, 0xaf, 0x62, 0xdd, 0x6a, 0xe1, 0xab, 0x51, 0x62, 0xd5, 0xb2, 0x4d, 0xd7, 0x44, + 0xa2, 0x2f, 0x55, 0xa5, 0x52, 0xd5, 0x28, 0x83, 0x2f, 0x35, 0x7b, 0x29, 0x8e, 0xac, 0xd8, 0x87, + 0x96, 0x6b, 0x86, 0xa0, 0x5e, 0xdf, 0xc3, 0x9b, 0x9d, 0x8f, 0xf3, 0x3a, 0x2e, 0xde, 0x27, 0x21, + 0x2b, 0xeb, 0x72, 0xce, 0x73, 0x71, 0x4e, 0xad, 0xa9, 0x84, 0x7c, 0x5a, 0x53, 0x49, 0xe7, 0x52, + 0xc9, 0xc3, 0x90, 0x4b, 0x25, 0x0f, 0x39, 0xd7, 0x62, 0x9c, 0x6b, 0xcf, 0xec, 0x12, 0xdb, 0xc0, + 0x86, 0x12, 0x19, 0x3a, 0xa4, 0x79, 0x32, 0xe2, 0x6f, 0x04, 0x28, 0xdd, 0x0d, 0x97, 0x8b, 0x3e, + 0x80, 0xa1, 0xa6, 0xa9, 0x1e, 0x56, 0x84, 0xb3, 0xc2, 0x7c, 0x69, 0x71, 0xa9, 0xda, 0x5f, 0x31, + 0xd5, 0x88, 0x78, 0xcd, 0x54, 0x0f, 0x25, 0x06, 0x80, 0x5e, 0x87, 0x52, 0x53, 0x33, 0x54, 0xcd, + 0xd8, 0x93, 0x1d, 0x6d, 0xaf, 0x92, 0x3f, 0x2b, 0xcc, 0x97, 0x25, 0xe0, 0xa4, 0x3b, 0xda, 0x1e, + 0x5a, 0x85, 0x22, 0x36, 0x94, 0x96, 0x69, 0x57, 0x0a, 0x6c, 0xac, 0x8b, 0x89, 0xb1, 0xb8, 0x42, + 0x83, 0x61, 0x36, 0x89, 0xbd, 0xaf, 0x13, 0xc9, 0x34, 0x5d, 0x89, 0x0b, 0x8a, 0x15, 0xc8, 0x6f, + 0xa8, 0x08, 0xc1, 0x50, 0x0b, 0x3b, 0x2d, 0x36, 0xe5, 0xb2, 0xc4, 0xda, 0xa2, 0x08, 0xf0, 0xfe, + 0xee, 0x2e, 0x51, 0xdc, 0x3a, 0x76, 0x5a, 0x68, 0x06, 0x86, 0x35, 0xc3, 0x20, 0x36, 0x67, 0xf1, + 0x3a, 0xe2, 0x9f, 0xf2, 0x30, 0x99, 0x98, 0x3b, 0x5a, 0x87, 0x11, 0xaf, 0xe7, 0x54, 0x84, 0xb3, + 0x85, 0xf9, 0xd2, 0xe2, 0xa5, 0x2c, 0x1a, 0x58, 0x65, 0x7d, 0xc9, 0x17, 0x45, 0x6f, 0xc0, 0x38, + 0x79, 0x68, 0x69, 0xf6, 0xa1, 0xdc, 0x22, 0xda, 0x5e, 0xcb, 0x65, 0xab, 0x1f, 0x92, 0xca, 0x1e, + 0xb1, 0xce, 0x68, 0xe8, 0x2b, 0x30, 0xaa, 0xb4, 0xb0, 0x66, 0xc8, 0x9a, 0xca, 0x34, 0x30, 0x26, + 0x8d, 0xb0, 0xfe, 0x86, 0x8a, 0x96, 0xa1, 0xb0, 0x4b, 0x48, 0x65, 0x88, 0xe9, 0x45, 0xec, 0xa3, + 0x97, 0x1b, 0x84, 0x48, 0x94, 0x1d, 0xbd, 0x07, 0x63, 0xbb, 0x6d, 0x55, 0x56, 0xf4, 0x0e, 0x71, + 0x2a, 0xc3, 0x6c, 0xf6, 0x6f, 0xf4, 0x91, 0x5d, 0xd3, 0x3b, 0x44, 0x1a, 0xdd, 0x6d, 0xab, 0xb4, + 0xe1, 0xa0, 0x4b, 0x30, 0x41, 0x0c, 0xc6, 0x43, 0x54, 0xb9, 0x4d, 0xda, 0x66, 0xa5, 0x48, 0x15, + 0x56, 0xcf, 0x49, 0xe3, 0x01, 0x7d, 0x93, 0xb4, 0xcd, 0x1f, 0x08, 0x42, 0x6d, 0x1a, 0x26, 0xe5, + 0x38, 0xb3, 0xf8, 0xe7, 0x09, 0x28, 0x7a, 0xaa, 0x40, 0xab, 0x30, 0xec, 0x58, 0xc4, 0x50, 0xb9, + 0x1f, 0x5d, 0xcc, 0xa2, 0xc5, 0x3b, 0x54, 0xa0, 0x9e, 0x93, 0x3c, 0x49, 0xb4, 0x0e, 0x45, 0xb3, + 0xe3, 0x5a, 0x1d, 0x4f, 0x7b, 0x19, 0x2d, 0xb1, 0xc5, 0x24, 0xea, 0x39, 0x89, 0xcb, 0xa2, 0xb7, + 0x61, 0xc8, 0x39, 0xc0, 0x16, 0xf7, 0xb1, 0xb3, 0x09, 0x0c, 0xba, 0x77, 0xc2, 0xf1, 0x0f, 0xb0, + 0x55, 0xcf, 0x49, 0x8c, 0x1f, 0xdd, 0x00, 0xa0, 0x7f, 0x65, 0x45, 0xc7, 0x5a, 0x9b, 0x5b, 0xe2, + 0x7c, 0x3f, 0xe9, 0x35, 0xca, 0x5c, 0xcf, 0x49, 0x63, 0x8e, 0xdf, 0x41, 0xbb, 0x30, 0xd3, 0xc5, + 0xba, 0xa6, 0x62, 0xd7, 0xb4, 0x65, 0x95, 0xec, 0x6a, 0x86, 0x46, 0x67, 0x5c, 0x99, 0x62, 0x88, + 0x57, 0x13, 0x88, 0xde, 0xc9, 0x10, 0x60, 0x6e, 0xfb, 0x92, 0xeb, 0x81, 0x60, 0x3d, 0x27, 0x9d, + 0xea, 0xf6, 0x92, 0xe9, 0x7c, 0xb5, 0xa6, 0x22, 0x7b, 0xfa, 0xa8, 0x4c, 0xa7, 0xce, 0x97, 0x9e, + 0x27, 0x01, 0xf6, 0x46, 0x53, 0xf1, 0x6c, 0x45, 0xe7, 0xab, 0xf9, 0x1d, 0xb4, 0x03, 0x93, 0x96, + 0x6d, 0x5a, 0xa6, 0x83, 0x75, 0xd9, 0xe9, 0x34, 0xdb, 0x9a, 0x5b, 0x41, 0xa9, 0x53, 0x8d, 0x9c, + 0x24, 0x01, 0x66, 0x83, 0x4b, 0xde, 0x61, 0x82, 0xf5, 0x9c, 0x34, 0x61, 0xc5, 0x28, 0xa8, 0x09, + 0xd3, 0x01, 0xfa, 0x81, 0xe6, 0xb6, 0x54, 0x1b, 0x1f, 0x54, 0x4e, 0xa5, 0x1e, 0x35, 0x4f, 0xc3, + 0xbf, 0xc7, 0x45, 0xeb, 0x39, 0x69, 0xca, 0x4a, 0xd0, 0xd0, 0x7d, 0x98, 0x08, 0x35, 0xde, 0x35, + 0x5d, 0x52, 0x99, 0x61, 0x03, 0x5c, 0xc9, 0x30, 0x40, 0xa0, 0xf0, 0x6d, 0xd3, 0x25, 0xd4, 0xed, + 0xbb, 0x51, 0x02, 0x85, 0x56, 0x89, 0x4e, 0xf6, 0x42, 0xe8, 0xd3, 0x99, 0xa1, 0xd7, 0x7d, 0x41, + 0x1f, 0x5a, 0x8d, 0x12, 0x90, 0x09, 0x67, 0x02, 0xcd, 0xa8, 0xc4, 0x32, 0x1d, 0xcd, 0xe5, 0xbe, + 0x77, 0x86, 0x0d, 0x71, 0x7d, 0x00, 0xf5, 0xac, 0x7b, 0xf2, 0xbe, 0x37, 0xce, 0x58, 0x29, 0x74, + 0xb4, 0x05, 0xe3, 0xac, 0xa7, 0x99, 0x86, 0x6c, 0x5a, 0xc4, 0xa8, 0xcc, 0xb1, 0x71, 0xe6, 0x9f, + 0xe6, 0xe3, 0x0d, 0x2e, 0xb0, 0x65, 0x11, 0xea, 0x36, 0x65, 0x2b, 0xd2, 0x47, 0x12, 0x4c, 0x04, + 0x80, 0x8a, 0x6e, 0x3a, 0xa4, 0xf2, 0x7a, 0xea, 0xde, 0x4f, 0x45, 0x5c, 0xa3, 0x02, 0x54, 0x2b, + 0x56, 0x94, 0x80, 0xbe, 0x0d, 0xd3, 0x01, 0x66, 0xe0, 0x2f, 0x67, 0x19, 0xec, 0x9b, 0x59, 0x60, + 0x63, 0x8e, 0x92, 0xa0, 0x21, 0x02, 0xa7, 0x03, 0x70, 0x9b, 0x1c, 0x60, 0x5b, 0xe5, 0x1a, 0x17, + 0xd9, 0x00, 0x0b, 0x59, 0x06, 0x90, 0x98, 0x9c, 0xaf, 0xe9, 0x53, 0x56, 0x2f, 0x19, 0xad, 0xc3, + 0x28, 0x37, 0x35, 0xa9, 0xcc, 0x33, 0xe4, 0x0b, 0x4f, 0xdf, 0xf5, 0xdc, 0x53, 0xa8, 0x3a, 0x02, + 0x49, 0x74, 0x13, 0xa0, 0x63, 0x04, 0x38, 0x17, 0x53, 0x6d, 0x95, 0xc0, 0xf9, 0x56, 0xc0, 0x5f, + 0xcf, 0x49, 0x11, 0x69, 0xf4, 0x00, 0xa6, 0xc2, 0x1e, 0x5f, 0xf3, 0x25, 0x86, 0xf8, 0x56, 0x56, + 0x44, 0x7f, 0xc5, 0x93, 0x9d, 0x38, 0x09, 0xdd, 0x84, 0x31, 0x15, 0x9b, 0xb2, 0x77, 0xf8, 0x2f, + 0x32, 0xd0, 0xcb, 0x59, 0x76, 0x07, 0x36, 0xfd, 0xe3, 0x7f, 0x54, 0xe5, 0x6d, 0xb4, 0x09, 0x40, + 0xb1, 0xf8, 0x2d, 0xb0, 0x94, 0x6a, 0xf6, 0x23, 0xc0, 0x82, 0x7b, 0x80, 0xce, 0xc6, 0xeb, 0xa0, + 0x06, 0x94, 0x28, 0x1c, 0xdf, 0x5d, 0x95, 0xe5, 0xd4, 0x15, 0x1f, 0x81, 0xc7, 0xb7, 0x0e, 0x55, + 0xa4, 0x1a, 0xf4, 0xd0, 0x7d, 0x98, 0xd2, 0x14, 0x67, 0xf1, 0x4a, 0xe0, 0x9b, 0x58, 0xaf, 0x7c, + 0x26, 0xa4, 0x2e, 0x3a, 0x7e, 0xf6, 0x52, 0xa1, 0x7b, 0x81, 0x0c, 0xd5, 0xa3, 0x16, 0x27, 0xd5, + 0x46, 0xa1, 0xe8, 0x9d, 0xe5, 0xe2, 0x0f, 0x87, 0xe0, 0x4c, 0x24, 0x4c, 0x69, 0x10, 0xdb, 0xb1, + 0x88, 0xe2, 0x6a, 0x5d, 0x82, 0x64, 0x28, 0x5b, 0xf8, 0x50, 0x37, 0xb1, 0x2a, 0xef, 0x93, 0x43, + 0x3f, 0x64, 0x79, 0x37, 0xcb, 0x45, 0xd9, 0xf0, 0xe4, 0x6e, 0x91, 0x43, 0x3a, 0xe8, 0x9a, 0xd9, + 0x6e, 0x6b, 0x6e, 0x9b, 0x18, 0xae, 0x54, 0xb2, 0x82, 0x5f, 0x1c, 0xf4, 0x5d, 0x98, 0x62, 0x96, + 0x94, 0x8d, 0x8e, 0xae, 0x6b, 0xbb, 0x1a, 0xb1, 0x9d, 0x4a, 0x9e, 0x0d, 0x72, 0x2d, 0xcb, 0x20, + 0xb7, 0x7d, 0x29, 0x3a, 0xc6, 0x6d, 0xd3, 0x25, 0xd2, 0x24, 0x83, 0x0b, 0xe8, 0x0e, 0xba, 0x01, + 0x65, 0xac, 0x76, 0x35, 0x85, 0xc8, 0x86, 0xe9, 0x12, 0xa7, 0x52, 0xc8, 0x14, 0xb7, 0x30, 0xac, + 0x92, 0x27, 0x48, 0xdb, 0x0e, 0x3d, 0xce, 0xb0, 0xaa, 0xda, 0xc4, 0x71, 0xe4, 0xae, 0x46, 0x0e, + 0x9c, 0xca, 0x50, 0x6a, 0xf8, 0x96, 0x04, 0x5a, 0xf5, 0x64, 0xb6, 0x35, 0x72, 0x20, 0x95, 0x71, + 0xd8, 0x71, 0x68, 0xf8, 0xa1, 0x12, 0xc3, 0x6c, 0xfb, 0xa1, 0xd4, 0x9b, 0x7d, 0x90, 0xd6, 0x29, + 0xf3, 0x26, 0x71, 0xb1, 0x8a, 0x5d, 0x2c, 0x71, 0x59, 0xb4, 0x09, 0x13, 0x11, 0xcd, 0xd0, 0x50, + 0xaf, 0x98, 0x7a, 0x04, 0xa4, 0xaa, 0x6f, 0x43, 0x95, 0xc6, 0x23, 0x3f, 0x6c, 0xa8, 0x34, 0xac, + 0x0d, 0x0d, 0x77, 0x44, 0x58, 0xfb, 0x5b, 0x01, 0x2a, 0x47, 0x59, 0x17, 0x6d, 0x41, 0x29, 0xe2, + 0x31, 0x3c, 0x3a, 0xab, 0x0e, 0xe6, 0x30, 0x12, 0x84, 0x2e, 0x82, 0x6e, 0x03, 0x28, 0x01, 0x3c, + 0x8f, 0xd4, 0xaa, 0x7d, 0x54, 0x75, 0xc7, 0xa5, 0xc7, 0x45, 0xe8, 0x72, 0x11, 0x04, 0xf1, 0x27, + 0x02, 0x4c, 0xf7, 0xb8, 0x0d, 0xba, 0x01, 0x63, 0x81, 0x07, 0xf2, 0x49, 0xcf, 0xf7, 0x73, 0x11, + 0x9f, 0x5f, 0x0a, 0x45, 0xd1, 0x75, 0x18, 0xa2, 0x6e, 0xc6, 0xe7, 0x99, 0xc9, 0xcb, 0x98, 0x80, + 0xf8, 0x47, 0x21, 0x96, 0x2b, 0x50, 0x17, 0x41, 0x77, 0x61, 0x8c, 0x66, 0x3a, 0xcc, 0xdf, 0xf8, + 0xa4, 0xae, 0x1f, 0x23, 0x5f, 0x62, 0xbe, 0x37, 0xda, 0xe4, 0xad, 0xff, 0x4b, 0xde, 0xf4, 0xdf, + 0x3c, 0x9c, 0x4a, 0x99, 0x05, 0xfa, 0x08, 0xca, 0xdc, 0x51, 0xbd, 0x3d, 0xe4, 0x9d, 0x27, 0xd5, + 0xec, 0x29, 0x10, 0x5b, 0x4b, 0x29, 0xd4, 0xd1, 0x8b, 0x9b, 0x0a, 0xdd, 0x86, 0x31, 0x9a, 0xd3, + 0x78, 0xc6, 0x2d, 0xa6, 0x5e, 0x3d, 0xa9, 0x7a, 0xa0, 0xe9, 0x11, 0x5d, 0x39, 0xbd, 0xc8, 0xda, + 0xbc, 0x4d, 0xd3, 0xa5, 0x32, 0x80, 0x1c, 0x00, 0x8a, 0xff, 0x99, 0x00, 0x08, 0x35, 0x86, 0xde, + 0x8f, 0x67, 0x4b, 0x6f, 0x65, 0xce, 0x96, 0xf8, 0x48, 0x3c, 0x63, 0xaa, 0x27, 0x32, 0xa6, 0x6a, + 0xf6, 0x8c, 0x89, 0x03, 0xf9, 0x59, 0xd3, 0x4a, 0x2c, 0x6b, 0x3a, 0xd7, 0x2f, 0xef, 0xe1, 0xd2, + 0x5e, 0xe6, 0x74, 0x33, 0x25, 0x73, 0xba, 0x98, 0x29, 0x73, 0xe2, 0x30, 0xaf, 0xb2, 0xa7, 0x2f, + 0x67, 0xf6, 0xf4, 0xf1, 0x11, 0xd9, 0x53, 0xa6, 0x50, 0x22, 0x96, 0x3e, 0x71, 0x47, 0x79, 0x95, + 0x42, 0xbd, 0x84, 0x29, 0xd4, 0xc5, 0x67, 0x94, 0x42, 0x5d, 0x3a, 0x51, 0x0a, 0xf5, 0x52, 0xa5, + 0x39, 0x69, 0xf9, 0xe2, 0xe5, 0x67, 0x94, 0x2f, 0x3e, 0xc7, 0x14, 0x6a, 0x1c, 0x4a, 0x91, 0x68, + 0x46, 0xfc, 0x71, 0x01, 0xc6, 0x82, 0x4b, 0x13, 0x7d, 0x04, 0x23, 0x5d, 0xcd, 0xd1, 0x9a, 0x3a, + 0xe1, 0x97, 0xee, 0xb5, 0x81, 0x2e, 0xdd, 0xea, 0xb6, 0x27, 0x5c, 0xcf, 0x49, 0x3e, 0x0e, 0xba, + 0x0d, 0x45, 0xd3, 0xc2, 0xdf, 0xeb, 0xf8, 0xe1, 0xe5, 0xf2, 0x60, 0x88, 0x5b, 0x4c, 0x96, 0x5d, + 0xc2, 0xac, 0x35, 0xfb, 0x7d, 0x01, 0x46, 0xf8, 0x30, 0xe8, 0x9b, 0xc7, 0xad, 0xa7, 0xfa, 0xb1, + 0xc1, 0x3b, 0xb1, 0xc8, 0xf7, 0x6b, 0x19, 0x22, 0x5f, 0x16, 0xcb, 0x31, 0xa1, 0xd9, 0x0d, 0x28, + 0x7a, 0xb3, 0x3b, 0xf1, 0x3c, 0x68, 0x1c, 0xe4, 0x65, 0x94, 0xcc, 0x26, 0x7f, 0x2d, 0xc0, 0x74, + 0xcf, 0xc9, 0x8e, 0xee, 0x27, 0x6d, 0xf3, 0xf5, 0x63, 0xdd, 0x10, 0x69, 0x36, 0xda, 0x4e, 0xd8, + 0xe8, 0xdd, 0xe3, 0x21, 0xf7, 0xd8, 0xea, 0xe7, 0x11, 0x5b, 0xdd, 0xeb, 0xb9, 0xe7, 0x84, 0xe3, + 0x55, 0x09, 0x93, 0x17, 0xdc, 0x89, 0x6c, 0x88, 0x03, 0x1b, 0x3e, 0xaf, 0xf9, 0xd5, 0xa6, 0x92, + 0xc0, 0xe2, 0xbf, 0x0b, 0x00, 0x61, 0x80, 0x89, 0xa4, 0xa4, 0x61, 0xdf, 0x1e, 0x2c, 0x42, 0x4d, + 0xb3, 0xe8, 0x56, 0xc2, 0xa2, 0xd7, 0x06, 0x84, 0xec, 0x31, 0xe5, 0xe7, 0x11, 0x53, 0xd6, 0x82, + 0x88, 0x5a, 0x18, 0xf4, 0x0d, 0x22, 0x88, 0xa5, 0x4f, 0x62, 0xb5, 0x64, 0xbe, 0x5e, 0x38, 0x69, + 0xbe, 0x3e, 0xfb, 0x61, 0xe0, 0x06, 0xcf, 0x60, 0x6d, 0xf4, 0x88, 0xf5, 0x5a, 0xde, 0x76, 0xfe, + 0x5c, 0x80, 0x61, 0xef, 0x4e, 0x5b, 0x8d, 0x3d, 0x23, 0x66, 0x4f, 0x68, 0x22, 0x0f, 0x88, 0x1f, + 0xc2, 0x28, 0xee, 0xb8, 0xad, 0x20, 0x0b, 0xee, 0x0d, 0xa2, 0x7b, 0xea, 0x0a, 0x14, 0x61, 0xb5, + 0xe3, 0xb6, 0xee, 0x68, 0x7b, 0x06, 0x76, 0x3b, 0x36, 0x91, 0x46, 0xb0, 0xd7, 0x45, 0xab, 0x30, + 0x6c, 0xd9, 0xa6, 0xb9, 0xcb, 0x55, 0x78, 0xb9, 0x0f, 0xd4, 0x83, 0x5b, 0x0c, 0xac, 0x41, 0x45, + 0x24, 0x4f, 0x52, 0xfc, 0x99, 0xc0, 0x2f, 0x10, 0xf6, 0x52, 0x28, 0x03, 0x6a, 0x62, 0x9d, 0xee, + 0x0e, 0x39, 0x52, 0x00, 0x49, 0xdf, 0x49, 0x49, 0xf4, 0x9a, 0x27, 0x18, 0x29, 0x81, 0x4c, 0x37, + 0x93, 0x24, 0xf4, 0xd5, 0x68, 0xcd, 0xa3, 0xc0, 0xca, 0x00, 0x91, 0x4a, 0xc6, 0x04, 0xe4, 0xed, + 0x7d, 0x96, 0x5d, 0x95, 0xa5, 0xbc, 0xbd, 0x2f, 0x7e, 0x2a, 0x40, 0x91, 0x07, 0x00, 0xb5, 0x98, + 0xee, 0x07, 0x48, 0x02, 0x23, 0xca, 0xaf, 0xf9, 0xea, 0xca, 0xa7, 0x86, 0x23, 0xbd, 0xea, 0xf2, + 0x10, 0x62, 0xfa, 0xfa, 0x51, 0xde, 0xdf, 0xfc, 0x4c, 0x61, 0x9b, 0x50, 0xa6, 0x2e, 0x2d, 0x73, + 0x67, 0x3c, 0xc2, 0xeb, 0xd2, 0xf6, 0x03, 0x77, 0x65, 0xa9, 0x64, 0x84, 0x9d, 0x23, 0xf4, 0x9f, + 0x7f, 0x76, 0xfa, 0x9f, 0x87, 0xa9, 0x03, 0x1b, 0x5b, 0x16, 0x7f, 0xdd, 0x0c, 0xf6, 0x5f, 0x59, + 0x9a, 0xe0, 0x74, 0x9a, 0xeb, 0xdf, 0x22, 0x87, 0xe8, 0x02, 0x4c, 0x9a, 0xdd, 0x7d, 0xd9, 0xe7, + 0xa6, 0x8c, 0x9e, 0x61, 0xc6, 0xcd, 0xee, 0xfe, 0x3d, 0x8f, 0x7a, 0x8b, 0x1c, 0x8a, 0x3f, 0xcd, + 0xc3, 0x34, 0x75, 0x4f, 0xd3, 0xd6, 0x3e, 0xc1, 0xd4, 0x00, 0xeb, 0xd8, 0xc5, 0xe8, 0x26, 0x94, + 0x08, 0x7b, 0xaa, 0x96, 0x83, 0x57, 0xec, 0xfe, 0x45, 0x9d, 0xf0, 0x71, 0x5b, 0x02, 0x12, 0x3e, + 0x74, 0x4b, 0x50, 0xf2, 0x6e, 0x57, 0xea, 0xf6, 0x7e, 0xa9, 0xf6, 0x18, 0xdb, 0xc6, 0xbb, 0xa3, + 0x29, 0xcd, 0x41, 0x0a, 0xcc, 0xc4, 0x4f, 0x75, 0x0e, 0x5e, 0x38, 0x2e, 0x38, 0x8a, 0xdd, 0x1a, + 0x6c, 0x10, 0xf1, 0x77, 0x02, 0x94, 0xee, 0x69, 0xae, 0x41, 0x1c, 0x87, 0x29, 0x25, 0x2c, 0x72, + 0x09, 0xc7, 0x2c, 0x72, 0xa1, 0x7d, 0x78, 0xcd, 0x71, 0x59, 0xc0, 0x1a, 0xd8, 0x54, 0x66, 0x8e, + 0xe9, 0xeb, 0x65, 0x69, 0xb0, 0x32, 0xa5, 0xe7, 0xdb, 0xa7, 0x9d, 0x14, 0xaa, 0x23, 0xfe, 0x23, + 0xfe, 0x2d, 0x41, 0x43, 0xc7, 0x06, 0xaa, 0x27, 0xbf, 0x25, 0x18, 0xa0, 0x90, 0x46, 0x01, 0xbe, + 0xe8, 0xef, 0x09, 0x6e, 0x01, 0x28, 0x7a, 0x87, 0xc8, 0x96, 0x8e, 0x8d, 0xa3, 0xaa, 0xe0, 0xa9, + 0x4b, 0x58, 0xd3, 0x3b, 0x84, 0x2d, 0x60, 0x4c, 0xe1, 0x2d, 0x07, 0x6d, 0xf0, 0x7a, 0x1a, 0x05, + 0x1b, 0xb4, 0x9e, 0xc6, 0xb0, 0x58, 0x35, 0x8d, 0xb6, 0xc4, 0x7f, 0x05, 0xc5, 0x33, 0xa6, 0xe6, + 0x63, 0x17, 0xcf, 0xa8, 0xf4, 0x33, 0x29, 0x9e, 0x71, 0xa0, 0x63, 0x16, 0xcf, 0xb8, 0xf4, 0x49, + 0x8b, 0x67, 0x1c, 0xe6, 0x55, 0xf1, 0xec, 0xcb, 0x59, 0x3c, 0xfb, 0xce, 0x11, 0xc5, 0xb3, 0xe5, + 0x41, 0x83, 0x76, 0xee, 0x27, 0x5f, 0x74, 0xed, 0x6c, 0x13, 0x20, 0x92, 0xf1, 0xbf, 0x76, 0x9c, + 0x84, 0x3f, 0x02, 0xf0, 0x62, 0x94, 0xe2, 0xe4, 0xa3, 0x4b, 0x71, 0x57, 0x06, 0x29, 0xc5, 0x71, + 0x13, 0xf6, 0x96, 0xe3, 0xb4, 0xa7, 0x97, 0xe3, 0x96, 0x06, 0x2c, 0xc7, 0xf1, 0x71, 0x5e, 0x90, + 0xaf, 0x1a, 0x3e, 0x3e, 0xf2, 0xab, 0x86, 0xab, 0x03, 0x55, 0xa9, 0xf8, 0xaa, 0x5f, 0xea, 0x2f, + 0x1b, 0xa2, 0x9f, 0x1f, 0x08, 0x30, 0xea, 0x5f, 0xe8, 0xe8, 0x3d, 0x18, 0xe1, 0x8f, 0xe4, 0xfc, + 0xb6, 0xbd, 0x90, 0xed, 0x7d, 0x5d, 0xf2, 0xc5, 0xd0, 0x0c, 0x0c, 0xdb, 0x0e, 0x21, 0x2a, 0x7f, + 0xd8, 0xf4, 0x3a, 0xe8, 0x3c, 0x4c, 0x58, 0x36, 0x51, 0x34, 0x87, 0x7a, 0x6e, 0x53, 0x73, 0x1d, + 0x76, 0x79, 0x0e, 0x49, 0xe3, 0x01, 0xb5, 0xa6, 0xb9, 0x8e, 0xd8, 0x86, 0x51, 0x3f, 0x1e, 0x40, + 0x5b, 0x30, 0x66, 0xe9, 0x58, 0x33, 0x5c, 0xf2, 0xd0, 0x4f, 0xbb, 0xae, 0x0e, 0x10, 0x50, 0x78, + 0x82, 0x52, 0x88, 0x81, 0xa6, 0xa0, 0x40, 0x23, 0x77, 0x6f, 0x5e, 0xb4, 0x29, 0x5e, 0x80, 0x09, + 0xca, 0xbd, 0xa6, 0x59, 0x2d, 0x62, 0x33, 0x9e, 0xf4, 0x17, 0x77, 0x05, 0xc6, 0x63, 0xa8, 0xe8, + 0x1b, 0x50, 0x74, 0x88, 0xa1, 0x06, 0x6f, 0xd5, 0x59, 0xb5, 0xc4, 0xa5, 0x10, 0x82, 0x21, 0xb6, + 0xac, 0x3c, 0x0b, 0xe3, 0x58, 0x5b, 0xfc, 0x7d, 0xc1, 0x5b, 0x3c, 0x2b, 0xa4, 0x34, 0x92, 0x85, + 0x94, 0xe5, 0x41, 0xde, 0x26, 0xd3, 0xca, 0x28, 0x9b, 0x89, 0x32, 0xca, 0xd2, 0x40, 0x80, 0x3d, + 0x45, 0x94, 0x5f, 0x47, 0x8a, 0x28, 0x12, 0x80, 0x12, 0xa8, 0x90, 0xcf, 0x77, 0x31, 0x2b, 0x7c, + 0xa8, 0x7c, 0x29, 0x82, 0x12, 0xb7, 0x7e, 0xfe, 0xe4, 0xd6, 0x9f, 0xdd, 0x09, 0xea, 0x22, 0xcf, + 0x61, 0xba, 0xb5, 0x52, 0xe4, 0x35, 0x59, 0xfc, 0xa5, 0x5f, 0x47, 0x60, 0x7e, 0xec, 0x7f, 0x92, + 0x20, 0x0c, 0xf8, 0x49, 0x02, 0x9a, 0x85, 0x51, 0xff, 0x60, 0xe6, 0xf9, 0x40, 0xd0, 0x47, 0x73, + 0x00, 0x36, 0x36, 0x54, 0xb3, 0xad, 0x7d, 0x12, 0x14, 0x0f, 0x22, 0x14, 0xba, 0xdf, 0xba, 0x98, + 0xc6, 0xf6, 0x4d, 0xdd, 0xfb, 0xb0, 0xc0, 0x4f, 0x58, 0x19, 0xb5, 0xc6, 0x89, 0xe2, 0x23, 0xc1, + 0xcf, 0xe0, 0xd9, 0x54, 0x57, 0x60, 0x98, 0xfd, 0xce, 0xe7, 0x7a, 0xae, 0xcf, 0x5c, 0xb7, 0x29, + 0xaf, 0xe4, 0x89, 0xa0, 0x0d, 0x28, 0xab, 0xc4, 0x71, 0x65, 0xff, 0xf8, 0xc8, 0x0f, 0xb4, 0x31, + 0x4a, 0x54, 0x76, 0x35, 0x79, 0x84, 0x14, 0x12, 0x47, 0x48, 0x86, 0x25, 0xd5, 0xfe, 0x9e, 0xff, + 0xec, 0xf1, 0x9c, 0xf0, 0xe8, 0xf1, 0x9c, 0xf0, 0xb7, 0xc7, 0x73, 0xc2, 0xa7, 0x4f, 0xe6, 0x72, + 0x8f, 0x9e, 0xcc, 0xe5, 0xfe, 0xf2, 0x64, 0x2e, 0x07, 0x17, 0x14, 0xb3, 0x9d, 0xc1, 0xce, 0xb5, + 0xa9, 0x68, 0xa2, 0x67, 0x9b, 0xae, 0xd9, 0x10, 0x1e, 0x34, 0xf7, 0x34, 0xb7, 0xd5, 0x69, 0x56, + 0x15, 0xb3, 0xbd, 0xa0, 0x98, 0x4e, 0xdb, 0x74, 0x16, 0x6c, 0xa2, 0xe3, 0x43, 0x62, 0x2f, 0x74, + 0x17, 0x83, 0x26, 0xcb, 0xc7, 0x9c, 0x85, 0xfe, 0xff, 0xa2, 0xf0, 0x4e, 0x84, 0xe8, 0xd3, 0x7e, + 0x91, 0x2f, 0x34, 0xd6, 0xee, 0xfe, 0x2a, 0x2f, 0x36, 0xfc, 0x29, 0xae, 0xd1, 0x29, 0x46, 0x26, + 0x53, 0xdd, 0xe6, 0xac, 0x7f, 0x08, 0x99, 0x76, 0x28, 0xd3, 0x4e, 0x84, 0x69, 0xc7, 0x67, 0x7a, + 0x9c, 0xaf, 0xf6, 0x67, 0xda, 0xf9, 0xa0, 0x51, 0xf3, 0x3f, 0x6a, 0xfa, 0x67, 0xfe, 0xbc, 0x2f, + 0xb0, 0xb2, 0x42, 0x25, 0x56, 0x56, 0x22, 0x22, 0x2b, 0x2b, 0xbe, 0x4c, 0xb3, 0xc8, 0xfe, 0xb5, + 0x60, 0xe9, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc0, 0x83, 0x14, 0xde, 0x8c, 0x31, 0x00, 0x00, +} + +func (m *Transaction) 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 *Transaction) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Transaction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Anchor != nil { + { + size, err := m.Anchor.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.BindingSig) > 0 { + i -= len(m.BindingSig) + copy(dAtA[i:], m.BindingSig) + i = encodeVarintTransaction(dAtA, i, uint64(len(m.BindingSig))) + i-- + dAtA[i] = 0x12 + } + if m.Body != nil { + { + size, err := m.Body.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Id) 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 *Id) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Id) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintTransaction(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EffectHash) 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 *EffectHash) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EffectHash) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintTransaction(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TransactionBody) 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 *TransactionBody) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TransactionBody) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XEncryptedMemo != nil { + { + size := m.XEncryptedMemo.Size() + i -= size + if _, err := m.XEncryptedMemo.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.FmdClues) > 0 { + for iNdEx := len(m.FmdClues) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FmdClues[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if m.Fee != nil { + { + size, err := m.Fee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintTransaction(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0x1a + } + if m.ExpiryHeight != 0 { + i = encodeVarintTransaction(dAtA, i, uint64(m.ExpiryHeight)) + i-- + dAtA[i] = 0x10 + } + if len(m.Actions) > 0 { + for iNdEx := len(m.Actions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Actions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *TransactionBody_EncryptedMemo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TransactionBody_EncryptedMemo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.EncryptedMemo != nil { + i -= len(m.EncryptedMemo) + copy(dAtA[i:], m.EncryptedMemo) + i = encodeVarintTransaction(dAtA, i, uint64(len(m.EncryptedMemo))) + i-- + dAtA[i] = 0x32 + } + return len(dAtA) - i, nil +} +func (m *Action) 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 *Action) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Action) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Action != nil { + { + size := m.Action.Size() + i -= size + if _, err := m.Action.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *Action_Spend) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Action_Spend) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Spend != nil { + { + size, err := m.Spend.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *Action_Output) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Action_Output) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Output != nil { + { + size, err := m.Output.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *Action_Swap) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Action_Swap) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Swap != nil { + { + size, err := m.Swap.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *Action_SwapClaim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Action_SwapClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.SwapClaim != nil { + { + size, err := m.SwapClaim.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *Action_ValidatorDefinition) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Action_ValidatorDefinition) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ValidatorDefinition != nil { + { + size, err := m.ValidatorDefinition.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + return len(dAtA) - i, nil +} +func (m *Action_IbcAction) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Action_IbcAction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.IbcAction != nil { + { + size, err := m.IbcAction.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + return len(dAtA) - i, nil +} +func (m *Action_ProposalSubmit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Action_ProposalSubmit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ProposalSubmit != nil { + { + size, err := m.ProposalSubmit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + return len(dAtA) - i, nil +} +func (m *Action_ProposalWithdraw) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Action_ProposalWithdraw) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ProposalWithdraw != nil { + { + size, err := m.ProposalWithdraw.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + } + return len(dAtA) - i, nil +} +func (m *Action_ValidatorVote) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Action_ValidatorVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ValidatorVote != nil { + { + size, err := m.ValidatorVote.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + return len(dAtA) - i, nil +} +func (m *Action_DelegatorVote) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Action_DelegatorVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.DelegatorVote != nil { + { + size, err := m.DelegatorVote.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + return len(dAtA) - i, nil +} +func (m *Action_ProposalDepositClaim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Action_ProposalDepositClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ProposalDepositClaim != nil { + { + size, err := m.ProposalDepositClaim.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + return len(dAtA) - i, nil +} +func (m *Action_PositionOpen) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Action_PositionOpen) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.PositionOpen != nil { + { + size, err := m.PositionOpen.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xf2 + } + return len(dAtA) - i, nil +} +func (m *Action_PositionClose) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Action_PositionClose) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.PositionClose != nil { + { + size, err := m.PositionClose.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xfa + } + return len(dAtA) - i, nil +} +func (m *Action_PositionWithdraw) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Action_PositionWithdraw) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.PositionWithdraw != nil { + { + size, err := m.PositionWithdraw.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x82 + } + return len(dAtA) - i, nil +} +func (m *Action_PositionRewardClaim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Action_PositionRewardClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.PositionRewardClaim != nil { + { + size, err := m.PositionRewardClaim.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x92 + } + return len(dAtA) - i, nil +} +func (m *Action_Delegate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Action_Delegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Delegate != nil { + { + size, err := m.Delegate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xc2 + } + return len(dAtA) - i, nil +} +func (m *Action_Undelegate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Action_Undelegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Undelegate != nil { + { + size, err := m.Undelegate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xca + } + return len(dAtA) - i, nil +} +func (m *Action_UndelegateClaim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Action_UndelegateClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.UndelegateClaim != nil { + { + size, err := m.UndelegateClaim.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xd2 + } + return len(dAtA) - i, nil +} +func (m *Action_DaoSpend) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Action_DaoSpend) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.DaoSpend != nil { + { + size, err := m.DaoSpend.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3 + i-- + dAtA[i] = 0x92 + } + return len(dAtA) - i, nil +} +func (m *Action_DaoOutput) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Action_DaoOutput) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.DaoOutput != nil { + { + size, err := m.DaoOutput.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3 + i-- + dAtA[i] = 0x9a + } + return len(dAtA) - i, nil +} +func (m *Action_DaoDeposit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Action_DaoDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.DaoDeposit != nil { + { + size, err := m.DaoDeposit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3 + i-- + dAtA[i] = 0xa2 + } + return len(dAtA) - i, nil +} +func (m *Action_Ics20Withdrawal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Action_Ics20Withdrawal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Ics20Withdrawal != nil { + { + size, err := m.Ics20Withdrawal.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xc + i-- + dAtA[i] = 0xc2 + } + return len(dAtA) - i, nil +} +func (m *TransactionPerspective) 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 *TransactionPerspective) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TransactionPerspective) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TransactionId != nil { + { + size, err := m.TransactionId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if len(m.Denoms) > 0 { + for iNdEx := len(m.Denoms) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Denoms[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.AddressViews) > 0 { + for iNdEx := len(m.AddressViews) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AddressViews[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.AdviceNotes) > 0 { + for iNdEx := len(m.AdviceNotes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AdviceNotes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.SpendNullifiers) > 0 { + for iNdEx := len(m.SpendNullifiers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SpendNullifiers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.PayloadKeys) > 0 { + for iNdEx := len(m.PayloadKeys) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PayloadKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *PayloadKey) 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 *PayloadKey) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PayloadKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintTransaction(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PayloadKeyWithCommitment) 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 *PayloadKeyWithCommitment) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PayloadKeyWithCommitment) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Commitment != nil { + { + size, err := m.Commitment.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.PayloadKey != nil { + { + size, err := m.PayloadKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NullifierWithNote) 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 *NullifierWithNote) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NullifierWithNote) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Note != nil { + { + size, err := m.Note.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Nullifier != nil { + { + size, err := m.Nullifier.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TransactionView) 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 *TransactionView) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TransactionView) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Anchor != nil { + { + size, err := m.Anchor.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.BindingSig) > 0 { + i -= len(m.BindingSig) + copy(dAtA[i:], m.BindingSig) + i = encodeVarintTransaction(dAtA, i, uint64(len(m.BindingSig))) + i-- + dAtA[i] = 0x12 + } + if m.BodyView != nil { + { + size, err := m.BodyView.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TransactionBodyView) 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 *TransactionBodyView) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TransactionBodyView) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XMemoView != nil { + { + size := m.XMemoView.Size() + i -= size + if _, err := m.XMemoView.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.FmdClues) > 0 { + for iNdEx := len(m.FmdClues) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FmdClues[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if m.Fee != nil { + { + size, err := m.Fee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintTransaction(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0x1a + } + if m.ExpiryHeight != 0 { + i = encodeVarintTransaction(dAtA, i, uint64(m.ExpiryHeight)) + i-- + dAtA[i] = 0x10 + } + if len(m.ActionViews) > 0 { + for iNdEx := len(m.ActionViews) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ActionViews[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *TransactionBodyView_MemoView) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TransactionBodyView_MemoView) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.MemoView != nil { + { + size, err := m.MemoView.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + return len(dAtA) - i, nil +} +func (m *ActionView) 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 *ActionView) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionView) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ActionView != nil { + { + size := m.ActionView.Size() + i -= size + if _, err := m.ActionView.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *ActionView_Spend) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionView_Spend) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Spend != nil { + { + size, err := m.Spend.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *ActionView_Output) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionView_Output) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Output != nil { + { + size, err := m.Output.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *ActionView_Swap) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionView_Swap) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Swap != nil { + { + size, err := m.Swap.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *ActionView_SwapClaim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionView_SwapClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.SwapClaim != nil { + { + size, err := m.SwapClaim.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *ActionView_ValidatorDefinition) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionView_ValidatorDefinition) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ValidatorDefinition != nil { + { + size, err := m.ValidatorDefinition.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + return len(dAtA) - i, nil +} +func (m *ActionView_IbcAction) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionView_IbcAction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.IbcAction != nil { + { + size, err := m.IbcAction.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + return len(dAtA) - i, nil +} +func (m *ActionView_ProposalSubmit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionView_ProposalSubmit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ProposalSubmit != nil { + { + size, err := m.ProposalSubmit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + return len(dAtA) - i, nil +} +func (m *ActionView_ProposalWithdraw) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionView_ProposalWithdraw) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ProposalWithdraw != nil { + { + size, err := m.ProposalWithdraw.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + } + return len(dAtA) - i, nil +} +func (m *ActionView_ValidatorVote) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionView_ValidatorVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ValidatorVote != nil { + { + size, err := m.ValidatorVote.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + return len(dAtA) - i, nil +} +func (m *ActionView_DelegatorVote) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionView_DelegatorVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.DelegatorVote != nil { + { + size, err := m.DelegatorVote.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + return len(dAtA) - i, nil +} +func (m *ActionView_ProposalDepositClaim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionView_ProposalDepositClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ProposalDepositClaim != nil { + { + size, err := m.ProposalDepositClaim.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + return len(dAtA) - i, nil +} +func (m *ActionView_PositionOpen) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionView_PositionOpen) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.PositionOpen != nil { + { + size, err := m.PositionOpen.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xf2 + } + return len(dAtA) - i, nil +} +func (m *ActionView_PositionClose) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionView_PositionClose) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.PositionClose != nil { + { + size, err := m.PositionClose.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xfa + } + return len(dAtA) - i, nil +} +func (m *ActionView_PositionWithdraw) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionView_PositionWithdraw) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.PositionWithdraw != nil { + { + size, err := m.PositionWithdraw.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x82 + } + return len(dAtA) - i, nil +} +func (m *ActionView_PositionRewardClaim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionView_PositionRewardClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.PositionRewardClaim != nil { + { + size, err := m.PositionRewardClaim.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x92 + } + return len(dAtA) - i, nil +} +func (m *ActionView_Delegate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionView_Delegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Delegate != nil { + { + size, err := m.Delegate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xca + } + return len(dAtA) - i, nil +} +func (m *ActionView_Undelegate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionView_Undelegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Undelegate != nil { + { + size, err := m.Undelegate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xd2 + } + return len(dAtA) - i, nil +} +func (m *ActionView_UndelegateClaim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionView_UndelegateClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.UndelegateClaim != nil { + { + size, err := m.UndelegateClaim.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xda + } + return len(dAtA) - i, nil +} +func (m *ActionView_DaoSpend) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionView_DaoSpend) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.DaoSpend != nil { + { + size, err := m.DaoSpend.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3 + i-- + dAtA[i] = 0x92 + } + return len(dAtA) - i, nil +} +func (m *ActionView_DaoOutput) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionView_DaoOutput) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.DaoOutput != nil { + { + size, err := m.DaoOutput.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3 + i-- + dAtA[i] = 0x9a + } + return len(dAtA) - i, nil +} +func (m *ActionView_DaoDeposit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionView_DaoDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.DaoDeposit != nil { + { + size, err := m.DaoDeposit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3 + i-- + dAtA[i] = 0xa2 + } + return len(dAtA) - i, nil +} +func (m *ActionView_Ics20Withdrawal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionView_Ics20Withdrawal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Ics20Withdrawal != nil { + { + size, err := m.Ics20Withdrawal.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xc + i-- + dAtA[i] = 0xc2 + } + return len(dAtA) - i, nil +} +func (m *SpendView) 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 *SpendView) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpendView) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SpendView != nil { + { + size := m.SpendView.Size() + i -= size + if _, err := m.SpendView.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *SpendView_Visible_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpendView_Visible_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Visible != nil { + { + size, err := m.Visible.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *SpendView_Opaque_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpendView_Opaque_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Opaque != nil { + { + size, err := m.Opaque.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *SpendView_Visible) 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 *SpendView_Visible) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpendView_Visible) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Note != nil { + { + size, err := m.Note.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Spend != nil { + { + size, err := m.Spend.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SpendView_Opaque) 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 *SpendView_Opaque) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpendView_Opaque) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Spend != nil { + { + size, err := m.Spend.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DelegatorVoteView) 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 *DelegatorVoteView) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DelegatorVoteView) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.DelegatorVote != nil { + { + size := m.DelegatorVote.Size() + i -= size + if _, err := m.DelegatorVote.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *DelegatorVoteView_Visible_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DelegatorVoteView_Visible_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Visible != nil { + { + size, err := m.Visible.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *DelegatorVoteView_Opaque_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DelegatorVoteView_Opaque_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Opaque != nil { + { + size, err := m.Opaque.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *DelegatorVoteView_Visible) 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 *DelegatorVoteView_Visible) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DelegatorVoteView_Visible) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Note != nil { + { + size, err := m.Note.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.DelegatorVote != nil { + { + size, err := m.DelegatorVote.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DelegatorVoteView_Opaque) 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 *DelegatorVoteView_Opaque) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DelegatorVoteView_Opaque) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.DelegatorVote != nil { + { + size, err := m.DelegatorVote.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *OutputView) 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 *OutputView) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OutputView) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.OutputView != nil { + { + size := m.OutputView.Size() + i -= size + if _, err := m.OutputView.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *OutputView_Visible_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OutputView_Visible_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Visible != nil { + { + size, err := m.Visible.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *OutputView_Opaque_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OutputView_Opaque_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Opaque != nil { + { + size, err := m.Opaque.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *OutputView_Visible) 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 *OutputView_Visible) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OutputView_Visible) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PayloadKey != nil { + { + size, err := m.PayloadKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Note != nil { + { + size, err := m.Note.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Output != nil { + { + size, err := m.Output.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *OutputView_Opaque) 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 *OutputView_Opaque) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OutputView_Opaque) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Output != nil { + { + size, err := m.Output.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Spend) 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 *Spend) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Spend) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Proof != nil { + { + size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.AuthSig != nil { + { + size, err := m.AuthSig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Body != nil { + { + size, err := m.Body.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SpendBody) 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 *SpendBody) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpendBody) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Rk) > 0 { + i -= len(m.Rk) + copy(dAtA[i:], m.Rk) + i = encodeVarintTransaction(dAtA, i, uint64(len(m.Rk))) + i-- + dAtA[i] = 0x22 + } + if len(m.Nullifier) > 0 { + i -= len(m.Nullifier) + copy(dAtA[i:], m.Nullifier) + i = encodeVarintTransaction(dAtA, i, uint64(len(m.Nullifier))) + i-- + dAtA[i] = 0x1a + } + if m.BalanceCommitment != nil { + { + size, err := m.BalanceCommitment.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Output) 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 *Output) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Output) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Proof != nil { + { + size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Body != nil { + { + size, err := m.Body.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *OutputBody) 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 *OutputBody) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OutputBody) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.OvkWrappedKey) > 0 { + i -= len(m.OvkWrappedKey) + copy(dAtA[i:], m.OvkWrappedKey) + i = encodeVarintTransaction(dAtA, i, uint64(len(m.OvkWrappedKey))) + i-- + dAtA[i] = 0x22 + } + if len(m.WrappedMemoKey) > 0 { + i -= len(m.WrappedMemoKey) + copy(dAtA[i:], m.WrappedMemoKey) + i = encodeVarintTransaction(dAtA, i, uint64(len(m.WrappedMemoKey))) + i-- + dAtA[i] = 0x1a + } + if m.BalanceCommitment != nil { + { + size, err := m.BalanceCommitment.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.NotePayload != nil { + { + size, err := m.NotePayload.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AuthorizationData) 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 *AuthorizationData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthorizationData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DelegatorVoteAuths) > 0 { + for iNdEx := len(m.DelegatorVoteAuths) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DelegatorVoteAuths[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.SpendAuths) > 0 { + for iNdEx := len(m.SpendAuths) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SpendAuths[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.EffectHash != nil { + { + size, err := m.EffectHash.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *WitnessData) 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 *WitnessData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WitnessData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.StateCommitmentProofs) > 0 { + for iNdEx := len(m.StateCommitmentProofs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.StateCommitmentProofs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Anchor != nil { + { + size, err := m.Anchor.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TransactionPlan) 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 *TransactionPlan) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TransactionPlan) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MemoPlan != nil { + { + size, err := m.MemoPlan.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if len(m.CluePlans) > 0 { + for iNdEx := len(m.CluePlans) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.CluePlans[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if m.Fee != nil { + { + size, err := m.Fee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintTransaction(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0x1a + } + if m.ExpiryHeight != 0 { + i = encodeVarintTransaction(dAtA, i, uint64(m.ExpiryHeight)) + i-- + dAtA[i] = 0x10 + } + if len(m.Actions) > 0 { + for iNdEx := len(m.Actions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Actions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ActionPlan) 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 *ActionPlan) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionPlan) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Action != nil { + { + size := m.Action.Size() + i -= size + if _, err := m.Action.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *ActionPlan_Spend) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionPlan_Spend) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Spend != nil { + { + size, err := m.Spend.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *ActionPlan_Output) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionPlan_Output) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Output != nil { + { + size, err := m.Output.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *ActionPlan_Swap) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionPlan_Swap) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Swap != nil { + { + size, err := m.Swap.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *ActionPlan_SwapClaim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionPlan_SwapClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.SwapClaim != nil { + { + size, err := m.SwapClaim.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *ActionPlan_ValidatorDefinition) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionPlan_ValidatorDefinition) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ValidatorDefinition != nil { + { + size, err := m.ValidatorDefinition.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + return len(dAtA) - i, nil +} +func (m *ActionPlan_IbcAction) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionPlan_IbcAction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.IbcAction != nil { + { + size, err := m.IbcAction.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + return len(dAtA) - i, nil +} +func (m *ActionPlan_ProposalSubmit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionPlan_ProposalSubmit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ProposalSubmit != nil { + { + size, err := m.ProposalSubmit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + return len(dAtA) - i, nil +} +func (m *ActionPlan_ProposalWithdraw) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionPlan_ProposalWithdraw) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ProposalWithdraw != nil { + { + size, err := m.ProposalWithdraw.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + } + return len(dAtA) - i, nil +} +func (m *ActionPlan_ValidatorVote) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionPlan_ValidatorVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ValidatorVote != nil { + { + size, err := m.ValidatorVote.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + return len(dAtA) - i, nil +} +func (m *ActionPlan_DelegatorVote) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionPlan_DelegatorVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.DelegatorVote != nil { + { + size, err := m.DelegatorVote.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + return len(dAtA) - i, nil +} +func (m *ActionPlan_ProposalDepositClaim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionPlan_ProposalDepositClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ProposalDepositClaim != nil { + { + size, err := m.ProposalDepositClaim.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + return len(dAtA) - i, nil +} +func (m *ActionPlan_Withdrawal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionPlan_Withdrawal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Withdrawal != nil { + { + size, err := m.Withdrawal.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xba + } + return len(dAtA) - i, nil +} +func (m *ActionPlan_PositionOpen) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionPlan_PositionOpen) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.PositionOpen != nil { + { + size, err := m.PositionOpen.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xf2 + } + return len(dAtA) - i, nil +} +func (m *ActionPlan_PositionClose) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionPlan_PositionClose) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.PositionClose != nil { + { + size, err := m.PositionClose.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xfa + } + return len(dAtA) - i, nil +} +func (m *ActionPlan_PositionWithdraw) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionPlan_PositionWithdraw) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.PositionWithdraw != nil { + { + size, err := m.PositionWithdraw.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x82 + } + return len(dAtA) - i, nil +} +func (m *ActionPlan_PositionRewardClaim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionPlan_PositionRewardClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.PositionRewardClaim != nil { + { + size, err := m.PositionRewardClaim.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x92 + } + return len(dAtA) - i, nil +} +func (m *ActionPlan_Delegate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionPlan_Delegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Delegate != nil { + { + size, err := m.Delegate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xc2 + } + return len(dAtA) - i, nil +} +func (m *ActionPlan_Undelegate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionPlan_Undelegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Undelegate != nil { + { + size, err := m.Undelegate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xca + } + return len(dAtA) - i, nil +} +func (m *ActionPlan_UndelegateClaim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionPlan_UndelegateClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.UndelegateClaim != nil { + { + size, err := m.UndelegateClaim.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xd2 + } + return len(dAtA) - i, nil +} +func (m *ActionPlan_DaoSpend) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionPlan_DaoSpend) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.DaoSpend != nil { + { + size, err := m.DaoSpend.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3 + i-- + dAtA[i] = 0x92 + } + return len(dAtA) - i, nil +} +func (m *ActionPlan_DaoOutput) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionPlan_DaoOutput) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.DaoOutput != nil { + { + size, err := m.DaoOutput.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3 + i-- + dAtA[i] = 0x9a + } + return len(dAtA) - i, nil +} +func (m *ActionPlan_DaoDeposit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActionPlan_DaoDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.DaoDeposit != nil { + { + size, err := m.DaoDeposit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3 + i-- + dAtA[i] = 0xa2 + } + return len(dAtA) - i, nil +} +func (m *CluePlan) 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 *CluePlan) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CluePlan) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PrecisionBits != 0 { + i = encodeVarintTransaction(dAtA, i, uint64(m.PrecisionBits)) + i-- + dAtA[i] = 0x18 + } + if len(m.Rseed) > 0 { + i -= len(m.Rseed) + copy(dAtA[i:], m.Rseed) + i = encodeVarintTransaction(dAtA, i, uint64(len(m.Rseed))) + i-- + dAtA[i] = 0x12 + } + if m.Address != nil { + { + size, err := m.Address.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MemoPlan) 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 *MemoPlan) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MemoPlan) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintTransaction(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0x12 + } + if m.Plaintext != nil { + { + size, err := m.Plaintext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MemoCiphertext) 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 *MemoCiphertext) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MemoCiphertext) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintTransaction(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MemoPlaintext) 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 *MemoPlaintext) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MemoPlaintext) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Text) > 0 { + i -= len(m.Text) + copy(dAtA[i:], m.Text) + i = encodeVarintTransaction(dAtA, i, uint64(len(m.Text))) + i-- + dAtA[i] = 0x12 + } + if m.Sender != nil { + { + size, err := m.Sender.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MemoView) 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 *MemoView) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MemoView) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MemoView != nil { + { + size := m.MemoView.Size() + i -= size + if _, err := m.MemoView.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *MemoView_Visible_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MemoView_Visible_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Visible != nil { + { + size, err := m.Visible.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *MemoView_Opaque_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MemoView_Opaque_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Opaque != nil { + { + size, err := m.Opaque.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *MemoView_Visible) 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 *MemoView_Visible) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MemoView_Visible) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Plaintext != nil { + { + size, err := m.Plaintext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Ciphertext != nil { + { + size, err := m.Ciphertext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MemoView_Opaque) 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 *MemoView_Opaque) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MemoView_Opaque) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Ciphertext != nil { + { + size, err := m.Ciphertext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SpendPlan) 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 *SpendPlan) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpendPlan) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ValueBlinding) > 0 { + i -= len(m.ValueBlinding) + copy(dAtA[i:], m.ValueBlinding) + i = encodeVarintTransaction(dAtA, i, uint64(len(m.ValueBlinding))) + i-- + dAtA[i] = 0x22 + } + if len(m.Randomizer) > 0 { + i -= len(m.Randomizer) + copy(dAtA[i:], m.Randomizer) + i = encodeVarintTransaction(dAtA, i, uint64(len(m.Randomizer))) + i-- + dAtA[i] = 0x1a + } + if m.Position != 0 { + i = encodeVarintTransaction(dAtA, i, uint64(m.Position)) + i-- + dAtA[i] = 0x10 + } + if m.Note != nil { + { + size, err := m.Note.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *OutputPlan) 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 *OutputPlan) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OutputPlan) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ValueBlinding) > 0 { + i -= len(m.ValueBlinding) + copy(dAtA[i:], m.ValueBlinding) + i = encodeVarintTransaction(dAtA, i, uint64(len(m.ValueBlinding))) + i-- + dAtA[i] = 0x22 + } + if len(m.Rseed) > 0 { + i -= len(m.Rseed) + copy(dAtA[i:], m.Rseed) + i = encodeVarintTransaction(dAtA, i, uint64(len(m.Rseed))) + i-- + dAtA[i] = 0x1a + } + if m.DestAddress != nil { + { + size, err := m.DestAddress.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Value != nil { + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransaction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintTransaction(dAtA []byte, offset int, v uint64) int { + offset -= sovTransaction(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Transaction) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Body != nil { + l = m.Body.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + l = len(m.BindingSig) + if l > 0 { + n += 1 + l + sovTransaction(uint64(l)) + } + if m.Anchor != nil { + l = m.Anchor.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} + +func (m *Id) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} + +func (m *EffectHash) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} + +func (m *TransactionBody) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Actions) > 0 { + for _, e := range m.Actions { + l = e.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + } + if m.ExpiryHeight != 0 { + n += 1 + sovTransaction(uint64(m.ExpiryHeight)) + } + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovTransaction(uint64(l)) + } + if m.Fee != nil { + l = m.Fee.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + if len(m.FmdClues) > 0 { + for _, e := range m.FmdClues { + l = e.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + } + if m.XEncryptedMemo != nil { + n += m.XEncryptedMemo.Size() + } + return n +} + +func (m *TransactionBody_EncryptedMemo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.EncryptedMemo != nil { + l = len(m.EncryptedMemo) + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *Action) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Action != nil { + n += m.Action.Size() + } + return n +} + +func (m *Action_Spend) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Spend != nil { + l = m.Spend.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *Action_Output) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Output != nil { + l = m.Output.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *Action_Swap) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Swap != nil { + l = m.Swap.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *Action_SwapClaim) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SwapClaim != nil { + l = m.SwapClaim.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *Action_ValidatorDefinition) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ValidatorDefinition != nil { + l = m.ValidatorDefinition.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *Action_IbcAction) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.IbcAction != nil { + l = m.IbcAction.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *Action_ProposalSubmit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalSubmit != nil { + l = m.ProposalSubmit.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *Action_ProposalWithdraw) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalWithdraw != nil { + l = m.ProposalWithdraw.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *Action_ValidatorVote) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ValidatorVote != nil { + l = m.ValidatorVote.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *Action_DelegatorVote) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DelegatorVote != nil { + l = m.DelegatorVote.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *Action_ProposalDepositClaim) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalDepositClaim != nil { + l = m.ProposalDepositClaim.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *Action_PositionOpen) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PositionOpen != nil { + l = m.PositionOpen.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *Action_PositionClose) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PositionClose != nil { + l = m.PositionClose.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *Action_PositionWithdraw) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PositionWithdraw != nil { + l = m.PositionWithdraw.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *Action_PositionRewardClaim) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PositionRewardClaim != nil { + l = m.PositionRewardClaim.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *Action_Delegate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Delegate != nil { + l = m.Delegate.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *Action_Undelegate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Undelegate != nil { + l = m.Undelegate.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *Action_UndelegateClaim) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.UndelegateClaim != nil { + l = m.UndelegateClaim.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *Action_DaoSpend) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DaoSpend != nil { + l = m.DaoSpend.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *Action_DaoOutput) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DaoOutput != nil { + l = m.DaoOutput.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *Action_DaoDeposit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DaoDeposit != nil { + l = m.DaoDeposit.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *Action_Ics20Withdrawal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Ics20Withdrawal != nil { + l = m.Ics20Withdrawal.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *TransactionPerspective) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.PayloadKeys) > 0 { + for _, e := range m.PayloadKeys { + l = e.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + } + if len(m.SpendNullifiers) > 0 { + for _, e := range m.SpendNullifiers { + l = e.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + } + if len(m.AdviceNotes) > 0 { + for _, e := range m.AdviceNotes { + l = e.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + } + if len(m.AddressViews) > 0 { + for _, e := range m.AddressViews { + l = e.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + } + if len(m.Denoms) > 0 { + for _, e := range m.Denoms { + l = e.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + } + if m.TransactionId != nil { + l = m.TransactionId.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} + +func (m *PayloadKey) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} + +func (m *PayloadKeyWithCommitment) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PayloadKey != nil { + l = m.PayloadKey.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + if m.Commitment != nil { + l = m.Commitment.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} + +func (m *NullifierWithNote) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Nullifier != nil { + l = m.Nullifier.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + if m.Note != nil { + l = m.Note.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} + +func (m *TransactionView) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BodyView != nil { + l = m.BodyView.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + l = len(m.BindingSig) + if l > 0 { + n += 1 + l + sovTransaction(uint64(l)) + } + if m.Anchor != nil { + l = m.Anchor.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} + +func (m *TransactionBodyView) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ActionViews) > 0 { + for _, e := range m.ActionViews { + l = e.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + } + if m.ExpiryHeight != 0 { + n += 1 + sovTransaction(uint64(m.ExpiryHeight)) + } + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovTransaction(uint64(l)) + } + if m.Fee != nil { + l = m.Fee.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + if len(m.FmdClues) > 0 { + for _, e := range m.FmdClues { + l = e.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + } + if m.XMemoView != nil { + n += m.XMemoView.Size() + } + return n +} + +func (m *TransactionBodyView_MemoView) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MemoView != nil { + l = m.MemoView.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionView) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ActionView != nil { + n += m.ActionView.Size() + } + return n +} + +func (m *ActionView_Spend) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Spend != nil { + l = m.Spend.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionView_Output) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Output != nil { + l = m.Output.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionView_Swap) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Swap != nil { + l = m.Swap.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionView_SwapClaim) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SwapClaim != nil { + l = m.SwapClaim.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionView_ValidatorDefinition) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ValidatorDefinition != nil { + l = m.ValidatorDefinition.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionView_IbcAction) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.IbcAction != nil { + l = m.IbcAction.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionView_ProposalSubmit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalSubmit != nil { + l = m.ProposalSubmit.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionView_ProposalWithdraw) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalWithdraw != nil { + l = m.ProposalWithdraw.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionView_ValidatorVote) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ValidatorVote != nil { + l = m.ValidatorVote.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionView_DelegatorVote) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DelegatorVote != nil { + l = m.DelegatorVote.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionView_ProposalDepositClaim) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalDepositClaim != nil { + l = m.ProposalDepositClaim.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionView_PositionOpen) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PositionOpen != nil { + l = m.PositionOpen.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionView_PositionClose) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PositionClose != nil { + l = m.PositionClose.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionView_PositionWithdraw) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PositionWithdraw != nil { + l = m.PositionWithdraw.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionView_PositionRewardClaim) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PositionRewardClaim != nil { + l = m.PositionRewardClaim.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionView_Delegate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Delegate != nil { + l = m.Delegate.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionView_Undelegate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Undelegate != nil { + l = m.Undelegate.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionView_UndelegateClaim) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.UndelegateClaim != nil { + l = m.UndelegateClaim.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionView_DaoSpend) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DaoSpend != nil { + l = m.DaoSpend.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionView_DaoOutput) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DaoOutput != nil { + l = m.DaoOutput.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionView_DaoDeposit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DaoDeposit != nil { + l = m.DaoDeposit.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionView_Ics20Withdrawal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Ics20Withdrawal != nil { + l = m.Ics20Withdrawal.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *SpendView) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SpendView != nil { + n += m.SpendView.Size() + } + return n +} + +func (m *SpendView_Visible_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Visible != nil { + l = m.Visible.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *SpendView_Opaque_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Opaque != nil { + l = m.Opaque.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *SpendView_Visible) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Spend != nil { + l = m.Spend.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + if m.Note != nil { + l = m.Note.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} + +func (m *SpendView_Opaque) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Spend != nil { + l = m.Spend.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} + +func (m *DelegatorVoteView) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DelegatorVote != nil { + n += m.DelegatorVote.Size() + } + return n +} + +func (m *DelegatorVoteView_Visible_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Visible != nil { + l = m.Visible.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *DelegatorVoteView_Opaque_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Opaque != nil { + l = m.Opaque.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *DelegatorVoteView_Visible) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DelegatorVote != nil { + l = m.DelegatorVote.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + if m.Note != nil { + l = m.Note.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} + +func (m *DelegatorVoteView_Opaque) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DelegatorVote != nil { + l = m.DelegatorVote.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} + +func (m *OutputView) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.OutputView != nil { + n += m.OutputView.Size() + } + return n +} + +func (m *OutputView_Visible_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Visible != nil { + l = m.Visible.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *OutputView_Opaque_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Opaque != nil { + l = m.Opaque.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *OutputView_Visible) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Output != nil { + l = m.Output.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + if m.Note != nil { + l = m.Note.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + if m.PayloadKey != nil { + l = m.PayloadKey.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} + +func (m *OutputView_Opaque) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Output != nil { + l = m.Output.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} + +func (m *Spend) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Body != nil { + l = m.Body.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + if m.AuthSig != nil { + l = m.AuthSig.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + if m.Proof != nil { + l = m.Proof.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} + +func (m *SpendBody) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BalanceCommitment != nil { + l = m.BalanceCommitment.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + l = len(m.Nullifier) + if l > 0 { + n += 1 + l + sovTransaction(uint64(l)) + } + l = len(m.Rk) + if l > 0 { + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} + +func (m *Output) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Body != nil { + l = m.Body.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + if m.Proof != nil { + l = m.Proof.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} + +func (m *OutputBody) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NotePayload != nil { + l = m.NotePayload.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + if m.BalanceCommitment != nil { + l = m.BalanceCommitment.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + l = len(m.WrappedMemoKey) + if l > 0 { + n += 1 + l + sovTransaction(uint64(l)) + } + l = len(m.OvkWrappedKey) + if l > 0 { + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} + +func (m *AuthorizationData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.EffectHash != nil { + l = m.EffectHash.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + if len(m.SpendAuths) > 0 { + for _, e := range m.SpendAuths { + l = e.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + } + if len(m.DelegatorVoteAuths) > 0 { + for _, e := range m.DelegatorVoteAuths { + l = e.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + } + return n +} + +func (m *WitnessData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Anchor != nil { + l = m.Anchor.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + if len(m.StateCommitmentProofs) > 0 { + for _, e := range m.StateCommitmentProofs { + l = e.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + } + return n +} + +func (m *TransactionPlan) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Actions) > 0 { + for _, e := range m.Actions { + l = e.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + } + if m.ExpiryHeight != 0 { + n += 1 + sovTransaction(uint64(m.ExpiryHeight)) + } + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovTransaction(uint64(l)) + } + if m.Fee != nil { + l = m.Fee.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + if len(m.CluePlans) > 0 { + for _, e := range m.CluePlans { + l = e.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + } + if m.MemoPlan != nil { + l = m.MemoPlan.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} + +func (m *ActionPlan) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Action != nil { + n += m.Action.Size() + } + return n +} + +func (m *ActionPlan_Spend) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Spend != nil { + l = m.Spend.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionPlan_Output) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Output != nil { + l = m.Output.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionPlan_Swap) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Swap != nil { + l = m.Swap.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionPlan_SwapClaim) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SwapClaim != nil { + l = m.SwapClaim.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionPlan_ValidatorDefinition) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ValidatorDefinition != nil { + l = m.ValidatorDefinition.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionPlan_IbcAction) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.IbcAction != nil { + l = m.IbcAction.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionPlan_ProposalSubmit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalSubmit != nil { + l = m.ProposalSubmit.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionPlan_ProposalWithdraw) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalWithdraw != nil { + l = m.ProposalWithdraw.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionPlan_ValidatorVote) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ValidatorVote != nil { + l = m.ValidatorVote.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionPlan_DelegatorVote) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DelegatorVote != nil { + l = m.DelegatorVote.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionPlan_ProposalDepositClaim) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalDepositClaim != nil { + l = m.ProposalDepositClaim.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionPlan_Withdrawal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Withdrawal != nil { + l = m.Withdrawal.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionPlan_PositionOpen) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PositionOpen != nil { + l = m.PositionOpen.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionPlan_PositionClose) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PositionClose != nil { + l = m.PositionClose.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionPlan_PositionWithdraw) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PositionWithdraw != nil { + l = m.PositionWithdraw.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionPlan_PositionRewardClaim) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PositionRewardClaim != nil { + l = m.PositionRewardClaim.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionPlan_Delegate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Delegate != nil { + l = m.Delegate.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionPlan_Undelegate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Undelegate != nil { + l = m.Undelegate.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionPlan_UndelegateClaim) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.UndelegateClaim != nil { + l = m.UndelegateClaim.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionPlan_DaoSpend) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DaoSpend != nil { + l = m.DaoSpend.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionPlan_DaoOutput) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DaoOutput != nil { + l = m.DaoOutput.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *ActionPlan_DaoDeposit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DaoDeposit != nil { + l = m.DaoDeposit.Size() + n += 2 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *CluePlan) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Address != nil { + l = m.Address.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + l = len(m.Rseed) + if l > 0 { + n += 1 + l + sovTransaction(uint64(l)) + } + if m.PrecisionBits != 0 { + n += 1 + sovTransaction(uint64(m.PrecisionBits)) + } + return n +} + +func (m *MemoPlan) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Plaintext != nil { + l = m.Plaintext.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + l = len(m.Key) + if l > 0 { + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} + +func (m *MemoCiphertext) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} + +func (m *MemoPlaintext) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sender != nil { + l = m.Sender.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + l = len(m.Text) + if l > 0 { + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} + +func (m *MemoView) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MemoView != nil { + n += m.MemoView.Size() + } + return n +} + +func (m *MemoView_Visible_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Visible != nil { + l = m.Visible.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *MemoView_Opaque_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Opaque != nil { + l = m.Opaque.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} +func (m *MemoView_Visible) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Ciphertext != nil { + l = m.Ciphertext.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + if m.Plaintext != nil { + l = m.Plaintext.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} + +func (m *MemoView_Opaque) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Ciphertext != nil { + l = m.Ciphertext.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} + +func (m *SpendPlan) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Note != nil { + l = m.Note.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + if m.Position != 0 { + n += 1 + sovTransaction(uint64(m.Position)) + } + l = len(m.Randomizer) + if l > 0 { + n += 1 + l + sovTransaction(uint64(l)) + } + l = len(m.ValueBlinding) + if l > 0 { + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} + +func (m *OutputPlan) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != nil { + l = m.Value.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + if m.DestAddress != nil { + l = m.DestAddress.Size() + n += 1 + l + sovTransaction(uint64(l)) + } + l = len(m.Rseed) + if l > 0 { + n += 1 + l + sovTransaction(uint64(l)) + } + l = len(m.ValueBlinding) + if l > 0 { + n += 1 + l + sovTransaction(uint64(l)) + } + return n +} + +func sovTransaction(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTransaction(x uint64) (n int) { + return sovTransaction(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Transaction) 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 ErrIntOverflowTransaction + } + 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: Transaction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Transaction: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Body", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Body == nil { + m.Body = &TransactionBody{} + } + if err := m.Body.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BindingSig", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BindingSig = append(m.BindingSig[:0], dAtA[iNdEx:postIndex]...) + if m.BindingSig == nil { + m.BindingSig = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Anchor", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Anchor == nil { + m.Anchor = &v1alpha1.MerkleRoot{} + } + if err := m.Anchor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Id) 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 ErrIntOverflowTransaction + } + 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: Id: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Id: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EffectHash) 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 ErrIntOverflowTransaction + } + 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: EffectHash: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EffectHash: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TransactionBody) 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 ErrIntOverflowTransaction + } + 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: TransactionBody: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TransactionBody: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Actions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Actions = append(m.Actions, &Action{}) + if err := m.Actions[len(m.Actions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpiryHeight", wireType) + } + m.ExpiryHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExpiryHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + 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 ErrInvalidLengthTransaction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Fee == nil { + m.Fee = &v1alpha1.Fee{} + } + if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FmdClues", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FmdClues = append(m.FmdClues, &v1alpha1.Clue{}) + if err := m.FmdClues[len(m.FmdClues)-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 EncryptedMemo", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := make([]byte, postIndex-iNdEx) + copy(v, dAtA[iNdEx:postIndex]) + m.XEncryptedMemo = &TransactionBody_EncryptedMemo{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Action) 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 ErrIntOverflowTransaction + } + 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: Action: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Action: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spend", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Spend{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &Action_Spend{v} + iNdEx = postIndex + case 2: + 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 ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Output{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &Action_Output{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Swap", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.Swap{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &Action_Swap{v} + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SwapClaim", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.SwapClaim{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &Action_SwapClaim{v} + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorDefinition", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha12.ValidatorDefinition{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &Action_ValidatorDefinition{v} + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IbcAction", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha13.IbcAction{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &Action_IbcAction{v} + iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalSubmit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha14.ProposalSubmit{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &Action_ProposalSubmit{v} + iNdEx = postIndex + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalWithdraw", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha14.ProposalWithdraw{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &Action_ProposalWithdraw{v} + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorVote", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha14.ValidatorVote{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &Action_ValidatorVote{v} + iNdEx = postIndex + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorVote", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha14.DelegatorVote{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &Action_DelegatorVote{v} + iNdEx = postIndex + case 22: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalDepositClaim", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha14.ProposalDepositClaim{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &Action_ProposalDepositClaim{v} + iNdEx = postIndex + case 30: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PositionOpen", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.PositionOpen{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &Action_PositionOpen{v} + iNdEx = postIndex + case 31: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PositionClose", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.PositionClose{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &Action_PositionClose{v} + iNdEx = postIndex + case 32: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PositionWithdraw", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.PositionWithdraw{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &Action_PositionWithdraw{v} + iNdEx = postIndex + case 34: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PositionRewardClaim", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.PositionRewardClaim{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &Action_PositionRewardClaim{v} + iNdEx = postIndex + case 40: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Delegate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha12.Delegate{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &Action_Delegate{v} + iNdEx = postIndex + case 41: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Undelegate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha12.Undelegate{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &Action_Undelegate{v} + iNdEx = postIndex + case 42: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UndelegateClaim", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha12.UndelegateClaim{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &Action_UndelegateClaim{v} + iNdEx = postIndex + case 50: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DaoSpend", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha14.DaoSpend{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &Action_DaoSpend{v} + iNdEx = postIndex + case 51: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DaoOutput", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha14.DaoOutput{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &Action_DaoOutput{v} + iNdEx = postIndex + case 52: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DaoDeposit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha14.DaoDeposit{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &Action_DaoDeposit{v} + iNdEx = postIndex + case 200: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ics20Withdrawal", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha13.Ics20Withdrawal{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &Action_Ics20Withdrawal{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TransactionPerspective) 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 ErrIntOverflowTransaction + } + 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: TransactionPerspective: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TransactionPerspective: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PayloadKeys", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PayloadKeys = append(m.PayloadKeys, &PayloadKeyWithCommitment{}) + if err := m.PayloadKeys[len(m.PayloadKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpendNullifiers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SpendNullifiers = append(m.SpendNullifiers, &NullifierWithNote{}) + if err := m.SpendNullifiers[len(m.SpendNullifiers)-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 AdviceNotes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AdviceNotes = append(m.AdviceNotes, &v1alpha1.Note{}) + if err := m.AdviceNotes[len(m.AdviceNotes)-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 AddressViews", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AddressViews = append(m.AddressViews, &v1alpha1.AddressView{}) + if err := m.AddressViews[len(m.AddressViews)-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 Denoms", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denoms = append(m.Denoms, &v1alpha1.DenomMetadata{}) + if err := m.Denoms[len(m.Denoms)-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 TransactionId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TransactionId == nil { + m.TransactionId = &Id{} + } + if err := m.TransactionId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PayloadKey) 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 ErrIntOverflowTransaction + } + 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: PayloadKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PayloadKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PayloadKeyWithCommitment) 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 ErrIntOverflowTransaction + } + 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: PayloadKeyWithCommitment: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PayloadKeyWithCommitment: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PayloadKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PayloadKey == nil { + m.PayloadKey = &PayloadKey{} + } + if err := m.PayloadKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Commitment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Commitment == nil { + m.Commitment = &v1alpha1.StateCommitment{} + } + if err := m.Commitment.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NullifierWithNote) 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 ErrIntOverflowTransaction + } + 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: NullifierWithNote: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NullifierWithNote: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nullifier", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Nullifier == nil { + m.Nullifier = &v1alpha1.Nullifier{} + } + if err := m.Nullifier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Note", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Note == nil { + m.Note = &v1alpha1.Note{} + } + if err := m.Note.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TransactionView) 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 ErrIntOverflowTransaction + } + 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: TransactionView: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TransactionView: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BodyView", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BodyView == nil { + m.BodyView = &TransactionBodyView{} + } + if err := m.BodyView.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BindingSig", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BindingSig = append(m.BindingSig[:0], dAtA[iNdEx:postIndex]...) + if m.BindingSig == nil { + m.BindingSig = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Anchor", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Anchor == nil { + m.Anchor = &v1alpha1.MerkleRoot{} + } + if err := m.Anchor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TransactionBodyView) 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 ErrIntOverflowTransaction + } + 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: TransactionBodyView: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TransactionBodyView: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ActionViews", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ActionViews = append(m.ActionViews, &ActionView{}) + if err := m.ActionViews[len(m.ActionViews)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpiryHeight", wireType) + } + m.ExpiryHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExpiryHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + 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 ErrInvalidLengthTransaction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Fee == nil { + m.Fee = &v1alpha1.Fee{} + } + if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FmdClues", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FmdClues = append(m.FmdClues, &v1alpha1.Clue{}) + if err := m.FmdClues[len(m.FmdClues)-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 MemoView", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &MemoView{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.XMemoView = &TransactionBodyView_MemoView{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ActionView) 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 ErrIntOverflowTransaction + } + 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: ActionView: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ActionView: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spend", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &SpendView{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ActionView = &ActionView_Spend{v} + iNdEx = postIndex + case 2: + 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 ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &OutputView{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ActionView = &ActionView_Output{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Swap", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.SwapView{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ActionView = &ActionView_Swap{v} + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SwapClaim", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.SwapClaimView{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ActionView = &ActionView_SwapClaim{v} + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorDefinition", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha12.ValidatorDefinition{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ActionView = &ActionView_ValidatorDefinition{v} + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IbcAction", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha13.IbcAction{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ActionView = &ActionView_IbcAction{v} + iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalSubmit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha14.ProposalSubmit{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ActionView = &ActionView_ProposalSubmit{v} + iNdEx = postIndex + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalWithdraw", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha14.ProposalWithdraw{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ActionView = &ActionView_ProposalWithdraw{v} + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorVote", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha14.ValidatorVote{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ActionView = &ActionView_ValidatorVote{v} + iNdEx = postIndex + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorVote", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &DelegatorVoteView{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ActionView = &ActionView_DelegatorVote{v} + iNdEx = postIndex + case 22: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalDepositClaim", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha14.ProposalDepositClaim{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ActionView = &ActionView_ProposalDepositClaim{v} + iNdEx = postIndex + case 30: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PositionOpen", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.PositionOpen{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ActionView = &ActionView_PositionOpen{v} + iNdEx = postIndex + case 31: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PositionClose", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.PositionClose{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ActionView = &ActionView_PositionClose{v} + iNdEx = postIndex + case 32: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PositionWithdraw", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.PositionWithdraw{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ActionView = &ActionView_PositionWithdraw{v} + iNdEx = postIndex + case 34: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PositionRewardClaim", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.PositionRewardClaim{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ActionView = &ActionView_PositionRewardClaim{v} + iNdEx = postIndex + case 41: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Delegate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha12.Delegate{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ActionView = &ActionView_Delegate{v} + iNdEx = postIndex + case 42: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Undelegate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha12.Undelegate{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ActionView = &ActionView_Undelegate{v} + iNdEx = postIndex + case 43: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UndelegateClaim", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha12.UndelegateClaim{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ActionView = &ActionView_UndelegateClaim{v} + iNdEx = postIndex + case 50: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DaoSpend", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha14.DaoSpend{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ActionView = &ActionView_DaoSpend{v} + iNdEx = postIndex + case 51: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DaoOutput", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha14.DaoOutput{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ActionView = &ActionView_DaoOutput{v} + iNdEx = postIndex + case 52: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DaoDeposit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha14.DaoDeposit{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ActionView = &ActionView_DaoDeposit{v} + iNdEx = postIndex + case 200: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ics20Withdrawal", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha13.Ics20Withdrawal{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ActionView = &ActionView_Ics20Withdrawal{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SpendView) 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 ErrIntOverflowTransaction + } + 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: SpendView: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SpendView: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Visible", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &SpendView_Visible{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.SpendView = &SpendView_Visible_{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Opaque", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &SpendView_Opaque{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.SpendView = &SpendView_Opaque_{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SpendView_Visible) 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 ErrIntOverflowTransaction + } + 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: Visible: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Visible: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spend", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Spend == nil { + m.Spend = &Spend{} + } + if err := m.Spend.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Note", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Note == nil { + m.Note = &v1alpha1.NoteView{} + } + if err := m.Note.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SpendView_Opaque) 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 ErrIntOverflowTransaction + } + 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: Opaque: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Opaque: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spend", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Spend == nil { + m.Spend = &Spend{} + } + if err := m.Spend.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DelegatorVoteView) 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 ErrIntOverflowTransaction + } + 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: DelegatorVoteView: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DelegatorVoteView: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Visible", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &DelegatorVoteView_Visible{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.DelegatorVote = &DelegatorVoteView_Visible_{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Opaque", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &DelegatorVoteView_Opaque{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.DelegatorVote = &DelegatorVoteView_Opaque_{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DelegatorVoteView_Visible) 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 ErrIntOverflowTransaction + } + 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: Visible: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Visible: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorVote", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DelegatorVote == nil { + m.DelegatorVote = &v1alpha14.DelegatorVote{} + } + if err := m.DelegatorVote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Note", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Note == nil { + m.Note = &v1alpha1.NoteView{} + } + if err := m.Note.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DelegatorVoteView_Opaque) 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 ErrIntOverflowTransaction + } + 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: Opaque: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Opaque: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorVote", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DelegatorVote == nil { + m.DelegatorVote = &v1alpha14.DelegatorVote{} + } + if err := m.DelegatorVote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OutputView) 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 ErrIntOverflowTransaction + } + 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: OutputView: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OutputView: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Visible", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &OutputView_Visible{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.OutputView = &OutputView_Visible_{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Opaque", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &OutputView_Opaque{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.OutputView = &OutputView_Opaque_{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OutputView_Visible) 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 ErrIntOverflowTransaction + } + 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: Visible: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Visible: 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 ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Output == nil { + m.Output = &Output{} + } + if err := m.Output.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Note", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Note == nil { + m.Note = &v1alpha1.NoteView{} + } + if err := m.Note.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PayloadKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PayloadKey == nil { + m.PayloadKey = &PayloadKey{} + } + if err := m.PayloadKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OutputView_Opaque) 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 ErrIntOverflowTransaction + } + 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: Opaque: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Opaque: 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 ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Output == nil { + m.Output = &Output{} + } + if err := m.Output.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Spend) 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 ErrIntOverflowTransaction + } + 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: Spend: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Spend: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Body", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Body == nil { + m.Body = &SpendBody{} + } + if err := m.Body.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthSig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuthSig == nil { + m.AuthSig = &v1alpha1.SpendAuthSignature{} + } + if err := m.AuthSig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Proof == nil { + m.Proof = &v1alpha1.ZKSpendProof{} + } + if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SpendBody) 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 ErrIntOverflowTransaction + } + 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: SpendBody: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SpendBody: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BalanceCommitment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BalanceCommitment == nil { + m.BalanceCommitment = &v1alpha1.BalanceCommitment{} + } + if err := m.BalanceCommitment.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nullifier", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Nullifier = append(m.Nullifier[:0], dAtA[iNdEx:postIndex]...) + if m.Nullifier == nil { + m.Nullifier = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rk", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rk = append(m.Rk[:0], dAtA[iNdEx:postIndex]...) + if m.Rk == nil { + m.Rk = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Output) 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 ErrIntOverflowTransaction + } + 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: Output: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Output: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Body", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Body == nil { + m.Body = &OutputBody{} + } + if err := m.Body.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Proof == nil { + m.Proof = &v1alpha1.ZKOutputProof{} + } + if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OutputBody) 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 ErrIntOverflowTransaction + } + 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: OutputBody: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OutputBody: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NotePayload", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NotePayload == nil { + m.NotePayload = &v1alpha1.NotePayload{} + } + if err := m.NotePayload.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BalanceCommitment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BalanceCommitment == nil { + m.BalanceCommitment = &v1alpha1.BalanceCommitment{} + } + if err := m.BalanceCommitment.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WrappedMemoKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WrappedMemoKey = append(m.WrappedMemoKey[:0], dAtA[iNdEx:postIndex]...) + if m.WrappedMemoKey == nil { + m.WrappedMemoKey = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OvkWrappedKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OvkWrappedKey = append(m.OvkWrappedKey[:0], dAtA[iNdEx:postIndex]...) + if m.OvkWrappedKey == nil { + m.OvkWrappedKey = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AuthorizationData) 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 ErrIntOverflowTransaction + } + 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: AuthorizationData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AuthorizationData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EffectHash", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.EffectHash == nil { + m.EffectHash = &v1alpha1.EffectHash{} + } + if err := m.EffectHash.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpendAuths", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SpendAuths = append(m.SpendAuths, &v1alpha1.SpendAuthSignature{}) + if err := m.SpendAuths[len(m.SpendAuths)-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 DelegatorVoteAuths", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DelegatorVoteAuths = append(m.DelegatorVoteAuths, &v1alpha1.SpendAuthSignature{}) + if err := m.DelegatorVoteAuths[len(m.DelegatorVoteAuths)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WitnessData) 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 ErrIntOverflowTransaction + } + 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: WitnessData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WitnessData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Anchor", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Anchor == nil { + m.Anchor = &v1alpha1.MerkleRoot{} + } + if err := m.Anchor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StateCommitmentProofs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StateCommitmentProofs = append(m.StateCommitmentProofs, &v1alpha1.StateCommitmentProof{}) + if err := m.StateCommitmentProofs[len(m.StateCommitmentProofs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TransactionPlan) 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 ErrIntOverflowTransaction + } + 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: TransactionPlan: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TransactionPlan: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Actions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Actions = append(m.Actions, &ActionPlan{}) + if err := m.Actions[len(m.Actions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpiryHeight", wireType) + } + m.ExpiryHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExpiryHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + 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 ErrInvalidLengthTransaction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Fee == nil { + m.Fee = &v1alpha1.Fee{} + } + if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CluePlans", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CluePlans = append(m.CluePlans, &CluePlan{}) + if err := m.CluePlans[len(m.CluePlans)-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 MemoPlan", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MemoPlan == nil { + m.MemoPlan = &MemoPlan{} + } + if err := m.MemoPlan.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ActionPlan) 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 ErrIntOverflowTransaction + } + 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: ActionPlan: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ActionPlan: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spend", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &SpendPlan{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &ActionPlan_Spend{v} + iNdEx = postIndex + case 2: + 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 ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &OutputPlan{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &ActionPlan_Output{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Swap", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.SwapPlan{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &ActionPlan_Swap{v} + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SwapClaim", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.SwapClaimPlan{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &ActionPlan_SwapClaim{v} + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorDefinition", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha12.ValidatorDefinition{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &ActionPlan_ValidatorDefinition{v} + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IbcAction", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha13.IbcAction{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &ActionPlan_IbcAction{v} + iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalSubmit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha14.ProposalSubmit{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &ActionPlan_ProposalSubmit{v} + iNdEx = postIndex + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalWithdraw", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha14.ProposalWithdraw{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &ActionPlan_ProposalWithdraw{v} + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorVote", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha14.ValidatorVote{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &ActionPlan_ValidatorVote{v} + iNdEx = postIndex + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorVote", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha14.DelegatorVotePlan{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &ActionPlan_DelegatorVote{v} + iNdEx = postIndex + case 22: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalDepositClaim", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha14.ProposalDepositClaim{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &ActionPlan_ProposalDepositClaim{v} + iNdEx = postIndex + case 23: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Withdrawal", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha13.Ics20Withdrawal{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &ActionPlan_Withdrawal{v} + iNdEx = postIndex + case 30: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PositionOpen", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.PositionOpen{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &ActionPlan_PositionOpen{v} + iNdEx = postIndex + case 31: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PositionClose", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.PositionClose{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &ActionPlan_PositionClose{v} + iNdEx = postIndex + case 32: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PositionWithdraw", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.PositionWithdrawPlan{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &ActionPlan_PositionWithdraw{v} + iNdEx = postIndex + case 34: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PositionRewardClaim", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.PositionRewardClaimPlan{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &ActionPlan_PositionRewardClaim{v} + iNdEx = postIndex + case 40: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Delegate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha12.Delegate{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &ActionPlan_Delegate{v} + iNdEx = postIndex + case 41: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Undelegate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha12.Undelegate{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &ActionPlan_Undelegate{v} + iNdEx = postIndex + case 42: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UndelegateClaim", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha12.UndelegateClaimPlan{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &ActionPlan_UndelegateClaim{v} + iNdEx = postIndex + case 50: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DaoSpend", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha14.DaoSpend{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &ActionPlan_DaoSpend{v} + iNdEx = postIndex + case 51: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DaoOutput", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha14.DaoOutput{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &ActionPlan_DaoOutput{v} + iNdEx = postIndex + case 52: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DaoDeposit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha14.DaoDeposit{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Action = &ActionPlan_DaoDeposit{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CluePlan) 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 ErrIntOverflowTransaction + } + 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: CluePlan: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CluePlan: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Address == nil { + m.Address = &v1alpha1.Address{} + } + if err := m.Address.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rseed", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rseed = append(m.Rseed[:0], dAtA[iNdEx:postIndex]...) + if m.Rseed == nil { + m.Rseed = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PrecisionBits", wireType) + } + m.PrecisionBits = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PrecisionBits |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MemoPlan) 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 ErrIntOverflowTransaction + } + 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: MemoPlan: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MemoPlan: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Plaintext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Plaintext == nil { + m.Plaintext = &MemoPlaintext{} + } + if err := m.Plaintext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MemoCiphertext) 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 ErrIntOverflowTransaction + } + 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: MemoCiphertext: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MemoCiphertext: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MemoPlaintext) 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 ErrIntOverflowTransaction + } + 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: MemoPlaintext: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MemoPlaintext: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Sender == nil { + m.Sender = &v1alpha1.Address{} + } + if err := m.Sender.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + 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 ErrInvalidLengthTransaction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Text = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MemoView) 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 ErrIntOverflowTransaction + } + 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: MemoView: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MemoView: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Visible", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &MemoView_Visible{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.MemoView = &MemoView_Visible_{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Opaque", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &MemoView_Opaque{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.MemoView = &MemoView_Opaque_{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MemoView_Visible) 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 ErrIntOverflowTransaction + } + 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: Visible: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Visible: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ciphertext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Ciphertext == nil { + m.Ciphertext = &MemoCiphertext{} + } + if err := m.Ciphertext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Plaintext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Plaintext == nil { + m.Plaintext = &MemoPlaintext{} + } + if err := m.Plaintext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MemoView_Opaque) 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 ErrIntOverflowTransaction + } + 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: Opaque: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Opaque: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ciphertext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Ciphertext == nil { + m.Ciphertext = &MemoCiphertext{} + } + if err := m.Ciphertext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SpendPlan) 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 ErrIntOverflowTransaction + } + 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: SpendPlan: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SpendPlan: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Note", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Note == nil { + m.Note = &v1alpha1.Note{} + } + if err := m.Note.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Position", wireType) + } + m.Position = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Position |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Randomizer", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Randomizer = append(m.Randomizer[:0], dAtA[iNdEx:postIndex]...) + if m.Randomizer == nil { + m.Randomizer = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValueBlinding", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValueBlinding = append(m.ValueBlinding[:0], dAtA[iNdEx:postIndex]...) + if m.ValueBlinding == nil { + m.ValueBlinding = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OutputPlan) 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 ErrIntOverflowTransaction + } + 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: OutputPlan: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OutputPlan: 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 msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Value == nil { + m.Value = &v1alpha1.Value{} + } + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DestAddress", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DestAddress == nil { + m.DestAddress = &v1alpha1.Address{} + } + if err := m.DestAddress.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rseed", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rseed = append(m.Rseed[:0], dAtA[iNdEx:postIndex]...) + if m.Rseed == nil { + m.Rseed = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValueBlinding", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransaction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTransaction + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTransaction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValueBlinding = append(m.ValueBlinding[:0], dAtA[iNdEx:postIndex]...) + if m.ValueBlinding == nil { + m.ValueBlinding = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransaction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransaction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTransaction(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, ErrIntOverflowTransaction + } + 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, ErrIntOverflowTransaction + } + 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, ErrIntOverflowTransaction + } + 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, ErrInvalidLengthTransaction + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTransaction + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTransaction + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTransaction = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTransaction = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTransaction = fmt.Errorf("proto: unexpected end of group") +) diff --git a/relayer/chains/penumbra/core/transparent_proofs/v1alpha1/transparent_proofs.pb.go b/relayer/chains/penumbra/core/transparent_proofs/v1alpha1/transparent_proofs.pb.go new file mode 100644 index 000000000..61dc0d957 --- /dev/null +++ b/relayer/chains/penumbra/core/transparent_proofs/v1alpha1/transparent_proofs.pb.go @@ -0,0 +1,589 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: penumbra/core/transparent_proofs/v1alpha1/transparent_proofs.proto + +package transparent_proofsv1alpha1 + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + v1alpha11 "github.com/cosmos/relayer/v2/relayer/chains/penumbra/core/crypto/v1alpha1" + v1alpha1 "github.com/cosmos/relayer/v2/relayer/chains/penumbra/core/dex/v1alpha1" + 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 + +// A Penumbra transparent SwapClaimProof. +type SwapClaimProof struct { + // The swap being claimed + SwapPlaintext *v1alpha1.SwapPlaintext `protobuf:"bytes,1,opt,name=swap_plaintext,json=swapPlaintext,proto3" json:"swap_plaintext,omitempty"` + // Inclusion proof for the swap commitment + SwapCommitmentProof *v1alpha11.StateCommitmentProof `protobuf:"bytes,4,opt,name=swap_commitment_proof,json=swapCommitmentProof,proto3" json:"swap_commitment_proof,omitempty"` + // The nullifier key used to derive the swap nullifier + Nk []byte `protobuf:"bytes,6,opt,name=nk,proto3" json:"nk,omitempty"` + // + // @exclude + // Describes output amounts + Lambda_1I *v1alpha11.Amount `protobuf:"bytes,20,opt,name=lambda_1_i,json=lambda1I,proto3" json:"lambda_1_i,omitempty"` + Lambda_2I *v1alpha11.Amount `protobuf:"bytes,21,opt,name=lambda_2_i,json=lambda2I,proto3" json:"lambda_2_i,omitempty"` +} + +func (m *SwapClaimProof) Reset() { *m = SwapClaimProof{} } +func (m *SwapClaimProof) String() string { return proto.CompactTextString(m) } +func (*SwapClaimProof) ProtoMessage() {} +func (*SwapClaimProof) Descriptor() ([]byte, []int) { + return fileDescriptor_1536b20e10cd99e5, []int{0} +} +func (m *SwapClaimProof) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SwapClaimProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SwapClaimProof.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 *SwapClaimProof) XXX_Merge(src proto.Message) { + xxx_messageInfo_SwapClaimProof.Merge(m, src) +} +func (m *SwapClaimProof) XXX_Size() int { + return m.Size() +} +func (m *SwapClaimProof) XXX_DiscardUnknown() { + xxx_messageInfo_SwapClaimProof.DiscardUnknown(m) +} + +var xxx_messageInfo_SwapClaimProof proto.InternalMessageInfo + +func (m *SwapClaimProof) GetSwapPlaintext() *v1alpha1.SwapPlaintext { + if m != nil { + return m.SwapPlaintext + } + return nil +} + +func (m *SwapClaimProof) GetSwapCommitmentProof() *v1alpha11.StateCommitmentProof { + if m != nil { + return m.SwapCommitmentProof + } + return nil +} + +func (m *SwapClaimProof) GetNk() []byte { + if m != nil { + return m.Nk + } + return nil +} + +func (m *SwapClaimProof) GetLambda_1I() *v1alpha11.Amount { + if m != nil { + return m.Lambda_1I + } + return nil +} + +func (m *SwapClaimProof) GetLambda_2I() *v1alpha11.Amount { + if m != nil { + return m.Lambda_2I + } + return nil +} + +func init() { + proto.RegisterType((*SwapClaimProof)(nil), "penumbra.core.transparent_proofs.v1alpha1.SwapClaimProof") +} + +func init() { + proto.RegisterFile("penumbra/core/transparent_proofs/v1alpha1/transparent_proofs.proto", fileDescriptor_1536b20e10cd99e5) +} + +var fileDescriptor_1536b20e10cd99e5 = []byte{ + // 448 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0x3f, 0x6f, 0xd3, 0x40, + 0x18, 0xc6, 0x63, 0x17, 0x55, 0xe8, 0x80, 0x0c, 0x86, 0x22, 0xab, 0x83, 0x55, 0x21, 0x90, 0x52, + 0x10, 0x67, 0x25, 0x65, 0x32, 0x13, 0xf1, 0x80, 0x3a, 0x20, 0x9d, 0x42, 0xc5, 0x80, 0x22, 0x59, + 0x6f, 0x9c, 0xa3, 0xb1, 0xea, 0xfb, 0xa3, 0xbb, 0x4b, 0x9b, 0x7e, 0x0b, 0x06, 0x3e, 0x01, 0x23, + 0x9f, 0x04, 0x31, 0x75, 0x64, 0x44, 0x89, 0x58, 0xf8, 0x14, 0xe8, 0x9c, 0x5e, 0xdc, 0xd4, 0x91, + 0x88, 0xd8, 0x7c, 0x7e, 0x9f, 0xe7, 0xf7, 0x3c, 0xaf, 0x7c, 0x46, 0x7d, 0x49, 0xf9, 0x94, 0x8d, + 0x14, 0xc4, 0xb9, 0x50, 0x34, 0x36, 0x0a, 0xb8, 0x96, 0xa0, 0x28, 0x37, 0x99, 0x54, 0x42, 0x7c, + 0xd2, 0xf1, 0x79, 0x17, 0x4a, 0x39, 0x81, 0xee, 0x86, 0x19, 0x96, 0x4a, 0x18, 0x11, 0x1c, 0x3a, + 0x06, 0xb6, 0x0c, 0xbc, 0x41, 0xe7, 0x18, 0xfb, 0xcf, 0xd7, 0xe3, 0x72, 0x75, 0x29, 0x8d, 0xa8, + 0x23, 0x96, 0xe7, 0x25, 0x76, 0xff, 0xe9, 0xba, 0x76, 0x4c, 0x67, 0xb5, 0x70, 0x4c, 0x67, 0x4b, + 0xd5, 0x93, 0xdf, 0x3e, 0x6a, 0xbf, 0xbf, 0x00, 0x99, 0x96, 0x50, 0x30, 0x62, 0xe3, 0x02, 0x82, + 0xda, 0xfa, 0x02, 0x64, 0x26, 0x4b, 0x28, 0xb8, 0xa1, 0x33, 0x13, 0x7a, 0x07, 0x5e, 0xe7, 0x5e, + 0xef, 0x10, 0xaf, 0x17, 0xb5, 0x10, 0x47, 0xc4, 0x96, 0x41, 0x9c, 0x61, 0xf0, 0x40, 0xdf, 0x3c, + 0x06, 0xa7, 0x68, 0xaf, 0x22, 0xe6, 0x82, 0xb1, 0xc2, 0xb0, 0xd5, 0x66, 0xe1, 0x9d, 0x0a, 0x7c, + 0x74, 0x0b, 0x7c, 0xbd, 0x46, 0xcd, 0x36, 0x60, 0x68, 0xba, 0xf2, 0x56, 0x2d, 0x07, 0x0f, 0x2d, + 0xf1, 0xd6, 0xcb, 0xa0, 0x8d, 0x7c, 0x7e, 0x16, 0xee, 0x1e, 0x78, 0x9d, 0xfb, 0x03, 0x9f, 0x9f, + 0x05, 0x29, 0x42, 0x25, 0xb0, 0xd1, 0x18, 0xb2, 0x6e, 0x56, 0x84, 0x8f, 0xaa, 0xb4, 0x67, 0xff, + 0x48, 0x7b, 0xc3, 0xc4, 0x94, 0x9b, 0xc1, 0xdd, 0xa5, 0xb1, 0x7b, 0x7c, 0x03, 0xd2, 0xcb, 0x8a, + 0x70, 0xef, 0x3f, 0x20, 0xbd, 0xe3, 0xfe, 0x97, 0x9d, 0xef, 0xf3, 0xc8, 0xbb, 0x9a, 0x47, 0xde, + 0xaf, 0x79, 0xe4, 0x7d, 0x5e, 0x44, 0xad, 0xab, 0x45, 0xd4, 0xfa, 0xb9, 0x88, 0x5a, 0xe8, 0x65, + 0x2e, 0x18, 0xde, 0xfa, 0x0e, 0xf4, 0x1f, 0x9f, 0xd4, 0xc3, 0x6a, 0x6b, 0x4d, 0xec, 0x97, 0x24, + 0xde, 0x47, 0x79, 0x5a, 0x98, 0xc9, 0x74, 0x84, 0x73, 0xc1, 0xe2, 0x5c, 0x68, 0x26, 0x74, 0xac, + 0x68, 0x09, 0x97, 0x54, 0xc5, 0xe7, 0xbd, 0xd5, 0x63, 0x3e, 0x81, 0x82, 0xeb, 0x78, 0xeb, 0x8b, + 0xfb, 0xba, 0x39, 0x73, 0xa3, 0xaf, 0xfe, 0x0e, 0x49, 0x4f, 0xbe, 0xf9, 0x1d, 0xe2, 0xda, 0xa7, + 0xb6, 0x7d, 0xa3, 0x20, 0xfe, 0x70, 0x6d, 0xf8, 0x51, 0x4b, 0x87, 0x56, 0x3a, 0x6c, 0x48, 0x87, + 0x4e, 0x3a, 0xf7, 0x5f, 0x6d, 0x2b, 0x1d, 0xbe, 0x25, 0xfd, 0x77, 0xd4, 0xc0, 0x18, 0x0c, 0xfc, + 0xf1, 0x5f, 0x38, 0x5b, 0x92, 0x58, 0x5f, 0x92, 0x34, 0x8c, 0x49, 0xe2, 0x9c, 0xa3, 0xdd, 0xea, + 0x2f, 0x38, 0xfa, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x7e, 0xa6, 0x57, 0xdf, 0xc8, 0x03, 0x00, 0x00, +} + +func (m *SwapClaimProof) 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 *SwapClaimProof) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SwapClaimProof) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Lambda_2I != nil { + { + size, err := m.Lambda_2I.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransparentProofs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + if m.Lambda_1I != nil { + { + size, err := m.Lambda_1I.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransparentProofs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + if len(m.Nk) > 0 { + i -= len(m.Nk) + copy(dAtA[i:], m.Nk) + i = encodeVarintTransparentProofs(dAtA, i, uint64(len(m.Nk))) + i-- + dAtA[i] = 0x32 + } + if m.SwapCommitmentProof != nil { + { + size, err := m.SwapCommitmentProof.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransparentProofs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.SwapPlaintext != nil { + { + size, err := m.SwapPlaintext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransparentProofs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintTransparentProofs(dAtA []byte, offset int, v uint64) int { + offset -= sovTransparentProofs(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *SwapClaimProof) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SwapPlaintext != nil { + l = m.SwapPlaintext.Size() + n += 1 + l + sovTransparentProofs(uint64(l)) + } + if m.SwapCommitmentProof != nil { + l = m.SwapCommitmentProof.Size() + n += 1 + l + sovTransparentProofs(uint64(l)) + } + l = len(m.Nk) + if l > 0 { + n += 1 + l + sovTransparentProofs(uint64(l)) + } + if m.Lambda_1I != nil { + l = m.Lambda_1I.Size() + n += 2 + l + sovTransparentProofs(uint64(l)) + } + if m.Lambda_2I != nil { + l = m.Lambda_2I.Size() + n += 2 + l + sovTransparentProofs(uint64(l)) + } + return n +} + +func sovTransparentProofs(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTransparentProofs(x uint64) (n int) { + return sovTransparentProofs(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *SwapClaimProof) 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 ErrIntOverflowTransparentProofs + } + 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: SwapClaimProof: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SwapClaimProof: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SwapPlaintext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransparentProofs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransparentProofs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransparentProofs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SwapPlaintext == nil { + m.SwapPlaintext = &v1alpha1.SwapPlaintext{} + } + if err := m.SwapPlaintext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SwapCommitmentProof", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransparentProofs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransparentProofs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransparentProofs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SwapCommitmentProof == nil { + m.SwapCommitmentProof = &v1alpha11.StateCommitmentProof{} + } + if err := m.SwapCommitmentProof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nk", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransparentProofs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTransparentProofs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTransparentProofs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Nk = append(m.Nk[:0], dAtA[iNdEx:postIndex]...) + if m.Nk == nil { + m.Nk = []byte{} + } + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Lambda_1I", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransparentProofs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransparentProofs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransparentProofs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Lambda_1I == nil { + m.Lambda_1I = &v1alpha11.Amount{} + } + if err := m.Lambda_1I.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Lambda_2I", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransparentProofs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransparentProofs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransparentProofs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Lambda_2I == nil { + m.Lambda_2I = &v1alpha11.Amount{} + } + if err := m.Lambda_2I.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransparentProofs(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransparentProofs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTransparentProofs(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, ErrIntOverflowTransparentProofs + } + 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, ErrIntOverflowTransparentProofs + } + 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, ErrIntOverflowTransparentProofs + } + 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, ErrInvalidLengthTransparentProofs + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTransparentProofs + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTransparentProofs + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTransparentProofs = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTransparentProofs = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTransparentProofs = fmt.Errorf("proto: unexpected end of group") +) diff --git a/relayer/chains/penumbra/custody/v1alpha1/custody.pb.go b/relayer/chains/penumbra/custody/v1alpha1/custody.pb.go new file mode 100644 index 000000000..d30aa8c26 --- /dev/null +++ b/relayer/chains/penumbra/custody/v1alpha1/custody.pb.go @@ -0,0 +1,1213 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: penumbra/custody/v1alpha1/custody.proto + +package custodyv1alpha1 + +import ( + context "context" + fmt "fmt" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + v1alpha11 "github.com/cosmos/relayer/v2/relayer/chains/penumbra/core/crypto/v1alpha1" + v1alpha1 "github.com/cosmos/relayer/v2/relayer/chains/penumbra/core/transaction/v1alpha1" + 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 + +type AuthorizeRequest struct { + // The transaction plan to authorize. + Plan *v1alpha1.TransactionPlan `protobuf:"bytes,1,opt,name=plan,proto3" json:"plan,omitempty"` + // Identifies the FVK (and hence the spend authorization key) to use for signing. + AccountGroupId *v1alpha11.AccountGroupId `protobuf:"bytes,2,opt,name=account_group_id,json=accountGroupId,proto3" json:"account_group_id,omitempty"` + // Optionally, pre-authorization data, if required by the custodian. + // + // Multiple `PreAuthorization` packets can be included in a single request, + // to support multi-party pre-authorizations. + PreAuthorizations []*PreAuthorization `protobuf:"bytes,3,rep,name=pre_authorizations,json=preAuthorizations,proto3" json:"pre_authorizations,omitempty"` +} + +func (m *AuthorizeRequest) Reset() { *m = AuthorizeRequest{} } +func (m *AuthorizeRequest) String() string { return proto.CompactTextString(m) } +func (*AuthorizeRequest) ProtoMessage() {} +func (*AuthorizeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_8c8c99775232419d, []int{0} +} +func (m *AuthorizeRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthorizeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthorizeRequest.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 *AuthorizeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthorizeRequest.Merge(m, src) +} +func (m *AuthorizeRequest) XXX_Size() int { + return m.Size() +} +func (m *AuthorizeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AuthorizeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AuthorizeRequest proto.InternalMessageInfo + +func (m *AuthorizeRequest) GetPlan() *v1alpha1.TransactionPlan { + if m != nil { + return m.Plan + } + return nil +} + +func (m *AuthorizeRequest) GetAccountGroupId() *v1alpha11.AccountGroupId { + if m != nil { + return m.AccountGroupId + } + return nil +} + +func (m *AuthorizeRequest) GetPreAuthorizations() []*PreAuthorization { + if m != nil { + return m.PreAuthorizations + } + return nil +} + +type AuthorizeResponse struct { + Data *v1alpha1.AuthorizationData `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *AuthorizeResponse) Reset() { *m = AuthorizeResponse{} } +func (m *AuthorizeResponse) String() string { return proto.CompactTextString(m) } +func (*AuthorizeResponse) ProtoMessage() {} +func (*AuthorizeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_8c8c99775232419d, []int{1} +} +func (m *AuthorizeResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthorizeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthorizeResponse.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 *AuthorizeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthorizeResponse.Merge(m, src) +} +func (m *AuthorizeResponse) XXX_Size() int { + return m.Size() +} +func (m *AuthorizeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AuthorizeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AuthorizeResponse proto.InternalMessageInfo + +func (m *AuthorizeResponse) GetData() *v1alpha1.AuthorizationData { + if m != nil { + return m.Data + } + return nil +} + +// A pre-authorization packet. This allows a custodian to delegate (partial) +// signing authority to other authorization mechanisms. Details of how a +// custodian manages those keys are out-of-scope for the custody protocol and +// are custodian-specific. +type PreAuthorization struct { + // Types that are valid to be assigned to PreAuthorization: + // *PreAuthorization_Ed25519_ + PreAuthorization isPreAuthorization_PreAuthorization `protobuf_oneof:"pre_authorization"` +} + +func (m *PreAuthorization) Reset() { *m = PreAuthorization{} } +func (m *PreAuthorization) String() string { return proto.CompactTextString(m) } +func (*PreAuthorization) ProtoMessage() {} +func (*PreAuthorization) Descriptor() ([]byte, []int) { + return fileDescriptor_8c8c99775232419d, []int{2} +} +func (m *PreAuthorization) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PreAuthorization) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PreAuthorization.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 *PreAuthorization) XXX_Merge(src proto.Message) { + xxx_messageInfo_PreAuthorization.Merge(m, src) +} +func (m *PreAuthorization) XXX_Size() int { + return m.Size() +} +func (m *PreAuthorization) XXX_DiscardUnknown() { + xxx_messageInfo_PreAuthorization.DiscardUnknown(m) +} + +var xxx_messageInfo_PreAuthorization proto.InternalMessageInfo + +type isPreAuthorization_PreAuthorization interface { + isPreAuthorization_PreAuthorization() + MarshalTo([]byte) (int, error) + Size() int +} + +type PreAuthorization_Ed25519_ struct { + Ed25519 *PreAuthorization_Ed25519 `protobuf:"bytes,1,opt,name=ed25519,proto3,oneof" json:"ed25519,omitempty"` +} + +func (*PreAuthorization_Ed25519_) isPreAuthorization_PreAuthorization() {} + +func (m *PreAuthorization) GetPreAuthorization() isPreAuthorization_PreAuthorization { + if m != nil { + return m.PreAuthorization + } + return nil +} + +func (m *PreAuthorization) GetEd25519() *PreAuthorization_Ed25519 { + if x, ok := m.GetPreAuthorization().(*PreAuthorization_Ed25519_); ok { + return x.Ed25519 + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*PreAuthorization) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*PreAuthorization_Ed25519_)(nil), + } +} + +// An Ed25519-based preauthorization, containing an Ed25519 signature over the +// `TransactionPlan`. +type PreAuthorization_Ed25519 struct { + // The Ed25519 verification key used to verify the signature. + Vk []byte `protobuf:"bytes,1,opt,name=vk,proto3" json:"vk,omitempty"` + // The Ed25519 signature over the `TransactionPlan`. + Sig []byte `protobuf:"bytes,2,opt,name=sig,proto3" json:"sig,omitempty"` +} + +func (m *PreAuthorization_Ed25519) Reset() { *m = PreAuthorization_Ed25519{} } +func (m *PreAuthorization_Ed25519) String() string { return proto.CompactTextString(m) } +func (*PreAuthorization_Ed25519) ProtoMessage() {} +func (*PreAuthorization_Ed25519) Descriptor() ([]byte, []int) { + return fileDescriptor_8c8c99775232419d, []int{2, 0} +} +func (m *PreAuthorization_Ed25519) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PreAuthorization_Ed25519) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PreAuthorization_Ed25519.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 *PreAuthorization_Ed25519) XXX_Merge(src proto.Message) { + xxx_messageInfo_PreAuthorization_Ed25519.Merge(m, src) +} +func (m *PreAuthorization_Ed25519) XXX_Size() int { + return m.Size() +} +func (m *PreAuthorization_Ed25519) XXX_DiscardUnknown() { + xxx_messageInfo_PreAuthorization_Ed25519.DiscardUnknown(m) +} + +var xxx_messageInfo_PreAuthorization_Ed25519 proto.InternalMessageInfo + +func (m *PreAuthorization_Ed25519) GetVk() []byte { + if m != nil { + return m.Vk + } + return nil +} + +func (m *PreAuthorization_Ed25519) GetSig() []byte { + if m != nil { + return m.Sig + } + return nil +} + +func init() { + proto.RegisterType((*AuthorizeRequest)(nil), "penumbra.custody.v1alpha1.AuthorizeRequest") + proto.RegisterType((*AuthorizeResponse)(nil), "penumbra.custody.v1alpha1.AuthorizeResponse") + proto.RegisterType((*PreAuthorization)(nil), "penumbra.custody.v1alpha1.PreAuthorization") + proto.RegisterType((*PreAuthorization_Ed25519)(nil), "penumbra.custody.v1alpha1.PreAuthorization.Ed25519") +} + +func init() { + proto.RegisterFile("penumbra/custody/v1alpha1/custody.proto", fileDescriptor_8c8c99775232419d) +} + +var fileDescriptor_8c8c99775232419d = []byte{ + // 534 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x4f, 0x6f, 0xd3, 0x30, + 0x18, 0xc6, 0x9b, 0x74, 0x62, 0xc2, 0xab, 0xa6, 0xd6, 0x48, 0xa8, 0x2b, 0x22, 0x9a, 0x2a, 0x21, + 0x26, 0x06, 0x8e, 0xda, 0xd1, 0x03, 0xe5, 0xd4, 0x0e, 0x54, 0x76, 0x40, 0x44, 0xe1, 0xaf, 0xa6, + 0x8a, 0xca, 0x75, 0x4d, 0x1b, 0x2d, 0x8d, 0x83, 0xed, 0x44, 0x2a, 0x27, 0x3e, 0xc2, 0x3e, 0xc3, + 0x24, 0x2e, 0x7c, 0x12, 0xc4, 0x69, 0x47, 0x8e, 0xa8, 0xbd, 0xf1, 0x29, 0x50, 0xfe, 0xb8, 0x49, + 0x0b, 0x85, 0xdd, 0xe2, 0xe7, 0x7d, 0xde, 0x9f, 0x5f, 0x3f, 0xb1, 0xc1, 0x5d, 0x9f, 0x7a, 0xc1, + 0x74, 0xc8, 0xb1, 0x49, 0x02, 0x21, 0xd9, 0x68, 0x66, 0x86, 0x0d, 0xec, 0xfa, 0x13, 0xdc, 0x50, + 0x02, 0xf2, 0x39, 0x93, 0x0c, 0xee, 0x29, 0x23, 0x52, 0xba, 0x32, 0xd6, 0xee, 0x65, 0x0c, 0xc6, + 0xa9, 0x49, 0xf8, 0xcc, 0x97, 0x2c, 0xc7, 0x89, 0xd7, 0x09, 0xa6, 0xf6, 0x70, 0xd5, 0x2b, 0x39, + 0xf6, 0x04, 0x26, 0xd2, 0x61, 0x5e, 0xd6, 0x90, 0x13, 0x93, 0xae, 0xfa, 0xb9, 0x0e, 0xca, 0x9d, + 0x40, 0x4e, 0x18, 0x77, 0x3e, 0x51, 0x9b, 0x7e, 0x0c, 0xa8, 0x90, 0xb0, 0x07, 0xb6, 0x7c, 0x17, + 0x7b, 0x55, 0x6d, 0x5f, 0x3b, 0xd8, 0x69, 0x1e, 0xa1, 0x6c, 0x40, 0xc6, 0x29, 0xca, 0x43, 0x14, + 0x19, 0xbd, 0xca, 0x44, 0xcb, 0xc5, 0x9e, 0x1d, 0x03, 0xe0, 0x5b, 0x50, 0xc6, 0x84, 0xb0, 0xc0, + 0x93, 0x83, 0x31, 0x67, 0x81, 0x3f, 0x70, 0x46, 0x55, 0x3d, 0x86, 0x3e, 0x58, 0x83, 0xa6, 0x47, + 0x59, 0xf2, 0x3a, 0x49, 0x5b, 0x2f, 0xea, 0x3a, 0x19, 0xd9, 0xbb, 0x78, 0x65, 0x0d, 0x4f, 0x01, + 0xf4, 0x39, 0x1d, 0xe0, 0x74, 0x72, 0x1c, 0xed, 0x2b, 0xaa, 0xc5, 0xfd, 0xe2, 0xc1, 0x4e, 0xf3, + 0x10, 0x6d, 0x0c, 0x14, 0x59, 0x9c, 0x76, 0xf2, 0x3d, 0x76, 0xc5, 0x5f, 0x53, 0x44, 0xfd, 0x3d, + 0xa8, 0xe4, 0x12, 0x11, 0x3e, 0xf3, 0x04, 0x85, 0x27, 0x60, 0x6b, 0x84, 0x25, 0x4e, 0x23, 0x69, + 0x5d, 0x25, 0x92, 0x15, 0xec, 0x13, 0x2c, 0xb1, 0x1d, 0x23, 0xea, 0x5f, 0x34, 0x50, 0x5e, 0x9f, + 0x03, 0xbe, 0x00, 0xdb, 0x74, 0xd4, 0x6c, 0xb5, 0x1a, 0x8f, 0xfe, 0x92, 0xfa, 0xff, 0x4e, 0x81, + 0x9e, 0x26, 0xad, 0xcf, 0x0a, 0xb6, 0xa2, 0xd4, 0x0e, 0xc1, 0x76, 0xaa, 0xc2, 0x5d, 0xa0, 0x87, + 0x67, 0x31, 0xb6, 0x64, 0xeb, 0xe1, 0x19, 0x2c, 0x83, 0xa2, 0x70, 0xc6, 0xf1, 0x8f, 0x28, 0xd9, + 0xd1, 0x67, 0xf7, 0x06, 0xa8, 0xfc, 0x11, 0x67, 0xf3, 0xb3, 0x06, 0x6e, 0x1e, 0x27, 0x5b, 0x5b, + 0xd1, 0x5d, 0x21, 0xcc, 0x7d, 0x49, 0x79, 0xe8, 0x10, 0x0a, 0x3f, 0x80, 0xeb, 0xcb, 0x88, 0xe0, + 0xbf, 0xf2, 0x5e, 0xbf, 0x5a, 0xb5, 0xfb, 0x57, 0x33, 0x27, 0xa9, 0x77, 0x2f, 0xf4, 0x6f, 0x73, + 0x43, 0xbb, 0x9c, 0x1b, 0xda, 0xcf, 0xb9, 0xa1, 0x9d, 0x2f, 0x8c, 0xc2, 0xe5, 0xc2, 0x28, 0xfc, + 0x58, 0x18, 0x05, 0x70, 0x9b, 0xb0, 0xe9, 0x66, 0x56, 0xb7, 0x94, 0x9f, 0xdc, 0xd2, 0x4e, 0x5f, + 0x8f, 0x1d, 0x39, 0x09, 0x86, 0x88, 0xb0, 0xa9, 0x49, 0x98, 0x98, 0x32, 0x61, 0x72, 0xea, 0xe2, + 0x19, 0xe5, 0x66, 0xd8, 0x5c, 0x7e, 0x92, 0x09, 0x76, 0x3c, 0x61, 0x6e, 0x7c, 0xb9, 0x8f, 0x53, + 0x41, 0xad, 0x2f, 0xf4, 0xa2, 0x75, 0xfc, 0xee, 0xab, 0xbe, 0x67, 0xa9, 0x41, 0xd2, 0x6d, 0xd1, + 0x9b, 0xd4, 0xf1, 0x3d, 0xab, 0xf5, 0xd3, 0x5a, 0x5f, 0xd5, 0xe6, 0xfa, 0x9d, 0x8d, 0xb5, 0x7e, + 0xcf, 0xea, 0x3e, 0xa7, 0x12, 0x47, 0x37, 0xe6, 0x97, 0x7e, 0x4b, 0xf9, 0xda, 0xed, 0xd4, 0xd8, + 0x6e, 0x2b, 0xe7, 0xf0, 0x5a, 0xfc, 0x92, 0x8f, 0x7e, 0x07, 0x00, 0x00, 0xff, 0xff, 0x40, 0xae, + 0xeb, 0xca, 0x71, 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 + +// CustodyProtocolServiceClient is the client API for CustodyProtocolService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type CustodyProtocolServiceClient interface { + // Requests authorization of the transaction with the given description. + Authorize(ctx context.Context, in *AuthorizeRequest, opts ...grpc.CallOption) (*AuthorizeResponse, error) +} + +type custodyProtocolServiceClient struct { + cc grpc1.ClientConn +} + +func NewCustodyProtocolServiceClient(cc grpc1.ClientConn) CustodyProtocolServiceClient { + return &custodyProtocolServiceClient{cc} +} + +func (c *custodyProtocolServiceClient) Authorize(ctx context.Context, in *AuthorizeRequest, opts ...grpc.CallOption) (*AuthorizeResponse, error) { + out := new(AuthorizeResponse) + err := c.cc.Invoke(ctx, "/penumbra.custody.v1alpha1.CustodyProtocolService/Authorize", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// CustodyProtocolServiceServer is the server API for CustodyProtocolService service. +type CustodyProtocolServiceServer interface { + // Requests authorization of the transaction with the given description. + Authorize(context.Context, *AuthorizeRequest) (*AuthorizeResponse, error) +} + +// UnimplementedCustodyProtocolServiceServer can be embedded to have forward compatible implementations. +type UnimplementedCustodyProtocolServiceServer struct { +} + +func (*UnimplementedCustodyProtocolServiceServer) Authorize(ctx context.Context, req *AuthorizeRequest) (*AuthorizeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Authorize not implemented") +} + +func RegisterCustodyProtocolServiceServer(s grpc1.Server, srv CustodyProtocolServiceServer) { + s.RegisterService(&_CustodyProtocolService_serviceDesc, srv) +} + +func _CustodyProtocolService_Authorize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AuthorizeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CustodyProtocolServiceServer).Authorize(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/penumbra.custody.v1alpha1.CustodyProtocolService/Authorize", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CustodyProtocolServiceServer).Authorize(ctx, req.(*AuthorizeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _CustodyProtocolService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "penumbra.custody.v1alpha1.CustodyProtocolService", + HandlerType: (*CustodyProtocolServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Authorize", + Handler: _CustodyProtocolService_Authorize_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "penumbra/custody/v1alpha1/custody.proto", +} + +func (m *AuthorizeRequest) 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 *AuthorizeRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthorizeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PreAuthorizations) > 0 { + for iNdEx := len(m.PreAuthorizations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PreAuthorizations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCustody(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.AccountGroupId != nil { + { + size, err := m.AccountGroupId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCustody(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Plan != nil { + { + size, err := m.Plan.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCustody(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AuthorizeResponse) 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 *AuthorizeResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthorizeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Data != nil { + { + size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCustody(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PreAuthorization) 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 *PreAuthorization) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PreAuthorization) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PreAuthorization != nil { + { + size := m.PreAuthorization.Size() + i -= size + if _, err := m.PreAuthorization.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *PreAuthorization_Ed25519_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PreAuthorization_Ed25519_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Ed25519 != nil { + { + size, err := m.Ed25519.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCustody(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *PreAuthorization_Ed25519) 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 *PreAuthorization_Ed25519) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PreAuthorization_Ed25519) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Sig) > 0 { + i -= len(m.Sig) + copy(dAtA[i:], m.Sig) + i = encodeVarintCustody(dAtA, i, uint64(len(m.Sig))) + i-- + dAtA[i] = 0x12 + } + if len(m.Vk) > 0 { + i -= len(m.Vk) + copy(dAtA[i:], m.Vk) + i = encodeVarintCustody(dAtA, i, uint64(len(m.Vk))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintCustody(dAtA []byte, offset int, v uint64) int { + offset -= sovCustody(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *AuthorizeRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Plan != nil { + l = m.Plan.Size() + n += 1 + l + sovCustody(uint64(l)) + } + if m.AccountGroupId != nil { + l = m.AccountGroupId.Size() + n += 1 + l + sovCustody(uint64(l)) + } + if len(m.PreAuthorizations) > 0 { + for _, e := range m.PreAuthorizations { + l = e.Size() + n += 1 + l + sovCustody(uint64(l)) + } + } + return n +} + +func (m *AuthorizeResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Data != nil { + l = m.Data.Size() + n += 1 + l + sovCustody(uint64(l)) + } + return n +} + +func (m *PreAuthorization) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PreAuthorization != nil { + n += m.PreAuthorization.Size() + } + return n +} + +func (m *PreAuthorization_Ed25519_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Ed25519 != nil { + l = m.Ed25519.Size() + n += 1 + l + sovCustody(uint64(l)) + } + return n +} +func (m *PreAuthorization_Ed25519) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Vk) + if l > 0 { + n += 1 + l + sovCustody(uint64(l)) + } + l = len(m.Sig) + if l > 0 { + n += 1 + l + sovCustody(uint64(l)) + } + return n +} + +func sovCustody(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozCustody(x uint64) (n int) { + return sovCustody(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *AuthorizeRequest) 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 ErrIntOverflowCustody + } + 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: AuthorizeRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AuthorizeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Plan", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCustody + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCustody + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCustody + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Plan == nil { + m.Plan = &v1alpha1.TransactionPlan{} + } + if err := m.Plan.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccountGroupId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCustody + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCustody + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCustody + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AccountGroupId == nil { + m.AccountGroupId = &v1alpha11.AccountGroupId{} + } + if err := m.AccountGroupId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PreAuthorizations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCustody + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCustody + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCustody + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PreAuthorizations = append(m.PreAuthorizations, &PreAuthorization{}) + if err := m.PreAuthorizations[len(m.PreAuthorizations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCustody(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCustody + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AuthorizeResponse) 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 ErrIntOverflowCustody + } + 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: AuthorizeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AuthorizeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCustody + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCustody + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCustody + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Data == nil { + m.Data = &v1alpha1.AuthorizationData{} + } + if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCustody(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCustody + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PreAuthorization) 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 ErrIntOverflowCustody + } + 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: PreAuthorization: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PreAuthorization: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ed25519", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCustody + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCustody + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCustody + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &PreAuthorization_Ed25519{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.PreAuthorization = &PreAuthorization_Ed25519_{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCustody(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCustody + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PreAuthorization_Ed25519) 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 ErrIntOverflowCustody + } + 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: Ed25519: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Ed25519: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Vk", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCustody + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCustody + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCustody + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Vk = append(m.Vk[:0], dAtA[iNdEx:postIndex]...) + if m.Vk == nil { + m.Vk = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sig", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCustody + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCustody + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCustody + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sig = append(m.Sig[:0], dAtA[iNdEx:postIndex]...) + if m.Sig == nil { + m.Sig = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCustody(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCustody + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipCustody(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, ErrIntOverflowCustody + } + 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, ErrIntOverflowCustody + } + 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, ErrIntOverflowCustody + } + 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, ErrInvalidLengthCustody + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupCustody + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthCustody + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthCustody = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowCustody = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupCustody = fmt.Errorf("proto: unexpected end of group") +) diff --git a/relayer/chains/penumbra/event_parser.go b/relayer/chains/penumbra/event_parser.go new file mode 100644 index 000000000..319a8157b --- /dev/null +++ b/relayer/chains/penumbra/event_parser.go @@ -0,0 +1,472 @@ +package penumbra + +import ( + "encoding/base64" + "encoding/hex" + "fmt" + "strconv" + "strings" + "time" + + abci "github.com/cometbft/cometbft/abci/types" + sdk "github.com/cosmos/cosmos-sdk/types" + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" + chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + "github.com/cosmos/relayer/v2/relayer/processor" + "github.com/cosmos/relayer/v2/relayer/provider" + "go.uber.org/zap" + "go.uber.org/zap/zapcore" +) + +// ibcMessage is the type used for parsing all possible properties of IBC messages +type ibcMessage struct { + eventType string + info ibcMessageInfo +} + +type ibcMessageInfo interface { + parseAttrs(log *zap.Logger, attrs []sdk.Attribute) + MarshalLogObject(enc zapcore.ObjectEncoder) error +} + +func (ccp *PenumbraChainProcessor) ibcMessagesFromBlockEvents( + beginBlockEvents, endBlockEvents []abci.Event, + height uint64, base64Encoded bool, +) (res []ibcMessage) { + chainID := ccp.chainProvider.ChainId() + res = append(res, ibcMessagesFromEvents(ccp.log, beginBlockEvents, chainID, height, base64Encoded)...) + res = append(res, ibcMessagesFromEvents(ccp.log, endBlockEvents, chainID, height, base64Encoded)...) + return res +} + +func parseBase64Event(log *zap.Logger, event abci.Event) sdk.StringEvent { + evt := sdk.StringEvent{Type: event.Type} + for _, attr := range event.Attributes { + key, err := base64.StdEncoding.DecodeString(attr.Key) + if err != nil { + log.Error("Failed to decode legacy key as base64", zap.String("base64", attr.Key), zap.Error(err)) + continue + } + value, err := base64.StdEncoding.DecodeString(attr.Value) + if err != nil { + log.Error("Failed to decode legacy value as base64", zap.String("base64", attr.Value), zap.Error(err)) + continue + } + evt.Attributes = append(evt.Attributes, sdk.Attribute{ + Key: string(key), + Value: string(value), + }) + } + return evt +} + +// ibcMessagesFromTransaction parses all events within a transaction to find IBC messages +func ibcMessagesFromEvents( + log *zap.Logger, + events []abci.Event, + chainID string, + height uint64, + base64Encoded bool, +) (messages []ibcMessage) { + for _, event := range events { + var evt sdk.StringEvent + if base64Encoded { + evt = parseBase64Event(log, event) + } else { + evt = sdk.StringifyEvent(event) + } + m := parseIBCMessageFromEvent(log, evt, chainID, height) + if m == nil || m.info == nil { + // Not an IBC message, don't need to log here + continue + } + messages = append(messages, *m) + } + return messages +} + +func parseIBCMessageFromEvent( + log *zap.Logger, + event sdk.StringEvent, + chainID string, + height uint64, +) *ibcMessage { + switch event.Type { + case chantypes.EventTypeSendPacket, chantypes.EventTypeRecvPacket, chantypes.EventTypeWriteAck, + chantypes.EventTypeAcknowledgePacket, chantypes.EventTypeTimeoutPacket, + chantypes.EventTypeTimeoutPacketOnClose: + pi := &packetInfo{Height: height} + pi.parseAttrs(log, event.Attributes) + return &ibcMessage{ + eventType: event.Type, + info: pi, + } + case chantypes.EventTypeChannelOpenInit, chantypes.EventTypeChannelOpenTry, + chantypes.EventTypeChannelOpenAck, chantypes.EventTypeChannelOpenConfirm, + chantypes.EventTypeChannelCloseInit, chantypes.EventTypeChannelCloseConfirm: + ci := &channelInfo{Height: height} + ci.parseAttrs(log, event.Attributes) + return &ibcMessage{ + eventType: event.Type, + info: ci, + } + case conntypes.EventTypeConnectionOpenInit, conntypes.EventTypeConnectionOpenTry, + conntypes.EventTypeConnectionOpenAck, conntypes.EventTypeConnectionOpenConfirm: + ci := &connectionInfo{Height: height} + ci.parseAttrs(log, event.Attributes) + return &ibcMessage{ + eventType: event.Type, + info: ci, + } + case clienttypes.EventTypeCreateClient, clienttypes.EventTypeUpdateClient, + clienttypes.EventTypeUpgradeClient, clienttypes.EventTypeSubmitMisbehaviour, + clienttypes.EventTypeUpdateClientProposal: + ci := new(clientInfo) + ci.parseAttrs(log, event.Attributes) + return &ibcMessage{ + eventType: event.Type, + info: ci, + } + + case string(processor.ClientICQTypeRequest), string(processor.ClientICQTypeResponse): + ci := &clientICQInfo{ + Height: height, + Source: chainID, + } + ci.parseAttrs(log, event.Attributes) + return &ibcMessage{ + eventType: event.Type, + info: ci, + } + } + return nil +} + +func (msg *ibcMessage) parseIBCPacketReceiveMessageFromEvent( + log *zap.Logger, + event sdk.StringEvent, + chainID string, + height uint64, +) *ibcMessage { + var pi *packetInfo + if msg.info == nil { + pi = &packetInfo{Height: height} + msg.info = pi + } else { + pi = msg.info.(*packetInfo) + } + pi.parseAttrs(log, event.Attributes) + if event.Type != chantypes.EventTypeWriteAck { + msg.eventType = event.Type + } + return msg +} + +// clientInfo contains the consensus height of the counterparty chain for a client. +type clientInfo struct { + clientID string + consensusHeight clienttypes.Height + header []byte +} + +func (c clientInfo) ClientState(trustingPeriod time.Duration) provider.ClientState { + return provider.ClientState{ + ClientID: c.clientID, + ConsensusHeight: c.consensusHeight, + TrustingPeriod: trustingPeriod, + Header: c.header, + } +} + +func (res *clientInfo) MarshalLogObject(enc zapcore.ObjectEncoder) error { + enc.AddString("client_id", res.clientID) + enc.AddUint64("consensus_height", res.consensusHeight.RevisionHeight) + enc.AddUint64("consensus_height_revision", res.consensusHeight.RevisionNumber) + return nil +} + +func (res *clientInfo) parseAttrs(log *zap.Logger, attributes []sdk.Attribute) { + for _, attr := range attributes { + res.parseClientAttribute(log, attr) + } +} + +func (res *clientInfo) parseClientAttribute(log *zap.Logger, attr sdk.Attribute) { + switch attr.Key { + case clienttypes.AttributeKeyClientID: + res.clientID = attr.Value + case clienttypes.AttributeKeyConsensusHeight: + revisionSplit := strings.Split(attr.Value, "-") + if len(revisionSplit) != 2 { + log.Error("Error parsing client consensus height", + zap.String("client_id", res.clientID), + zap.String("value", attr.Value), + ) + return + } + revisionNumberString := revisionSplit[0] + revisionNumber, err := strconv.ParseUint(revisionNumberString, 10, 64) + if err != nil { + log.Error("Error parsing client consensus height revision number", + zap.Error(err), + ) + return + } + revisionHeightString := revisionSplit[1] + revisionHeight, err := strconv.ParseUint(revisionHeightString, 10, 64) + if err != nil { + log.Error("Error parsing client consensus height revision height", + zap.Error(err), + ) + return + } + res.consensusHeight = clienttypes.Height{ + RevisionNumber: revisionNumber, + RevisionHeight: revisionHeight, + } + case clienttypes.AttributeKeyHeader: + data, err := hex.DecodeString(attr.Value) + if err != nil { + log.Error("Error parsing client header", + zap.String("header", attr.Value), + zap.Error(err), + ) + return + } + res.header = data + } +} + +// alias type to the provider types, used for adding parser methods +type packetInfo provider.PacketInfo + +func (res *packetInfo) MarshalLogObject(enc zapcore.ObjectEncoder) error { + enc.AddUint64("sequence", res.Sequence) + enc.AddString("src_channel", res.SourceChannel) + enc.AddString("src_port", res.SourcePort) + enc.AddString("dst_channel", res.DestChannel) + enc.AddString("dst_port", res.DestPort) + return nil +} + +// parsePacketInfo is treated differently from the others since it can be constructed from the accumulation of multiple events +func (res *packetInfo) parseAttrs(log *zap.Logger, attrs []sdk.Attribute) { + for _, attr := range attrs { + res.parsePacketAttribute(log, attr) + } +} + +func (res *packetInfo) parsePacketAttribute(log *zap.Logger, attr sdk.Attribute) { + var err error + switch attr.Key { + case chantypes.AttributeKeySequence: + res.Sequence, err = strconv.ParseUint(attr.Value, 10, 64) + if err != nil { + log.Error("Error parsing packet sequence", + zap.String("value", attr.Value), + zap.Error(err), + ) + return + } + case chantypes.AttributeKeyTimeoutTimestamp: + res.TimeoutTimestamp, err = strconv.ParseUint(attr.Value, 10, 64) + if err != nil { + log.Error("Error parsing packet timestamp", + zap.Uint64("sequence", res.Sequence), + zap.String("value", attr.Value), + zap.Error(err), + ) + return + } + // NOTE: deprecated per IBC spec + case chantypes.AttributeKeyData: + res.Data = []byte(attr.Value) + case chantypes.AttributeKeyDataHex: + data, err := hex.DecodeString(attr.Value) + if err != nil { + log.Error("Error parsing packet data", + zap.Uint64("sequence", res.Sequence), + zap.Error(err), + ) + return + } + res.Data = data + // NOTE: deprecated per IBC spec + case chantypes.AttributeKeyAck: + res.Ack = []byte(attr.Value) + case chantypes.AttributeKeyAckHex: + data, err := hex.DecodeString(attr.Value) + if err != nil { + log.Error("Error parsing packet ack", + zap.Uint64("sequence", res.Sequence), + zap.String("value", attr.Value), + zap.Error(err), + ) + return + } + res.Ack = data + case chantypes.AttributeKeyTimeoutHeight: + timeoutSplit := strings.Split(attr.Value, "-") + if len(timeoutSplit) != 2 { + log.Error("Error parsing packet height timeout", + zap.Uint64("sequence", res.Sequence), + zap.String("value", attr.Value), + ) + return + } + revisionNumber, err := strconv.ParseUint(timeoutSplit[0], 10, 64) + if err != nil { + log.Error("Error parsing packet timeout height revision number", + zap.Uint64("sequence", res.Sequence), + zap.String("value", timeoutSplit[0]), + zap.Error(err), + ) + return + } + revisionHeight, err := strconv.ParseUint(timeoutSplit[1], 10, 64) + if err != nil { + log.Error("Error parsing packet timeout height revision height", + zap.Uint64("sequence", res.Sequence), + zap.String("value", timeoutSplit[1]), + zap.Error(err), + ) + return + } + res.TimeoutHeight = clienttypes.Height{ + RevisionNumber: revisionNumber, + RevisionHeight: revisionHeight, + } + case chantypes.AttributeKeySrcPort: + res.SourcePort = attr.Value + case chantypes.AttributeKeySrcChannel: + res.SourceChannel = attr.Value + case chantypes.AttributeKeyDstPort: + res.DestPort = attr.Value + case chantypes.AttributeKeyDstChannel: + res.DestChannel = attr.Value + case chantypes.AttributeKeyChannelOrdering: + res.ChannelOrder = attr.Value + } +} + +// alias type to the provider types, used for adding parser methods +type channelInfo provider.ChannelInfo + +func (res *channelInfo) MarshalLogObject(enc zapcore.ObjectEncoder) error { + enc.AddString("channel_id", res.ChannelID) + enc.AddString("port_id", res.PortID) + enc.AddString("counterparty_channel_id", res.CounterpartyChannelID) + enc.AddString("counterparty_port_id", res.CounterpartyPortID) + return nil +} + +func (res *channelInfo) parseAttrs(log *zap.Logger, attrs []sdk.Attribute) { + for _, attr := range attrs { + res.parseChannelAttribute(attr) + } +} + +// parseChannelAttribute parses channel attributes from an event. +// If the attribute has already been parsed into the channelInfo, +// it will not overwrite, and return true to inform the caller that +// the attribute already exists. +func (res *channelInfo) parseChannelAttribute(attr sdk.Attribute) { + switch attr.Key { + case chantypes.AttributeKeyPortID: + res.PortID = attr.Value + case chantypes.AttributeKeyChannelID: + res.ChannelID = attr.Value + case chantypes.AttributeCounterpartyPortID: + res.CounterpartyPortID = attr.Value + case chantypes.AttributeCounterpartyChannelID: + res.CounterpartyChannelID = attr.Value + case chantypes.AttributeKeyConnectionID: + res.ConnID = attr.Value + case chantypes.AttributeVersion: + res.Version = attr.Value + } +} + +// alias type to the provider types, used for adding parser methods +type connectionInfo provider.ConnectionInfo + +func (res *connectionInfo) MarshalLogObject(enc zapcore.ObjectEncoder) error { + enc.AddString("connection_id", res.ConnID) + enc.AddString("client_id", res.ClientID) + enc.AddString("counterparty_connection_id", res.CounterpartyConnID) + enc.AddString("counterparty_client_id", res.CounterpartyClientID) + return nil +} + +func (res *connectionInfo) parseAttrs(log *zap.Logger, attrs []sdk.Attribute) { + for _, attr := range attrs { + res.parseConnectionAttribute(attr) + } +} + +func (res *connectionInfo) parseConnectionAttribute(attr sdk.Attribute) { + switch attr.Key { + case conntypes.AttributeKeyConnectionID: + res.ConnID = attr.Value + case conntypes.AttributeKeyClientID: + res.ClientID = attr.Value + case conntypes.AttributeKeyCounterpartyConnectionID: + res.CounterpartyConnID = attr.Value + case conntypes.AttributeKeyCounterpartyClientID: + res.CounterpartyClientID = attr.Value + } +} + +type clientICQInfo struct { + Source string + Connection string + Chain string + QueryID provider.ClientICQQueryID + Type string + Request []byte + Height uint64 +} + +func (res *clientICQInfo) MarshalLogObject(enc zapcore.ObjectEncoder) error { + enc.AddString("connection_id", res.Connection) + enc.AddString("chain_id", res.Chain) + enc.AddString("query_id", string(res.QueryID)) + enc.AddString("type", res.Type) + enc.AddString("request", hex.EncodeToString(res.Request)) + enc.AddUint64("height", res.Height) + + return nil +} + +func (res *clientICQInfo) parseAttrs(log *zap.Logger, attrs []sdk.Attribute) { + for _, attr := range attrs { + if err := res.parseAttribute(attr); err != nil { + panic(fmt.Errorf("failed to parse attributes from client ICQ message: %w", err)) + } + } +} + +func (res *clientICQInfo) parseAttribute(attr sdk.Attribute) (err error) { + switch attr.Key { + case "connection_id": + res.Connection = attr.Value + case "chain_id": + res.Chain = attr.Value + case "query_id": + res.QueryID = provider.ClientICQQueryID(attr.Value) + case "type": + res.Type = attr.Value + case "request": + res.Request, err = hex.DecodeString(attr.Value) + if err != nil { + return err + } + case "height": + res.Height, err = strconv.ParseUint(attr.Value, 10, 64) + if err != nil { + return err + } + } + return nil +} diff --git a/relayer/chains/penumbra/grpc_query.go b/relayer/chains/penumbra/grpc_query.go new file mode 100644 index 000000000..70c375c81 --- /dev/null +++ b/relayer/chains/penumbra/grpc_query.go @@ -0,0 +1,215 @@ +package penumbra + +import ( + "context" + "fmt" + "reflect" + "strconv" + "sync" + "time" + + abci "github.com/cometbft/cometbft/abci/types" + gogogrpc "github.com/cosmos/gogoproto/grpc" + "github.com/cosmos/relayer/v2/relayer/provider" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/encoding" + "google.golang.org/grpc/encoding/proto" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + + "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + grpctypes "github.com/cosmos/cosmos-sdk/types/grpc" + "github.com/cosmos/cosmos-sdk/types/tx" +) + +var _ gogogrpc.ClientConn = &PenumbraProvider{} + +var protoCodec = encoding.GetCodec(proto.Name) + +// Invoke implements the grpc ClientConn.Invoke method +func (cc *PenumbraProvider) Invoke(ctx context.Context, method string, req, reply interface{}, opts ...grpc.CallOption) (err error) { + // Two things can happen here: + // 1. either we're broadcasting a Tx, in which call we call Tendermint's broadcast endpoint directly, + // 2. or we are querying for state, in which case we call ABCI's Querier. + + // In both cases, we don't allow empty request req (it will panic unexpectedly). + if reflect.ValueOf(req).IsNil() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "request cannot be nil") + } + + // Case 1. Broadcasting a Tx. + if reqProto, ok := req.(*tx.BroadcastTxRequest); ok { + if !ok { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "expected %T, got %T", (*tx.BroadcastTxRequest)(nil), req) + } + resProto, ok := reply.(*tx.BroadcastTxResponse) + if !ok { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "expected %T, got %T", (*tx.BroadcastTxResponse)(nil), req) + } + + broadcastRes, err := cc.TxServiceBroadcast(ctx, reqProto) + if err != nil { + return err + } + *resProto = *broadcastRes + return err + } + + // Case 2. Querying state. + inMd, _ := metadata.FromOutgoingContext(ctx) + abciRes, outMd, err := cc.RunGRPCQuery(ctx, method, req, inMd) + if err != nil { + return err + } + + if err = protoCodec.Unmarshal(abciRes.Value, reply); err != nil { + return err + } + + for _, callOpt := range opts { + header, ok := callOpt.(grpc.HeaderCallOption) + if !ok { + continue + } + + *header.HeaderAddr = outMd + } + + if cc.Codec.InterfaceRegistry != nil { + return types.UnpackInterfaces(reply, cc.Codec.Marshaler) + } + + return nil +} + +// NewStream implements the grpc ClientConn.NewStream method +func (cc *PenumbraProvider) NewStream(context.Context, *grpc.StreamDesc, string, ...grpc.CallOption) (grpc.ClientStream, error) { + return nil, fmt.Errorf("streaming rpc not supported") +} + +// RunGRPCQuery runs a gRPC query from the clientCtx, given all necessary +// arguments for the gRPC method, and returns the ABCI response. It is used +// to factorize code between client (Invoke) and server (RegisterGRPCServer) +// gRPC handlers. +func (cc *PenumbraProvider) RunGRPCQuery(ctx context.Context, method string, req interface{}, md metadata.MD) (abci.ResponseQuery, metadata.MD, error) { + reqBz, err := protoCodec.Marshal(req) + if err != nil { + return abci.ResponseQuery{}, nil, err + } + + // parse height header + if heights := md.Get(grpctypes.GRPCBlockHeightHeader); len(heights) > 0 { + height, err := strconv.ParseInt(heights[0], 10, 64) + if err != nil { + return abci.ResponseQuery{}, nil, err + } + if height < 0 { + return abci.ResponseQuery{}, nil, sdkerrors.Wrapf( + sdkerrors.ErrInvalidRequest, + "client.Context.Invoke: height (%d) from %q must be >= 0", height, grpctypes.GRPCBlockHeightHeader) + } + + } + + height, err := GetHeightFromMetadata(md) + if err != nil { + return abci.ResponseQuery{}, nil, err + } + + prove, err := GetProveFromMetadata(md) + if err != nil { + return abci.ResponseQuery{}, nil, err + } + + abciReq := abci.RequestQuery{ + Path: method, + Data: reqBz, + Height: height, + Prove: prove, + } + + abciRes, err := cc.QueryABCI(ctx, abciReq) + if err != nil { + return abci.ResponseQuery{}, nil, err + } + + // Create header metadata. For now the headers contain: + // - block height + // We then parse all the call options, if the call option is a + // HeaderCallOption, then we manually set the value of that header to the + // metadata. + md = metadata.Pairs(grpctypes.GRPCBlockHeightHeader, strconv.FormatInt(abciRes.Height, 10)) + return abciRes, md, nil +} + +// TxServiceBroadcast is a helper function to broadcast a Tx with the correct gRPC types +// from the tx service. Calls `clientCtx.BroadcastTx` under the hood. +func (cc *PenumbraProvider) TxServiceBroadcast(ctx context.Context, req *tx.BroadcastTxRequest) (*tx.BroadcastTxResponse, error) { + if req == nil || req.TxBytes == nil { + return nil, status.Error(codes.InvalidArgument, "invalid empty tx") + } + + var ( + blockTimeout = defaultBroadcastWaitTimeout + err error + rlyResp *provider.RelayerTxResponse + callbackErr error + wg sync.WaitGroup + ) + + if cc.PCfg.BlockTimeout != "" { + blockTimeout, err = time.ParseDuration(cc.PCfg.BlockTimeout) + if err != nil { + // Did you call Validate() method on CosmosProviderConfig struct + // before coming here? + return nil, err + } + } + + callback := func(rtr *provider.RelayerTxResponse, err error) { + rlyResp = rtr + callbackErr = err + wg.Done() + } + + wg.Add(1) + + if err := cc.broadcastTx(ctx, req.TxBytes, nil, nil, ctx, blockTimeout, callback); err != nil { + return nil, err + } + + wg.Wait() + + if callbackErr != nil { + return nil, callbackErr + } + + return &tx.BroadcastTxResponse{ + TxResponse: &sdk.TxResponse{ + Height: rlyResp.Height, + TxHash: rlyResp.TxHash, + Codespace: rlyResp.Codespace, + Code: rlyResp.Code, + Data: rlyResp.Data, + }, + }, nil +} + +func GetHeightFromMetadata(md metadata.MD) (int64, error) { + height := md.Get(grpctypes.GRPCBlockHeightHeader) + if len(height) == 1 { + return strconv.ParseInt(height[0], 10, 64) + } + return 0, nil +} + +func GetProveFromMetadata(md metadata.MD) (bool, error) { + prove := md.Get("x-cosmos-query-prove") + if len(prove) == 1 { + return strconv.ParseBool(prove[0]) + } + return false, nil +} diff --git a/relayer/chains/penumbra/keys.go b/relayer/chains/penumbra/keys.go new file mode 100644 index 000000000..aa09fa7b1 --- /dev/null +++ b/relayer/chains/penumbra/keys.go @@ -0,0 +1,211 @@ +package penumbra + +import ( + "errors" + "os" + + ckeys "github.com/cosmos/cosmos-sdk/client/keys" + "github.com/cosmos/cosmos-sdk/crypto/hd" + "github.com/cosmos/cosmos-sdk/crypto/keyring" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/go-bip39" + "github.com/cosmos/relayer/v2/relayer/codecs/ethermint" + "github.com/cosmos/relayer/v2/relayer/codecs/injective" + "github.com/cosmos/relayer/v2/relayer/provider" +) + +const ethereumCoinType = uint32(60) + +var ( + // SupportedAlgorithms defines the list of signing algorithms used on Evmos: + // - secp256k1 (Cosmos) + // - eth_secp256k1 (Ethereum) + SupportedAlgorithms = keyring.SigningAlgoList{hd.Secp256k1, ethermint.EthSecp256k1, injective.EthSecp256k1} + // SupportedAlgorithmsLedger defines the list of signing algorithms used on Evmos for the Ledger device: + // - secp256k1 (Cosmos) + // - eth_secp256k1 (Ethereum) + SupportedAlgorithmsLedger = keyring.SigningAlgoList{hd.Secp256k1, ethermint.EthSecp256k1, injective.EthSecp256k1} +) + +// KeyringAlgoOptions defines a function keys options for the ethereum Secp256k1 curve. +// It supports secp256k1 and eth_secp256k1 keys for accounts. +func KeyringAlgoOptions() keyring.Option { + return func(options *keyring.Options) { + options.SupportedAlgos = SupportedAlgorithms + options.SupportedAlgosLedger = SupportedAlgorithmsLedger + } +} + +// CreateKeystore initializes a new instance of a keyring at the specified path in the local filesystem. +func (cc *PenumbraProvider) CreateKeystore(path string) error { + keybase, err := keyring.New(cc.PCfg.ChainID, cc.PCfg.KeyringBackend, cc.PCfg.KeyDirectory, cc.Input, cc.Codec.Marshaler, KeyringAlgoOptions()) + if err != nil { + return err + } + cc.Keybase = keybase + return nil +} + +// KeystoreCreated returns true if there is an existing keystore instance at the specified path, it returns false otherwise. +func (cc *PenumbraProvider) KeystoreCreated(path string) bool { + if _, err := os.Stat(cc.PCfg.KeyDirectory); errors.Is(err, os.ErrNotExist) { + return false + } else if cc.Keybase == nil { + return false + } + return true +} + +// AddKey generates a new mnemonic which is then converted to a private key and BIP-39 HD Path and persists it to the keystore. +// It fails if there is an existing key with the same address. +func (cc *PenumbraProvider) AddKey(name string, coinType uint32, signingAlgorithm string) (output *provider.KeyOutput, err error) { + ko, err := cc.KeyAddOrRestore(name, coinType) + if err != nil { + return nil, err + } + return ko, nil +} + +// RestoreKey converts a mnemonic to a private key and BIP-39 HD Path and persists it to the keystore. +// It fails if there is an existing key with the same address. +func (cc *PenumbraProvider) RestoreKey(name, mnemonic string, coinType uint32, signingAlgorithm string) (address string, err error) { + ko, err := cc.KeyAddOrRestore(name, coinType, mnemonic) + if err != nil { + return "", err + } + return ko.Address, nil +} + +// KeyAddOrRestore either generates a new mnemonic or uses the specified mnemonic and converts it to a private key +// and BIP-39 HD Path which is then persisted to the keystore. It fails if there is an existing key with the same address. +func (cc *PenumbraProvider) KeyAddOrRestore(keyName string, coinType uint32, mnemonic ...string) (*provider.KeyOutput, error) { + var mnemonicStr string + var err error + algo := keyring.SignatureAlgo(hd.Secp256k1) + + if len(mnemonic) > 0 { + mnemonicStr = mnemonic[0] + } else { + mnemonicStr, err = CreateMnemonic() + if err != nil { + return nil, err + } + } + + if coinType == ethereumCoinType { + algo = keyring.SignatureAlgo(ethermint.EthSecp256k1) + for _, codec := range cc.PCfg.ExtraCodecs { + if codec == "injective" { + algo = keyring.SignatureAlgo(injective.EthSecp256k1) + } + } + } + + info, err := cc.Keybase.NewAccount(keyName, mnemonicStr, "", hd.CreateHDPath(coinType, 0, 0).String(), algo) + if err != nil { + return nil, err + } + + acc, err := info.GetAddress() + if err != nil { + return nil, err + } + + out, err := cc.EncodeBech32AccAddr(acc) + if err != nil { + return nil, err + } + return &provider.KeyOutput{Mnemonic: mnemonicStr, Address: out}, nil +} + +// ShowAddress retrieves a key by name from the keystore and returns the bech32 encoded string representation of that key. +func (cc *PenumbraProvider) ShowAddress(name string) (address string, err error) { + info, err := cc.Keybase.Key(name) + if err != nil { + return "", err + } + acc, err := info.GetAddress() + if err != nil { + return "", nil + } + out, err := cc.EncodeBech32AccAddr(acc) + if err != nil { + return "", err + } + return out, nil +} + +// ListAddresses returns a map of bech32 encoded strings representing all keys currently in the keystore. +func (cc *PenumbraProvider) ListAddresses() (map[string]string, error) { + out := map[string]string{} + info, err := cc.Keybase.List() + if err != nil { + return nil, err + } + for _, k := range info { + acc, err := k.GetAddress() + if err != nil { + return nil, err + } + addr, err := cc.EncodeBech32AccAddr(acc) + if err != nil { + return nil, err + } + out[k.Name] = addr + } + return out, nil +} + +// DeleteKey removes a key from the keystore for the specified name. +func (cc *PenumbraProvider) DeleteKey(name string) error { + if err := cc.Keybase.Delete(name); err != nil { + return err + } + return nil +} + +// KeyExists returns true if a key with the specified name exists in the keystore, it returns false otherwise. +func (cc *PenumbraProvider) KeyExists(name string) bool { + k, err := cc.Keybase.Key(name) + if err != nil { + return false + } + + return k.Name == name + +} + +// ExportPrivKeyArmor returns a private key in ASCII armored format. +// It returns an error if the key does not exist or a wrong encryption passphrase is supplied. +func (cc *PenumbraProvider) ExportPrivKeyArmor(keyName string) (armor string, err error) { + return cc.Keybase.ExportPrivKeyArmor(keyName, ckeys.DefaultKeyPass) +} + +// GetKeyAddress returns the account address representation for the currently configured key. +func (cc *PenumbraProvider) GetKeyAddress() (sdk.AccAddress, error) { + info, err := cc.Keybase.Key(cc.PCfg.Key) + if err != nil { + return nil, err + } + return info.GetAddress() +} + +// CreateMnemonic generates a new mnemonic. +func CreateMnemonic() (string, error) { + entropySeed, err := bip39.NewEntropy(256) + if err != nil { + return "", err + } + mnemonic, err := bip39.NewMnemonic(entropySeed) + if err != nil { + return "", err + } + return mnemonic, nil +} + +// EncodeBech32AccAddr returns the string bech32 representation for the specified account address. +// It returns an empty sting if the byte slice is 0-length. +// It returns an error if the bech32 conversion fails or the prefix is empty. +func (cc *PenumbraProvider) EncodeBech32AccAddr(addr sdk.AccAddress) (string, error) { + return sdk.Bech32ifyAddressBytes(cc.PCfg.AccountPrefix, addr) +} diff --git a/relayer/chains/penumbra/log.go b/relayer/chains/penumbra/log.go new file mode 100644 index 000000000..3c4661cc5 --- /dev/null +++ b/relayer/chains/penumbra/log.go @@ -0,0 +1,157 @@ +package penumbra + +import ( + "reflect" + + "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + typestx "github.com/cosmos/cosmos-sdk/types/tx" + transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + "github.com/cosmos/relayer/v2/relayer/provider" + "go.uber.org/zap" + "go.uber.org/zap/zapcore" +) + +// getChannelsIfPresent scans the events for channel tags +func getChannelsIfPresent(events []provider.RelayerEvent) []zapcore.Field { + channelTags := []string{srcChanTag, dstChanTag} + fields := []zap.Field{} + + // While a transaction may have multiple messages, we just need to first + // pair of channels + foundTag := map[string]struct{}{} + + for _, event := range events { + for _, tag := range channelTags { + for attributeKey, attributeValue := range event.Attributes { + if attributeKey == tag { + // Only append the tag once + // TODO: what if they are different? + if _, ok := foundTag[tag]; !ok { + fields = append(fields, zap.String(tag, attributeValue)) + foundTag[tag] = struct{}{} + } + } + } + } + } + return fields +} + +// LogFailedTx takes the transaction and the messages to create it and logs the appropriate data +func (cc *PenumbraProvider) LogFailedTx(res *provider.RelayerTxResponse, err error, msgs []provider.RelayerMessage) { + // Include the chain_id + fields := []zapcore.Field{zap.String("chain_id", cc.ChainId())} + + // Extract the channels from the events, if present + if res != nil { + channels := getChannelsIfPresent(res.Events) + fields = append(fields, channels...) + } + fields = append(fields, msgTypesField(msgs)) + + if err != nil { + // Make a copy since we may continue to the warning + errorFields := append(fields, zap.Error(err)) + cc.log.Error( + "Failed sending cosmos transaction", + errorFields..., + ) + + if res == nil { + return + } + } + + if res.Code != 0 && res.Data != "" { + fields = append(fields, zap.Object("response", res)) + cc.log.Warn( + "Sent transaction but received failure response", + fields..., + ) + } +} + +// LogSuccessTx take the transaction and the messages to create it and logs the appropriate data +func (cc *PenumbraProvider) LogSuccessTx(res *sdk.TxResponse, msgs []provider.RelayerMessage) { + // Include the chain_id + fields := []zapcore.Field{zap.String("chain_id", cc.ChainId())} + + // Extract the channels from the events, if present + if res != nil { + events := parseEventsFromTxResponse(res) + fields = append(fields, getChannelsIfPresent(events)...) + } + + // Include the gas used + fields = append(fields, zap.Int64("gas_used", res.GasUsed)) + + // Extract fees and fee_payer if present + ir := types.NewInterfaceRegistry() + var m sdk.Msg + if err := ir.UnpackAny(res.Tx, &m); err == nil { + if tx, ok := m.(*typestx.Tx); ok { + fields = append(fields, zap.Stringer("fees", tx.GetFee())) + if feePayer := getFeePayer(tx); feePayer != "" { + fields = append(fields, zap.String("fee_payer", feePayer)) + } + } else { + cc.log.Debug( + "Failed to convert message to Tx type", + zap.Stringer("type", reflect.TypeOf(m)), + ) + } + } else { + cc.log.Debug("Failed to unpack response Tx into sdk.Msg", zap.Error(err)) + } + + // Include the height, msgType, and tx_hash + fields = append(fields, + zap.Int64("height", res.Height), + msgTypesField(msgs), + zap.String("tx_hash", res.TxHash), + ) + + // Log the succesful transaction with fields + cc.log.Info( + "Successful transaction", + fields..., + ) +} + +func msgTypesField(msgs []provider.RelayerMessage) zap.Field { + msgTypes := make([]string, len(msgs)) + for i, m := range msgs { + msgTypes[i] = m.Type() + } + return zap.Strings("msg_types", msgTypes) +} + +// getFeePayer returns the bech32 address of the fee payer of a transaction. +// This uses the fee payer field if set, +// otherwise falls back to the address of whoever signed the first message. +func getFeePayer(tx *typestx.Tx) string { + payer := tx.AuthInfo.Fee.Payer + if payer != "" { + return payer + } + + switch firstMsg := tx.GetMsgs()[0].(type) { + case *transfertypes.MsgTransfer: + // There is a possible data race around concurrent map access + // in the cosmos sdk when it converts the address from bech32. + // We don't need the address conversion; just the sender is all that + // GetSigners is doing under the hood anyway. + return firstMsg.Sender + case *clienttypes.MsgCreateClient: + // Without this particular special case, there is a panic in ibc-go + // due to the sdk config singleton expecting one bech32 prefix but seeing another. + return firstMsg.Signer + case *clienttypes.MsgUpdateClient: + // Same failure mode as MsgCreateClient. + return firstMsg.Signer + default: + return firstMsg.GetSigners()[0].String() + } +} diff --git a/relayer/chains/penumbra/message_handlers.go b/relayer/chains/penumbra/message_handlers.go new file mode 100644 index 000000000..69f3b3538 --- /dev/null +++ b/relayer/chains/penumbra/message_handlers.go @@ -0,0 +1,168 @@ +package penumbra + +import ( + conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" + chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + "github.com/cosmos/relayer/v2/relayer/processor" + "github.com/cosmos/relayer/v2/relayer/provider" + "go.uber.org/zap" + "go.uber.org/zap/zapcore" +) + +func (pcp *PenumbraChainProcessor) handleMessage(m ibcMessage, c processor.IBCMessagesCache) { + switch t := m.info.(type) { + case *packetInfo: + pcp.handlePacketMessage(m.eventType, provider.PacketInfo(*t), c) + case *channelInfo: + pcp.handleChannelMessage(m.eventType, provider.ChannelInfo(*t), c) + case *connectionInfo: + pcp.handleConnectionMessage(m.eventType, provider.ConnectionInfo(*t), c) + case *clientInfo: + pcp.handleClientMessage(m.eventType, *t) + } +} + +func (pcp *PenumbraChainProcessor) handlePacketMessage(action string, pi provider.PacketInfo, c processor.IBCMessagesCache) { + channelKey, err := processor.PacketInfoChannelKey(action, pi) + if err != nil { + pcp.log.Error("Unexpected error handling packet message", + zap.String("action", action), + zap.Uint64("sequence", pi.Sequence), + zap.Any("channel", channelKey), + zap.Error(err), + ) + return + } + + if !c.PacketFlow.ShouldRetainSequence(pcp.pathProcessors, channelKey, pcp.chainProvider.ChainId(), action, pi.Sequence) { + pcp.log.Warn("Not retaining packet message", + zap.String("action", action), + zap.Uint64("sequence", pi.Sequence), + zap.Any("channel", channelKey), + ) + return + } + + c.PacketFlow.Retain(channelKey, action, pi) + pcp.logPacketMessage(action, pi) +} + +func (pcp *PenumbraChainProcessor) handleChannelMessage(eventType string, ci provider.ChannelInfo, ibcMessagesCache processor.IBCMessagesCache) { + pcp.channelConnections[ci.ChannelID] = ci.ConnID + channelKey := processor.ChannelInfoChannelKey(ci) + + if eventType == chantypes.EventTypeChannelOpenInit { + found := false + for k := range pcp.channelStateCache { + // Don't add a channelKey to the channelStateCache without counterparty channel ID + // since we already have the channelKey in the channelStateCache which includes the + // counterparty channel ID. + if k.MsgInitKey() == channelKey { + found = true + break + } + } + if !found { + pcp.channelStateCache[channelKey] = false + } + } else { + switch eventType { + case chantypes.EventTypeChannelOpenTry: + pcp.channelStateCache[channelKey] = false + case chantypes.EventTypeChannelOpenAck, chantypes.EventTypeChannelOpenConfirm: + pcp.channelStateCache[channelKey] = true + case chantypes.EventTypeChannelCloseConfirm: + for k := range pcp.channelStateCache { + if k.PortID == ci.PortID && k.ChannelID == ci.ChannelID { + pcp.channelStateCache[k] = false + break + } + } + } + // Clear out MsgInitKeys once we have the counterparty channel ID + delete(pcp.channelStateCache, channelKey.MsgInitKey()) + } + + ibcMessagesCache.ChannelHandshake.Retain(channelKey, eventType, ci) + + pcp.logChannelMessage(eventType, ci) +} + +func (pcp *PenumbraChainProcessor) handleConnectionMessage(eventType string, ci provider.ConnectionInfo, ibcMessagesCache processor.IBCMessagesCache) { + pcp.connectionClients[ci.ConnID] = ci.ClientID + connectionKey := processor.ConnectionInfoConnectionKey(ci) + if eventType == conntypes.EventTypeConnectionOpenInit { + found := false + for k := range pcp.connectionStateCache { + // Don't add a connectionKey to the connectionStateCache without counterparty connection ID + // since we already have the connectionKey in the connectionStateCache which includes the + // counterparty connection ID. + if k.MsgInitKey() == connectionKey { + found = true + break + } + } + if !found { + pcp.connectionStateCache[connectionKey] = false + } + } else { + // Clear out MsgInitKeys once we have the counterparty connection ID + delete(pcp.connectionStateCache, connectionKey.MsgInitKey()) + open := (eventType == conntypes.EventTypeConnectionOpenAck || eventType == conntypes.EventTypeConnectionOpenConfirm) + pcp.connectionStateCache[connectionKey] = open + } + ibcMessagesCache.ConnectionHandshake.Retain(connectionKey, eventType, ci) + + pcp.logConnectionMessage(eventType, ci) +} + +func (pcp *PenumbraChainProcessor) handleClientMessage(eventType string, ci clientInfo) { + pcp.latestClientState.update(ci) + pcp.logObservedIBCMessage(eventType, zap.String("client_id", ci.clientID)) +} + +func (pcp *PenumbraChainProcessor) logObservedIBCMessage(m string, fields ...zap.Field) { + pcp.log.With(zap.String("event_type", m)).Debug("Observed IBC message", fields...) +} + +func (pcp *PenumbraChainProcessor) logPacketMessage(message string, pi provider.PacketInfo) { + if !pcp.log.Core().Enabled(zapcore.DebugLevel) { + return + } + fields := []zap.Field{ + zap.Uint64("sequence", pi.Sequence), + zap.String("src_channel", pi.SourceChannel), + zap.String("src_port", pi.SourcePort), + zap.String("dst_channel", pi.DestChannel), + zap.String("dst_port", pi.DestPort), + } + if pi.TimeoutHeight.RevisionHeight > 0 { + fields = append(fields, zap.Uint64("timeout_height", pi.TimeoutHeight.RevisionHeight)) + } + if pi.TimeoutHeight.RevisionNumber > 0 { + fields = append(fields, zap.Uint64("timeout_height_revision", pi.TimeoutHeight.RevisionNumber)) + } + if pi.TimeoutTimestamp > 0 { + fields = append(fields, zap.Uint64("timeout_timestamp", pi.TimeoutTimestamp)) + } + pcp.logObservedIBCMessage(message, fields...) +} + +func (pcp *PenumbraChainProcessor) logChannelMessage(message string, ci provider.ChannelInfo) { + pcp.logObservedIBCMessage(message, + zap.String("channel_id", ci.ChannelID), + zap.String("port_id", ci.PortID), + zap.String("counterparty_channel_id", ci.CounterpartyChannelID), + zap.String("counterparty_port_id", ci.CounterpartyPortID), + zap.String("connection_id", ci.ConnID), + ) +} + +func (pcp *PenumbraChainProcessor) logConnectionMessage(message string, ci provider.ConnectionInfo) { + pcp.logObservedIBCMessage(message, + zap.String("client_id", ci.ClientID), + zap.String("connection_id", ci.ConnID), + zap.String("counterparty_client_id", ci.CounterpartyClientID), + zap.String("counterparty_connection_id", ci.CounterpartyConnID), + ) +} diff --git a/relayer/chains/penumbra/msg.go b/relayer/chains/penumbra/msg.go new file mode 100644 index 000000000..689a3267d --- /dev/null +++ b/relayer/chains/penumbra/msg.go @@ -0,0 +1,80 @@ +package penumbra + +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + "github.com/cosmos/relayer/v2/relayer/chains/cosmos" + "github.com/cosmos/relayer/v2/relayer/provider" + "github.com/gogo/protobuf/proto" + "go.uber.org/zap/zapcore" +) + +type PenumbraMessage struct { + Msg sdk.Msg +} + +func NewPenumbraMessage(msg sdk.Msg) provider.RelayerMessage { + return PenumbraMessage{ + Msg: msg, + } +} + +func PenumbraMsg(rm provider.RelayerMessage) sdk.Msg { + if val, ok := rm.(PenumbraMessage); !ok { + fmt.Printf("got data of type %T but wanted PenumbraMessage \n", val) + return nil + } else { + return val.Msg + } +} + +// typedPenumbraMsg does not accept nil. IBC Message must be of the requested type. +func typedPenumbraMsg[T *chantypes.MsgRecvPacket | *chantypes.MsgAcknowledgement](msg provider.RelayerMessage) T { + if msg == nil { + panic("msg is nil") + } + cosmosMsg := PenumbraMsg(msg) + if cosmosMsg == nil { + panic("cosmosMsg is nil") + } + return cosmosMsg.(T) +} + +func PenumbraMsgs(rm ...provider.RelayerMessage) []sdk.Msg { + sdkMsgs := make([]sdk.Msg, 0) + for _, rMsg := range rm { + switch rMsg.(type) { + case PenumbraMessage: + sdkMsgs = append(sdkMsgs, rMsg.(PenumbraMessage).Msg) + case cosmos.CosmosMessage: + sdkMsgs = append(sdkMsgs, rMsg.(cosmos.CosmosMessage).Msg) + default: + fmt.Printf("got data of type %T but wanted PenumbraMessage \n", rMsg) + return nil + } + } + return sdkMsgs +} + +func (cm PenumbraMessage) Type() string { + return sdk.MsgTypeURL(cm.Msg) +} + +func (cm PenumbraMessage) MsgBytes() ([]byte, error) { + return proto.Marshal(cm.Msg) +} + +// MarshalLogObject is used to encode cm to a zap logger with the zap.Object field type. +func (cm PenumbraMessage) MarshalLogObject(enc zapcore.ObjectEncoder) error { + // Using plain json.Marshal or calling cm.Msg.String() both fail miserably here. + // There is probably a better way to encode the message than this. + j, err := codec.NewLegacyAmino().MarshalJSON(cm.Msg) + if err != nil { + return err + } + enc.AddByteString("msg_json", j) + return nil +} diff --git a/relayer/chains/penumbra/penumbra_chain_processor.go b/relayer/chains/penumbra/penumbra_chain_processor.go new file mode 100644 index 000000000..b140b87f5 --- /dev/null +++ b/relayer/chains/penumbra/penumbra_chain_processor.go @@ -0,0 +1,420 @@ +package penumbra + +import ( + "context" + "errors" + "fmt" + "time" + + "github.com/avast/retry-go/v4" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + ctypes "github.com/cometbft/cometbft/rpc/core/types" + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" + chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + "github.com/cosmos/relayer/v2/relayer/processor" + "github.com/cosmos/relayer/v2/relayer/provider" + + "go.uber.org/zap" + "golang.org/x/sync/errgroup" +) + +const blockResultsQueryTimeout = 2 * time.Minute + +type PenumbraChainProcessor struct { + log *zap.Logger + + chainProvider *PenumbraProvider + + pathProcessors processor.PathProcessors + + // indicates whether queries are in sync with latest height of the chain + inSync bool + + // highest block + latestBlock provider.LatestBlock + + // holds highest consensus height and header for all clients + latestClientState + + // holds open state for known connections + connectionStateCache processor.ConnectionStateCache + + // holds open state for known channels + channelStateCache processor.ChannelStateCache + + // map of connection ID to client ID + connectionClients map[string]string + + // map of channel ID to connection ID + channelConnections map[string]string +} + +func NewPenumbraChainProcessor(log *zap.Logger, provider *PenumbraProvider) *PenumbraChainProcessor { + return &PenumbraChainProcessor{ + log: log.With(zap.String("chain_name", provider.ChainName()), zap.String("chain_id", provider.ChainId())), + chainProvider: provider, + latestClientState: make(latestClientState), + connectionStateCache: make(processor.ConnectionStateCache), + channelStateCache: make(processor.ChannelStateCache), + connectionClients: make(map[string]string), + channelConnections: make(map[string]string), + } +} + +const ( + queryTimeout = 5 * time.Second + latestHeightQueryRetryDelay = 1 * time.Second + latestHeightQueryRetries = 5 + + defaultMinQueryLoopDuration = 1 * time.Second + inSyncNumBlocksThreshold = 2 +) + +type msgHandlerParams struct { + // incoming IBC message + messageInfo any + + // reference to the caches that will be assembled by the handlers in this file + ibcMessagesCache processor.IBCMessagesCache +} + +// latestClientState is a map of clientID to the latest clientInfo for that client. +type latestClientState map[string]provider.ClientState + +func (l latestClientState) update(clientInfo clientInfo) { + existingClientInfo, ok := l[clientInfo.clientID] + if ok && clientInfo.consensusHeight.LT(existingClientInfo.ConsensusHeight) { + // height is less than latest, so no-op + return + } + // TODO: don't hardcode + tp := time.Hour * 2 + + // update latest if no existing state or provided consensus height is newer + l[clientInfo.clientID] = clientInfo.ClientState(tp) +} + +// Provider returns the ChainProvider, which provides the methods for querying, assembling IBC messages, and sending transactions. +func (pcp *PenumbraChainProcessor) Provider() provider.ChainProvider { + return pcp.chainProvider +} + +// Set the PathProcessors that this ChainProcessor should publish relevant IBC events to. +// ChainProcessors need reference to their PathProcessors and vice-versa, handled by EventProcessorBuilder.Build(). +func (pcp *PenumbraChainProcessor) SetPathProcessors(pathProcessors processor.PathProcessors) { + pcp.pathProcessors = pathProcessors +} + +// latestHeightWithRetry will query for the latest height, retrying in case of failure. +// It will delay by latestHeightQueryRetryDelay between attempts, up to latestHeightQueryRetries. +func (pcp *PenumbraChainProcessor) latestHeightWithRetry(ctx context.Context) (latestHeight int64, err error) { + return latestHeight, retry.Do(func() error { + latestHeightQueryCtx, cancelLatestHeightQueryCtx := context.WithTimeout(ctx, queryTimeout) + defer cancelLatestHeightQueryCtx() + var err error + latestHeight, err = pcp.chainProvider.QueryLatestHeight(latestHeightQueryCtx) + return err + }, retry.Context(ctx), retry.Attempts(latestHeightQueryRetries), retry.Delay(latestHeightQueryRetryDelay), retry.LastErrorOnly(true), retry.OnRetry(func(n uint, err error) { + pcp.log.Info( + "Failed to query latest height", + zap.Uint("attempt", n+1), + zap.Uint("max_attempts", latestHeightQueryRetries), + zap.Error(err), + ) + })) +} + +// clientState will return the most recent client state if client messages +// have already been observed for the clientID, otherwise it will query for it. +func (pcp *PenumbraChainProcessor) clientState(ctx context.Context, clientID string) (provider.ClientState, error) { + if state, ok := pcp.latestClientState[clientID]; ok { + return state, nil + } + cs, err := pcp.chainProvider.QueryClientState(ctx, int64(pcp.latestBlock.Height), clientID) + if err != nil { + return provider.ClientState{}, err + } + clientState := provider.ClientState{ + ClientID: clientID, + ConsensusHeight: cs.GetLatestHeight().(clienttypes.Height), + } + pcp.latestClientState[clientID] = clientState + return clientState, nil +} + +// queryCyclePersistence hold the variables that should be retained across queryCycles. +type queryCyclePersistence struct { + latestHeight int64 + latestQueriedBlock int64 + minQueryLoopDuration time.Duration +} + +// Run starts the query loop for the chain which will gather applicable ibc messages and push events out to the relevant PathProcessors. +// The initialBlockHistory parameter determines how many historical blocks should be fetched and processed before continuing with current blocks. +// ChainProcessors should obey the context and return upon context cancellation. +func (pcp *PenumbraChainProcessor) Run(ctx context.Context, initialBlockHistory uint64) error { + minQueryLoopDuration := pcp.chainProvider.PCfg.MinLoopDuration + if minQueryLoopDuration == 0 { + minQueryLoopDuration = defaultMinQueryLoopDuration + } + + // this will be used for persistence across query cycle loop executions + persistence := queryCyclePersistence{ + minQueryLoopDuration: minQueryLoopDuration, + } + + // Infinite retry to get initial latest height + for { + latestHeight, err := pcp.latestHeightWithRetry(ctx) + if err != nil { + pcp.log.Error( + "Failed to query latest height after max attempts", + zap.Uint("attempts", latestHeightQueryRetries), + zap.Error(err), + ) + if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) { + return nil + } + continue + } + persistence.latestHeight = latestHeight + break + } + + // this will make initial QueryLoop iteration look back initialBlockHistory blocks in history + latestQueriedBlock := persistence.latestHeight - int64(initialBlockHistory) + + if latestQueriedBlock < 0 { + latestQueriedBlock = 0 + } + + persistence.latestQueriedBlock = latestQueriedBlock + + var eg errgroup.Group + eg.Go(func() error { + return pcp.initializeConnectionState(ctx) + }) + eg.Go(func() error { + return pcp.initializeChannelState(ctx) + }) + if err := eg.Wait(); err != nil { + return err + } + + pcp.log.Debug("Entering main query loop") + + ticker := time.NewTicker(persistence.minQueryLoopDuration) + + for { + if err := pcp.queryCycle(ctx, &persistence); err != nil { + return err + } + select { + case <-ctx.Done(): + return nil + case <-ticker.C: + ticker.Reset(persistence.minQueryLoopDuration) + } + } +} + +// initializeConnectionState will bootstrap the connectionStateCache with the open connection state. +func (pcp *PenumbraChainProcessor) initializeConnectionState(ctx context.Context) error { + ctx, cancel := context.WithTimeout(ctx, queryTimeout) + defer cancel() + connections, err := pcp.chainProvider.QueryConnections(ctx) + if err != nil { + return fmt.Errorf("error querying connections: %w", err) + } + for _, c := range connections { + pcp.connectionClients[c.Id] = c.ClientId + pcp.connectionStateCache[processor.ConnectionKey{ + ConnectionID: c.Id, + ClientID: c.ClientId, + CounterpartyConnID: c.Counterparty.ConnectionId, + CounterpartyClientID: c.Counterparty.ClientId, + }] = c.State == conntypes.OPEN + } + return nil +} + +// initializeChannelState will bootstrap the channelStateCache with the open channel state. +func (pcp *PenumbraChainProcessor) initializeChannelState(ctx context.Context) error { + ctx, cancel := context.WithTimeout(ctx, queryTimeout) + defer cancel() + channels, err := pcp.chainProvider.QueryChannels(ctx) + if err != nil { + return fmt.Errorf("error querying channels: %w", err) + } + for _, ch := range channels { + if len(ch.ConnectionHops) != 1 { + pcp.log.Error("Found channel using multiple connection hops. Not currently supported, ignoring.", + zap.String("channel_id", ch.ChannelId), + zap.String("port_id", ch.PortId), + zap.Any("connection_hops", ch.ConnectionHops), + ) + continue + } + pcp.channelConnections[ch.ChannelId] = ch.ConnectionHops[0] + pcp.channelStateCache[processor.ChannelKey{ + ChannelID: ch.ChannelId, + PortID: ch.PortId, + CounterpartyChannelID: ch.Counterparty.ChannelId, + CounterpartyPortID: ch.Counterparty.PortId, + }] = ch.State == chantypes.OPEN + } + return nil +} + +// ABCI results from a block +type ResultBlockResults struct { + Height int64 `json:"height,string"` + TxsResults []*ExecTxResult `json:"txs_results"` + TotalGasUsed int64 `json:"total_gas_used,string"` + FinalizeBlockEvents []Event `json:"finalize_block_events"` + ValidatorUpdates []ValidatorUpdate `json:"validator_updates"` + ConsensusParamUpdates *tmproto.ConsensusParams `json:"consensus_param_updates"` +} + +func (pcp *PenumbraChainProcessor) queryCycle(ctx context.Context, persistence *queryCyclePersistence) error { + var err error + persistence.latestHeight, err = pcp.latestHeightWithRetry(ctx) + + // don't want to cause CosmosChainProcessor to quit here, can retry again next cycle. + if err != nil { + pcp.log.Error( + "Failed to query latest height after max attempts", + zap.Uint("attempts", latestHeightQueryRetries), + zap.Error(err), + ) + return nil + } + + pcp.log.Debug("Queried latest height", + zap.Int64("latest_height", persistence.latestHeight), + ) + + // used at the end of the cycle to send signal to path processors to start processing if both chains are in sync and no new messages came in this cycle + firstTimeInSync := false + + if !pcp.inSync { + if (persistence.latestHeight - persistence.latestQueriedBlock) < inSyncNumBlocksThreshold { + pcp.inSync = true + firstTimeInSync = true + pcp.log.Info("Chain is in sync") + } else { + pcp.log.Info("Chain is not yet in sync", + zap.Int64("latest_queried_block", persistence.latestQueriedBlock), + zap.Int64("latest_height", persistence.latestHeight), + ) + } + } + + ibcMessagesCache := processor.NewIBCMessagesCache() + + ibcHeaderCache := make(processor.IBCHeaderCache) + + ppChanged := false + + var latestHeader PenumbraIBCHeader + + newLatestQueriedBlock := persistence.latestQueriedBlock + + chainID := pcp.chainProvider.ChainId() + + for i := persistence.latestQueriedBlock + 1; i <= persistence.latestHeight; i++ { + var eg errgroup.Group + var blockRes *ctypes.ResultBlockResults + var ibcHeader provider.IBCHeader + i := i + eg.Go(func() (err error) { + queryCtx, cancelQueryCtx := context.WithTimeout(ctx, blockResultsQueryTimeout) + defer cancelQueryCtx() + blockRes, err = pcp.chainProvider.RPCClient.BlockResults(queryCtx, &i) + return err + }) + eg.Go(func() (err error) { + queryCtx, cancelQueryCtx := context.WithTimeout(ctx, queryTimeout) + defer cancelQueryCtx() + ibcHeader, err = pcp.chainProvider.QueryIBCHeader(queryCtx, i) + return err + }) + + if err := eg.Wait(); err != nil { + pcp.log.Warn("Error querying block data", zap.Error(err)) + break + } + + latestHeader = ibcHeader.(PenumbraIBCHeader) + + heightUint64 := uint64(i) + + pcp.latestBlock = provider.LatestBlock{ + Height: heightUint64, + Time: latestHeader.SignedHeader.Time, + } + + ibcHeaderCache[heightUint64] = latestHeader + ppChanged = true + + blockMsgs := pcp.ibcMessagesFromBlockEvents(blockRes.BeginBlockEvents, blockRes.EndBlockEvents, heightUint64, true) + for _, m := range blockMsgs { + pcp.handleMessage(m, ibcMessagesCache) + } + + for _, tx := range blockRes.TxsResults { + if tx.Code != 0 { + // tx was not successful + continue + } + messages := ibcMessagesFromEvents(pcp.log, tx.Events, chainID, heightUint64, true) + + for _, m := range messages { + pcp.handleMessage(m, ibcMessagesCache) + } + } + newLatestQueriedBlock = i + } + + if newLatestQueriedBlock == persistence.latestQueriedBlock { + return nil + } + + if !ppChanged { + if firstTimeInSync { + for _, pp := range pcp.pathProcessors { + pp.ProcessBacklogIfReady() + } + } + + return nil + } + + for _, pp := range pcp.pathProcessors { + clientID := pp.RelevantClientID(chainID) + clientState, err := pcp.clientState(ctx, clientID) + if err != nil { + pcp.log.Error("Error fetching client state", + zap.String("client_id", clientID), + zap.Error(err), + ) + continue + } + + pp.HandleNewData(chainID, processor.ChainProcessorCacheData{ + LatestBlock: pcp.latestBlock, + LatestHeader: latestHeader, + IBCMessagesCache: ibcMessagesCache.Clone(), + InSync: pcp.inSync, + ClientState: clientState, + ConnectionStateCache: pcp.connectionStateCache.FilterForClient(clientID), + ChannelStateCache: pcp.channelStateCache.FilterForClient(clientID, pcp.channelConnections, pcp.connectionClients), + IBCHeaderCache: ibcHeaderCache.Clone(), + }) + } + + persistence.latestQueriedBlock = newLatestQueriedBlock + + return nil +} diff --git a/relayer/chains/penumbra/provider.go b/relayer/chains/penumbra/provider.go new file mode 100644 index 000000000..4079f4d87 --- /dev/null +++ b/relayer/chains/penumbra/provider.go @@ -0,0 +1,351 @@ +package penumbra + +import ( + "context" + "fmt" + "io" + "os" + "path" + "time" + + provtypes "github.com/cometbft/cometbft/light/provider" + prov "github.com/cometbft/cometbft/light/provider/http" + rpcclient "github.com/cometbft/cometbft/rpc/client" + rpchttp "github.com/cometbft/cometbft/rpc/client/http" + jsonrpcclient "github.com/cometbft/cometbft/rpc/jsonrpc/client" + libclient "github.com/cometbft/cometbft/rpc/jsonrpc/client" + tmtypes "github.com/cometbft/cometbft/types" + "github.com/cosmos/cosmos-sdk/crypto/keyring" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/gogoproto/proto" + chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" + ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" + tmclient "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + "github.com/cosmos/relayer/v2/relayer/codecs/ethermint" + "github.com/cosmos/relayer/v2/relayer/provider" + "go.uber.org/zap" + "golang.org/x/mod/semver" +) + +var ( + _ provider.ChainProvider = &PenumbraProvider{} + _ provider.KeyProvider = &PenumbraProvider{} + _ provider.ProviderConfig = &PenumbraProviderConfig{} +) + +const cometEncodingThreshold = "v0.37.0-alpha" + +type PenumbraProviderConfig struct { + KeyDirectory string `json:"key-directory" yaml:"key-directory"` + Key string `json:"key" yaml:"key"` + ChainName string `json:"-" yaml:"-"` + ChainID string `json:"chain-id" yaml:"chain-id"` + RPCAddr string `json:"rpc-addr" yaml:"rpc-addr"` + AccountPrefix string `json:"account-prefix" yaml:"account-prefix"` + KeyringBackend string `json:"keyring-backend" yaml:"keyring-backend"` + GasAdjustment float64 `json:"gas-adjustment" yaml:"gas-adjustment"` + GasPrices string `json:"gas-prices" yaml:"gas-prices"` + MinGasAmount uint64 `json:"min-gas-amount" yaml:"min-gas-amount"` + MaxGasAmount uint64 `json:"max-gas-amount" yaml:"max-gas-amount"` + Debug bool `json:"debug" yaml:"debug"` + Timeout string `json:"timeout" yaml:"timeout"` + BlockTimeout string `json:"block-timeout" yaml:"block-timeout"` + OutputFormat string `json:"output-format" yaml:"output-format"` + SignModeStr string `json:"sign-mode" yaml:"sign-mode"` + ExtraCodecs []string `json:"extra-codecs" yaml:"extra-codecs"` + Modules []module.AppModuleBasic `json:"-" yaml:"-"` + Slip44 int `json:"coin-type" yaml:"coin-type"` + Broadcast provider.BroadcastMode `json:"broadcast-mode" yaml:"broadcast-mode"` + MinLoopDuration time.Duration `json:"min-loop-duration" yaml:"min-loop-duration"` +} + +func (pc PenumbraProviderConfig) Validate() error { + if _, err := time.ParseDuration(pc.Timeout); err != nil { + return fmt.Errorf("invalid Timeout: %w", err) + } + return nil +} + +func (pc PenumbraProviderConfig) BroadcastMode() provider.BroadcastMode { + return pc.Broadcast +} + +// NewProvider validates the PenumbraProviderConfig, instantiates a ChainClient and then instantiates a CosmosProvider +func (pc PenumbraProviderConfig) NewProvider(log *zap.Logger, homepath string, debug bool, chainName string) (provider.ChainProvider, error) { + if err := pc.Validate(); err != nil { + return nil, err + } + + pc.KeyDirectory = keysDir(homepath, pc.ChainID) + + pc.ChainName = chainName + pc.Modules = append([]module.AppModuleBasic{}, moduleBasics...) + + if pc.Broadcast == "" { + pc.Broadcast = provider.BroadcastModeBatch + } + + httpClient, err := jsonrpcclient.DefaultHTTPClient(pc.RPCAddr) + if err != nil { + return nil, err + } + + rc, err := jsonrpcclient.NewWithHTTPClient(pc.RPCAddr, httpClient) + if err != nil { + return nil, err + } + + return &PenumbraProvider{ + log: log, + PCfg: pc, + KeyringOptions: []keyring.Option{ethermint.EthSecp256k1Option()}, + Input: os.Stdin, + Output: os.Stdout, + + // TODO: this is a bit of a hack, we should probably have a better way to inject modules + Codec: makeCodec(pc.Modules, pc.ExtraCodecs), + RPCCaller: rc, + }, nil +} + +type PenumbraIBCHeader struct { + SignedHeader *tmtypes.SignedHeader + ValidatorSet *tmtypes.ValidatorSet +} + +func (h PenumbraIBCHeader) Height() uint64 { + return uint64(h.SignedHeader.Height) +} + +func (h PenumbraIBCHeader) ConsensusState() ibcexported.ConsensusState { + return &tmclient.ConsensusState{ + Timestamp: h.SignedHeader.Time, + Root: commitmenttypes.NewMerkleRoot(h.SignedHeader.AppHash), + NextValidatorsHash: h.ValidatorSet.Hash(), + } +} + +func (h PenumbraIBCHeader) NextValidatorsHash() []byte { + return h.SignedHeader.NextValidatorsHash +} + +func (h PenumbraIBCHeader) IsCompleteBlock() bool { + return true +} + +func (h PenumbraIBCHeader) ShouldUpdateWithZeroMessage() bool { + return false +} + +type PenumbraProvider struct { + log *zap.Logger + + PCfg PenumbraProviderConfig + Keybase keyring.Keyring + KeyringOptions []keyring.Option + RPCClient rpcclient.Client + LightProvider provtypes.Provider + Input io.Reader + Output io.Writer + Codec Codec + RPCCaller jsonrpcclient.Caller + + // for comet < v0.37, decode tm events as base64 + cometLegacyEncoding bool +} + +func (cc *PenumbraProvider) ProviderConfig() provider.ProviderConfig { + return cc.PCfg +} + +func (cc *PenumbraProvider) ChainId() string { + return cc.PCfg.ChainID +} + +func (cc *PenumbraProvider) ChainName() string { + return cc.PCfg.ChainName +} + +func (cc *PenumbraProvider) Type() string { + return "penumbra" +} + +func (cc *PenumbraProvider) Key() string { + return cc.PCfg.Key +} + +func (cc *PenumbraProvider) Timeout() string { + return cc.PCfg.Timeout +} + +func (cc *PenumbraProvider) CommitmentPrefix() commitmenttypes.MerklePrefix { + return commitmenttypes.NewMerklePrefix([]byte("PenumbraAppHash")) +} + +// Address returns the chains configured address as a string +func (cc *PenumbraProvider) Address() (string, error) { + info, err := cc.Keybase.Key(cc.PCfg.Key) + if err != nil { + return "", err + } + + acc, err := info.GetAddress() + if err != nil { + return "", err + } + + out, err := cc.EncodeBech32AccAddr(acc) + if err != nil { + return "", err + } + + return out, err +} + +func (cc *PenumbraProvider) TrustingPeriod(ctx context.Context) (time.Duration, error) { + // TODO + return time.Hour * 2, nil + /* + res, err := cc.QueryStakingParams(ctx) + if err != nil { + return 0, err + } + + // We want the trusting period to be 85% of the unbonding time. + // Go mentions that the time.Duration type can track approximately 290 years. + // We don't want to lose precision if the duration is a very long duration + // by converting int64 to float64. + // Use integer math the whole time, first reducing by a factor of 100 + // and then re-growing by 85x. + tp := res.UnbondingTime / 100 * 85 + + // And we only want the trusting period to be whole hours. + return tp.Truncate(time.Hour), nil + */ +} + +// Sprint returns the json representation of the specified proto message. +func (cc *PenumbraProvider) Sprint(toPrint proto.Message) (string, error) { + out, err := cc.Codec.Marshaler.MarshalJSON(toPrint) + if err != nil { + return "", err + } + return string(out), nil +} + +// Init initializes the keystore, RPC client, amd light client provider. +// Once initialization is complete an attempt to query the underlying node's tendermint version is performed. +// NOTE: Init must be called after creating a new instance of CosmosProvider. +func (cc *PenumbraProvider) Init(ctx context.Context) error { + keybase, err := keyring.New(cc.PCfg.ChainID, cc.PCfg.KeyringBackend, cc.PCfg.KeyDirectory, cc.Input, cc.Codec.Marshaler, cc.KeyringOptions...) + if err != nil { + return err + } + // TODO: figure out how to deal with input or maybe just make all keyring backends test? + + timeout, err := time.ParseDuration(cc.PCfg.Timeout) + if err != nil { + return err + } + + rpcClient, err := newRPCClient(cc.PCfg.RPCAddr, timeout) + if err != nil { + return err + } + + lightprovider, err := prov.New(cc.PCfg.ChainID, cc.PCfg.RPCAddr) + if err != nil { + return err + } + + cc.RPCClient = rpcClient + cc.LightProvider = lightprovider + cc.Keybase = keybase + + status, err := cc.QueryStatus(ctx) + if err != nil { + // Operations can occur before the node URL is added to the config, so noop here. + return nil + } + + cc.setCometVersion(cc.log, status.NodeInfo.Version) + + return nil +} + +// WaitForNBlocks blocks until the next block on a given chain +func (cc *PenumbraProvider) WaitForNBlocks(ctx context.Context, n int64) error { + var initial int64 + h, err := cc.RPCClient.Status(ctx) + if err != nil { + return err + } + if h.SyncInfo.CatchingUp { + return fmt.Errorf("chain catching up") + } + initial = h.SyncInfo.LatestBlockHeight + for { + h, err = cc.RPCClient.Status(ctx) + if err != nil { + return err + } + if h.SyncInfo.LatestBlockHeight > initial+n { + return nil + } + select { + case <-time.After(10 * time.Millisecond): + // Nothing to do. + case <-ctx.Done(): + return ctx.Err() + } + } +} + +func (cc *PenumbraProvider) BlockTime(ctx context.Context, height int64) (time.Time, error) { + resultBlock, err := cc.RPCClient.Block(ctx, &height) + if err != nil { + return time.Time{}, err + } + return resultBlock.Block.Time, nil +} + +func toPenumbraPacket(pi provider.PacketInfo) chantypes.Packet { + return chantypes.Packet{ + Sequence: pi.Sequence, + SourcePort: pi.SourcePort, + SourceChannel: pi.SourceChannel, + DestinationPort: pi.DestPort, + DestinationChannel: pi.DestChannel, + Data: pi.Data, + TimeoutHeight: pi.TimeoutHeight, + TimeoutTimestamp: pi.TimeoutTimestamp, + } +} + +func (cc *PenumbraProvider) setCometVersion(log *zap.Logger, version string) { + cc.cometLegacyEncoding = cc.legacyEncodedEvents(log, version) +} + +func (cc *PenumbraProvider) legacyEncodedEvents(log *zap.Logger, version string) bool { + return semver.Compare("v"+version, cometEncodingThreshold) < 0 +} + +// keysDir returns a string representing the path on the local filesystem where the keystore will be initialized. +func keysDir(home, chainID string) string { + return path.Join(home, "keys", chainID) +} + +// newRPCClient initializes a new tendermint RPC client connected to the specified address. +func newRPCClient(addr string, timeout time.Duration) (*rpchttp.HTTP, error) { + httpClient, err := libclient.DefaultHTTPClient(addr) + if err != nil { + return nil, err + } + httpClient.Timeout = timeout + rpcClient, err := rpchttp.NewWithClient(addr, "/websocket", httpClient) + if err != nil { + return nil, err + } + return rpcClient, nil +} diff --git a/relayer/chains/penumbra/query.go b/relayer/chains/penumbra/query.go new file mode 100644 index 000000000..da651ef93 --- /dev/null +++ b/relayer/chains/penumbra/query.go @@ -0,0 +1,985 @@ +package penumbra + +import ( + "context" + "encoding/binary" + "encoding/hex" + "errors" + "fmt" + "strings" + "time" + + abci "github.com/cometbft/cometbft/abci/types" + coretypes "github.com/cometbft/cometbft/rpc/core/types" + tmtypes "github.com/cometbft/cometbft/types" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + querytypes "github.com/cosmos/cosmos-sdk/types/query" + bankTypes "github.com/cosmos/cosmos-sdk/x/bank/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" + chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" + host "github.com/cosmos/ibc-go/v7/modules/core/24-host" + ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" + tmclient "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + "github.com/cosmos/relayer/v2/relayer/provider" + "go.uber.org/zap" + "golang.org/x/sync/errgroup" +) + +var _ provider.QueryProvider = &PenumbraProvider{} + +// QueryTx takes a transaction hash and returns the transaction +func (cc *PenumbraProvider) QueryTx(ctx context.Context, hashHex string) (*provider.RelayerTxResponse, error) { + hash, err := hex.DecodeString(hashHex) + if err != nil { + return nil, err + } + + resp, err := cc.RPCClient.Tx(ctx, hash, true) + if err != nil { + return nil, err + } + + events := parseEventsFromResponseDeliverTx(resp.TxResult) + + return &provider.RelayerTxResponse{ + Height: resp.Height, + TxHash: string(hash), + Code: resp.TxResult.Code, + Data: string(resp.TxResult.Data), + Events: events, + }, nil +} + +// QueryTxs returns an array of transactions given a tag +func (cc *PenumbraProvider) QueryTxs(ctx context.Context, page, limit int, events []string) ([]*provider.RelayerTxResponse, error) { + if len(events) == 0 { + return nil, errors.New("must declare at least one event to search") + } + + if page <= 0 { + return nil, errors.New("page must greater than 0") + } + + if limit <= 0 { + return nil, errors.New("limit must greater than 0") + } + + res, err := cc.RPCClient.TxSearch(ctx, strings.Join(events, " AND "), true, &page, &limit, "") + if err != nil { + return nil, err + } + + // Currently, we only call QueryTxs() in two spots and in both of them we are expecting there to only be, + // at most, one tx in the response. Because of this we don't want to initialize the slice with an initial size. + var txResps []*provider.RelayerTxResponse + for _, tx := range res.Txs { + relayerEvents := parseEventsFromResponseDeliverTx(tx.TxResult) + txResps = append(txResps, &provider.RelayerTxResponse{ + Height: tx.Height, + TxHash: string(tx.Hash), + Code: tx.TxResult.Code, + Data: string(tx.TxResult.Data), + Events: relayerEvents, + }) + } + return txResps, nil +} + +// parseEventsFromResponseDeliverTx parses the events from a ResponseDeliverTx and builds a slice +// of provider.RelayerEvent's. +func parseEventsFromResponseDeliverTx(resp abci.ResponseDeliverTx) []provider.RelayerEvent { + var events []provider.RelayerEvent + + for _, event := range resp.Events { + attributes := make(map[string]string) + for _, attribute := range event.Attributes { + attributes[string(attribute.Key)] = string(attribute.Value) + } + events = append(events, provider.RelayerEvent{ + EventType: event.Type, + Attributes: attributes, + }) + } + return events +} + +// QueryBalance returns the amount of coins in the relayer account +func (cc *PenumbraProvider) QueryBalance(ctx context.Context, keyName string) (sdk.Coins, error) { + addr, err := cc.ShowAddress(keyName) + if err != nil { + return nil, err + } + + return cc.QueryBalanceWithAddress(ctx, addr) +} + +// QueryBalanceWithAddress returns the amount of coins in the relayer account with address as input +// TODO add pagination support +func (cc *PenumbraProvider) QueryBalanceWithAddress(ctx context.Context, address string) (sdk.Coins, error) { + p := &bankTypes.QueryAllBalancesRequest{Address: address, Pagination: DefaultPageRequest()} + queryClient := bankTypes.NewQueryClient(cc) + + res, err := queryClient.AllBalances(ctx, p) + if err != nil { + return nil, err + } + + return res.Balances, nil +} + +// QueryUnbondingPeriod returns the unbonding period of the chain +func (cc *PenumbraProvider) QueryUnbondingPeriod(ctx context.Context) (time.Duration, error) { + // TODO: + return time.Hour * 4, nil + /* + req := stakingtypes.QueryParamsRequest{} + queryClient := stakingtypes.NewQueryClient(cc) + + res, err := queryClient.Params(ctx, &req) + if err != nil { + return 0, err + } + + return res.Params.UnbondingTime, nil + */ +} + +// QueryTendermintProof performs an ABCI query with the given key and returns +// the value of the query, the proto encoded merkle proof, and the height of +// the Tendermint block containing the state root. The desired tendermint height +// to perform the query should be set in the client context. The query will be +// performed at one below this height (at the IAVL version) in order to obtain +// the correct merkle proof. Proof queries at height less than or equal to 2 are +// not supported. Queries with a client context height of 0 will perform a query +// at the latest state available. +// Issue: https://github.com/cosmos/cosmos-sdk/issues/6567 +func (cc *PenumbraProvider) QueryTendermintProof(ctx context.Context, height int64, key []byte) ([]byte, []byte, clienttypes.Height, error) { + // ABCI queries at heights 1, 2 or less than or equal to 0 are not supported. + // Base app does not support queries for height less than or equal to 1. + // Therefore, a query at height 2 would be equivalent to a query at height 3. + // A height of 0 will query with the lastest state. + if height != 0 && height <= 2 { + return nil, nil, clienttypes.Height{}, fmt.Errorf("proof queries at height <= 2 are not supported") + } + + if height != 0 { + height-- + } + + cc.log.Debug("Querying K/V", zap.String("ChainId", cc.ChainId()), zap.Int64("Height", height), zap.String("Key", string(key))) + req := abci.RequestQuery{ + Path: "state/key", + Height: height, + Data: key, + Prove: true, + } + + res, err := cc.QueryABCI(ctx, req) + if err != nil { + return nil, nil, clienttypes.Height{}, err + } + + merkleProof, err := commitmenttypes.ConvertProofs(res.ProofOps) + if err != nil { + return nil, nil, clienttypes.Height{}, err + } + + cdc := codec.NewProtoCodec(cc.Codec.InterfaceRegistry) + + proofBz, err := cdc.Marshal(&merkleProof) + if err != nil { + return nil, nil, clienttypes.Height{}, err + } + + revision := clienttypes.ParseChainID(cc.PCfg.ChainID) + return res.Value, proofBz, clienttypes.NewHeight(revision, uint64(res.Height)+1), nil +} + +// QueryClientStateResponse retrieves the latest consensus state for a client in state at a given height +func (cc *PenumbraProvider) QueryClientStateResponse(ctx context.Context, height int64, srcClientId string) (*clienttypes.QueryClientStateResponse, error) { + key := host.FullClientStateKey(srcClientId) + + value, proofBz, proofHeight, err := cc.QueryTendermintProof(ctx, height, key) + if err != nil { + return nil, err + } + + // check if client exists + if len(value) == 0 { + return nil, sdkerrors.Wrap(clienttypes.ErrClientNotFound, srcClientId) + } + + cdc := codec.NewProtoCodec(cc.Codec.InterfaceRegistry) + + clientState, err := clienttypes.UnmarshalClientState(cdc, value) + if err != nil { + return nil, err + } + cc.log.Debug("QueryClientStateResponse", zap.Int64("Height", height), zap.Any("proofHeight", proofHeight), zap.String("Key", string(key)), zap.Any("ClientState", clientState)) + + anyClientState, err := clienttypes.PackClientState(clientState) + if err != nil { + return nil, err + } + + return &clienttypes.QueryClientStateResponse{ + ClientState: anyClientState, + Proof: proofBz, + ProofHeight: proofHeight, + }, nil +} + +// QueryClientState retrieves the latest consensus state for a client in state at a given height +// and unpacks it to exported client state interface +func (cc *PenumbraProvider) QueryClientState(ctx context.Context, height int64, clientid string) (ibcexported.ClientState, error) { + clientStateRes, err := cc.QueryClientStateResponse(ctx, height, clientid) + if err != nil { + return nil, err + } + + clientStateExported, err := clienttypes.UnpackClientState(clientStateRes.ClientState) + if err != nil { + return nil, err + } + + return clientStateExported, nil +} + +// QueryClientConsensusState retrieves the latest consensus state for a client in state at a given height +func (cc *PenumbraProvider) QueryClientConsensusState(ctx context.Context, chainHeight int64, clientid string, clientHeight ibcexported.Height) (*clienttypes.QueryConsensusStateResponse, error) { + key := host.FullConsensusStateKey(clientid, clientHeight) + + value, proofBz, proofHeight, err := cc.QueryTendermintProof(ctx, chainHeight, key) + if err != nil { + return nil, err + } + + // check if consensus state exists + if len(value) == 0 { + return nil, sdkerrors.Wrap(clienttypes.ErrConsensusStateNotFound, clientid) + } + + cdc := codec.NewProtoCodec(cc.Codec.InterfaceRegistry) + + cs, err := clienttypes.UnmarshalConsensusState(cdc, value) + if err != nil { + return nil, err + } + + anyConsensusState, err := clienttypes.PackConsensusState(cs) + if err != nil { + return nil, err + } + + return &clienttypes.QueryConsensusStateResponse{ + ConsensusState: anyConsensusState, + Proof: proofBz, + ProofHeight: proofHeight, + }, nil +} + +// QueryUpgradeProof performs an abci query with the given key and returns the proto encoded merkle proof +// for the query and the height at which the proof will succeed on a tendermint verifier. +func (cc *PenumbraProvider) QueryUpgradeProof(ctx context.Context, key []byte, height uint64) ([]byte, clienttypes.Height, error) { + res, err := cc.QueryABCI(ctx, abci.RequestQuery{ + Path: "state/key", + Height: int64(height - 1), + Data: key, + Prove: true, + }) + if err != nil { + return nil, clienttypes.Height{}, err + } + + merkleProof, err := commitmenttypes.ConvertProofs(res.ProofOps) + if err != nil { + return nil, clienttypes.Height{}, err + } + + proof, err := cc.Codec.Marshaler.Marshal(&merkleProof) + if err != nil { + return nil, clienttypes.Height{}, err + } + + revision := clienttypes.ParseChainID(cc.PCfg.ChainID) + + // proof height + 1 is returned as the proof created corresponds to the height the proof + // was created in the IAVL tree. Tendermint and subsequently the clients that rely on it + // have heights 1 above the IAVL tree. Thus we return proof height + 1 + return proof, clienttypes.Height{ + RevisionNumber: revision, + RevisionHeight: uint64(res.Height + 1), + }, nil +} + +// QueryUpgradedClient returns upgraded client info +func (cc *PenumbraProvider) QueryUpgradedClient(ctx context.Context, height int64) (*clienttypes.QueryClientStateResponse, error) { + req := clienttypes.QueryUpgradedClientStateRequest{} + + queryClient := clienttypes.NewQueryClient(cc) + + res, err := queryClient.UpgradedClientState(ctx, &req) + if err != nil { + return nil, err + } + + if res == nil || res.UpgradedClientState == nil { + return nil, fmt.Errorf("upgraded client state plan does not exist at height %d", height) + } + + proof, proofHeight, err := cc.QueryUpgradeProof(ctx, upgradetypes.UpgradedClientKey(height), uint64(height)) + if err != nil { + return nil, err + } + + return &clienttypes.QueryClientStateResponse{ + ClientState: res.UpgradedClientState, + Proof: proof, + ProofHeight: proofHeight, + }, nil +} + +// QueryUpgradedConsState returns upgraded consensus state and height of client +func (cc *PenumbraProvider) QueryUpgradedConsState(ctx context.Context, height int64) (*clienttypes.QueryConsensusStateResponse, error) { + req := clienttypes.QueryUpgradedConsensusStateRequest{} + + queryClient := clienttypes.NewQueryClient(cc) + + res, err := queryClient.UpgradedConsensusState(ctx, &req) + if err != nil { + return nil, err + } + + if res == nil || res.UpgradedConsensusState == nil { + return nil, fmt.Errorf("upgraded consensus state plan does not exist at height %d", height) + } + + proof, proofHeight, err := cc.QueryUpgradeProof(ctx, upgradetypes.UpgradedConsStateKey(height), uint64(height)) + if err != nil { + return nil, err + } + + return &clienttypes.QueryConsensusStateResponse{ + ConsensusState: res.UpgradedConsensusState, + Proof: proof, + ProofHeight: proofHeight, + }, nil +} + +// QueryConsensusState returns a consensus state for a given chain to be used as a +// client in another chain, fetches latest height when passed 0 as arg +func (cc *PenumbraProvider) QueryConsensusState(ctx context.Context, height int64) (ibcexported.ConsensusState, int64, error) { + commit, err := cc.RPCClient.Commit(ctx, &height) + if err != nil { + return &tmclient.ConsensusState{}, 0, err + } + + page := 1 + count := 10_000 + + nextHeight := height + 1 + nextVals, err := cc.RPCClient.Validators(ctx, &nextHeight, &page, &count) + if err != nil { + return &tmclient.ConsensusState{}, 0, err + } + + state := &tmclient.ConsensusState{ + Timestamp: commit.Time, + Root: commitmenttypes.NewMerkleRoot(commit.AppHash), + NextValidatorsHash: tmtypes.NewValidatorSet(nextVals.Validators).Hash(), + } + + return state, height, nil +} + +// QueryClients queries all the clients! +// TODO add pagination support +func (cc *PenumbraProvider) QueryClients(ctx context.Context) (clienttypes.IdentifiedClientStates, error) { + qc := clienttypes.NewQueryClient(cc) + state, err := qc.ClientStates(ctx, &clienttypes.QueryClientStatesRequest{ + Pagination: DefaultPageRequest(), + }) + if err != nil { + return nil, err + } + return state.ClientStates, nil +} + +// QueryConnection returns the remote end of a given connection +func (cc *PenumbraProvider) QueryConnection(ctx context.Context, height int64, connectionid string) (*conntypes.QueryConnectionResponse, error) { + res, err := cc.queryConnectionABCI(ctx, height, connectionid) + if err != nil && strings.Contains(err.Error(), "not found") { + return &conntypes.QueryConnectionResponse{ + Connection: &conntypes.ConnectionEnd{ + ClientId: "client", + Versions: []*conntypes.Version{}, + State: conntypes.UNINITIALIZED, + Counterparty: conntypes.Counterparty{ + ClientId: "client", + ConnectionId: "connection", + Prefix: commitmenttypes.MerklePrefix{KeyPrefix: []byte{}}, + }, + DelayPeriod: 0, + }, + Proof: []byte{}, + ProofHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 0}, + }, nil + } else if err != nil { + return nil, err + } + return res, nil +} + +func (cc *PenumbraProvider) queryConnectionABCI(ctx context.Context, height int64, connectionID string) (*conntypes.QueryConnectionResponse, error) { + key := host.ConnectionKey(connectionID) + + value, proofBz, proofHeight, err := cc.QueryTendermintProof(ctx, height, key) + if err != nil { + return nil, err + } + + // check if connection exists + if len(value) == 0 { + return nil, sdkerrors.Wrap(conntypes.ErrConnectionNotFound, connectionID) + } + + cdc := codec.NewProtoCodec(cc.Codec.InterfaceRegistry) + + var connection conntypes.ConnectionEnd + if err := cdc.Unmarshal(value, &connection); err != nil { + return nil, err + } + + return &conntypes.QueryConnectionResponse{ + Connection: &connection, + Proof: proofBz, + ProofHeight: proofHeight, + }, nil +} + +// QueryConnections gets any connections on a chain +// TODO add pagination support +func (cc *PenumbraProvider) QueryConnections(ctx context.Context) (conns []*conntypes.IdentifiedConnection, err error) { + qc := conntypes.NewQueryClient(cc) + res, err := qc.Connections(ctx, &conntypes.QueryConnectionsRequest{ + Pagination: DefaultPageRequest(), + }) + if err != nil || res == nil { + return nil, err + } + return res.Connections, err +} + +// QueryConnectionsUsingClient gets any connections that exist between chain and counterparty +// TODO add pagination support +func (cc *PenumbraProvider) QueryConnectionsUsingClient(ctx context.Context, height int64, clientid string) (*conntypes.QueryConnectionsResponse, error) { + qc := conntypes.NewQueryClient(cc) + res, err := qc.Connections(ctx, &conntypes.QueryConnectionsRequest{ + Pagination: DefaultPageRequest(), + }) + return res, err +} + +// GenerateConnHandshakeProof generates all the proofs needed to prove the existence of the +// connection state on this chain. A counterparty should use these generated proofs. +func (cc *PenumbraProvider) GenerateConnHandshakeProof(ctx context.Context, height int64, clientId, connId string) (clientState ibcexported.ClientState, clientStateProof []byte, consensusProof []byte, connectionProof []byte, connectionProofHeight ibcexported.Height, err error) { + var ( + clientStateRes *clienttypes.QueryClientStateResponse + consensusStateRes *clienttypes.QueryConsensusStateResponse + connectionStateRes *conntypes.QueryConnectionResponse + eg = new(errgroup.Group) + ) + + // query for the client state for the proof and get the height to query the consensus state at. + clientStateRes, err = cc.QueryClientStateResponse(ctx, height, clientId) + if err != nil { + return nil, nil, nil, nil, clienttypes.Height{}, err + } + + clientState, err = clienttypes.UnpackClientState(clientStateRes.ClientState) + if err != nil { + return nil, nil, nil, nil, clienttypes.Height{}, err + } + + eg.Go(func() error { + var err error + consensusStateRes, err = cc.QueryClientConsensusState(ctx, height, clientId, clientState.GetLatestHeight()) + return err + }) + eg.Go(func() error { + var err error + connectionStateRes, err = cc.QueryConnection(ctx, height, connId) + return err + }) + + if err := eg.Wait(); err != nil { + return nil, nil, nil, nil, clienttypes.Height{}, err + } + cc.log.Debug("GenerateConnHandshakeProof", zap.Int64("height", height), zap.Any("connId", connId), zap.Any("connectionStateRes", connectionStateRes)) + + return clientState, clientStateRes.Proof, consensusStateRes.Proof, connectionStateRes.Proof, connectionStateRes.ProofHeight, nil +} + +// QueryChannel returns the channel associated with a channelID +func (cc *PenumbraProvider) QueryChannel(ctx context.Context, height int64, channelid, portid string) (chanRes *chantypes.QueryChannelResponse, err error) { + res, err := cc.queryChannelABCI(ctx, height, portid, channelid) + if err != nil && strings.Contains(err.Error(), "not found") { + + return &chantypes.QueryChannelResponse{ + Channel: &chantypes.Channel{ + State: chantypes.UNINITIALIZED, + Ordering: chantypes.UNORDERED, + Counterparty: chantypes.Counterparty{ + PortId: "port", + ChannelId: "channel", + }, + ConnectionHops: []string{}, + Version: "version", + }, + Proof: []byte{}, + ProofHeight: clienttypes.Height{ + RevisionNumber: 0, + RevisionHeight: 0, + }, + }, nil + } else if err != nil { + return nil, err + } + return res, nil +} + +func (cc *PenumbraProvider) queryChannelABCI(ctx context.Context, height int64, portID, channelID string) (*chantypes.QueryChannelResponse, error) { + key := host.ChannelKey(portID, channelID) + + value, proofBz, proofHeight, err := cc.QueryTendermintProof(ctx, height, key) + if err != nil { + return nil, err + } + + // check if channel exists + if len(value) == 0 { + return nil, sdkerrors.Wrapf(chantypes.ErrChannelNotFound, "portID (%s), channelID (%s)", portID, channelID) + } + + cdc := codec.NewProtoCodec(cc.Codec.InterfaceRegistry) + + var channel chantypes.Channel + if err := cdc.Unmarshal(value, &channel); err != nil { + return nil, err + } + + return &chantypes.QueryChannelResponse{ + Channel: &channel, + Proof: proofBz, + ProofHeight: proofHeight, + }, nil +} + +// QueryChannelClient returns the client state of the client supporting a given channel +func (cc *PenumbraProvider) QueryChannelClient(ctx context.Context, height int64, channelid, portid string) (*clienttypes.IdentifiedClientState, error) { + qc := chantypes.NewQueryClient(cc) + cState, err := qc.ChannelClientState(ctx, &chantypes.QueryChannelClientStateRequest{ + PortId: portid, + ChannelId: channelid, + }) + if err != nil { + return nil, err + } + return cState.IdentifiedClientState, nil +} + +// QueryConnectionChannels queries the channels associated with a connection +func (cc *PenumbraProvider) QueryConnectionChannels(ctx context.Context, height int64, connectionid string) ([]*chantypes.IdentifiedChannel, error) { + qc := chantypes.NewQueryClient(cc) + chans, err := qc.ConnectionChannels(ctx, &chantypes.QueryConnectionChannelsRequest{ + Connection: connectionid, + Pagination: DefaultPageRequest(), + }) + if err != nil { + return nil, err + } + return chans.Channels, nil +} + +// QueryChannels returns all the channels that are registered on a chain +// TODO add pagination support +func (cc *PenumbraProvider) QueryChannels(ctx context.Context) ([]*chantypes.IdentifiedChannel, error) { + qc := chantypes.NewQueryClient(cc) + res, err := qc.Channels(ctx, &chantypes.QueryChannelsRequest{ + Pagination: DefaultPageRequest(), + }) + if err != nil { + return nil, err + } + return res.Channels, nil +} + +// QueryPacketCommitments returns an array of packet commitments +// TODO add pagination support +func (cc *PenumbraProvider) QueryPacketCommitments(ctx context.Context, height uint64, channelid, portid string) (commitments *chantypes.QueryPacketCommitmentsResponse, err error) { + qc := chantypes.NewQueryClient(cc) + c, err := qc.PacketCommitments(ctx, &chantypes.QueryPacketCommitmentsRequest{ + PortId: portid, + ChannelId: channelid, + Pagination: DefaultPageRequest(), + }) + if err != nil { + return nil, err + } + return c, nil +} + +// QueryPacketAcknowledgements returns an array of packet acks +// TODO add pagination support +func (cc *PenumbraProvider) QueryPacketAcknowledgements(ctx context.Context, height uint64, channelid, portid string) (acknowledgements []*chantypes.PacketState, err error) { + qc := chantypes.NewQueryClient(cc) + acks, err := qc.PacketAcknowledgements(ctx, &chantypes.QueryPacketAcknowledgementsRequest{ + PortId: portid, + ChannelId: channelid, + Pagination: DefaultPageRequest(), + }) + if err != nil { + return nil, err + } + return acks.Acknowledgements, nil +} + +// QueryUnreceivedPackets returns a list of unrelayed packet commitments +func (cc *PenumbraProvider) QueryUnreceivedPackets(ctx context.Context, height uint64, channelid, portid string, seqs []uint64) ([]uint64, error) { + qc := chantypes.NewQueryClient(cc) + res, err := qc.UnreceivedPackets(ctx, &chantypes.QueryUnreceivedPacketsRequest{ + PortId: portid, + ChannelId: channelid, + PacketCommitmentSequences: seqs, + }) + if err != nil { + return nil, err + } + return res.Sequences, nil +} + +// QueryUnreceivedAcknowledgements returns a list of unrelayed packet acks +func (cc *PenumbraProvider) QueryUnreceivedAcknowledgements(ctx context.Context, height uint64, channelid, portid string, seqs []uint64) ([]uint64, error) { + qc := chantypes.NewQueryClient(cc) + res, err := qc.UnreceivedAcks(ctx, &chantypes.QueryUnreceivedAcksRequest{ + PortId: portid, + ChannelId: channelid, + PacketAckSequences: seqs, + }) + if err != nil { + return nil, err + } + return res.Sequences, nil +} + +// QueryNextSeqRecv returns the next seqRecv for a configured channel +func (cc *PenumbraProvider) QueryNextSeqRecv(ctx context.Context, height int64, channelid, portid string) (recvRes *chantypes.QueryNextSequenceReceiveResponse, err error) { + key := host.NextSequenceRecvKey(portid, channelid) + + value, proofBz, proofHeight, err := cc.QueryTendermintProof(ctx, height, key) + if err != nil { + return nil, err + } + + // check if next sequence receive exists + if len(value) == 0 { + return nil, sdkerrors.Wrapf(chantypes.ErrChannelNotFound, "portID (%s), channelID (%s)", portid, channelid) + } + + sequence := binary.BigEndian.Uint64(value) + + return &chantypes.QueryNextSequenceReceiveResponse{ + NextSequenceReceive: sequence, + Proof: proofBz, + ProofHeight: proofHeight, + }, nil +} + +// QueryPacketCommitment returns the packet commitment proof at a given height +func (cc *PenumbraProvider) QueryPacketCommitment(ctx context.Context, height int64, channelid, portid string, seq uint64) (comRes *chantypes.QueryPacketCommitmentResponse, err error) { + key := host.PacketCommitmentKey(portid, channelid, seq) + + value, proofBz, proofHeight, err := cc.QueryTendermintProof(ctx, height, key) + if err != nil { + return nil, err + } + + // check if packet commitment exists + if len(value) == 0 { + return nil, sdkerrors.Wrapf(chantypes.ErrPacketCommitmentNotFound, "portID (%s), channelID (%s), sequence (%d)", portid, channelid, seq) + } + + return &chantypes.QueryPacketCommitmentResponse{ + Commitment: value, + Proof: proofBz, + ProofHeight: proofHeight, + }, nil +} + +// QueryPacketAcknowledgement returns the packet ack proof at a given height +func (cc *PenumbraProvider) QueryPacketAcknowledgement(ctx context.Context, height int64, channelid, portid string, seq uint64) (ackRes *chantypes.QueryPacketAcknowledgementResponse, err error) { + key := host.PacketAcknowledgementKey(portid, channelid, seq) + + value, proofBz, proofHeight, err := cc.QueryTendermintProof(ctx, height, key) + if err != nil { + return nil, err + } + + if len(value) == 0 { + return nil, sdkerrors.Wrapf(chantypes.ErrInvalidAcknowledgement, "portID (%s), channelID (%s), sequence (%d)", portid, channelid, seq) + } + + return &chantypes.QueryPacketAcknowledgementResponse{ + Acknowledgement: value, + Proof: proofBz, + ProofHeight: proofHeight, + }, nil +} + +// QueryPacketReceipt returns the packet receipt proof at a given height +func (cc *PenumbraProvider) QueryPacketReceipt(ctx context.Context, height int64, channelid, portid string, seq uint64) (recRes *chantypes.QueryPacketReceiptResponse, err error) { + key := host.PacketReceiptKey(portid, channelid, seq) + + value, proofBz, proofHeight, err := cc.QueryTendermintProof(ctx, height, key) + if err != nil { + return nil, err + } + + return &chantypes.QueryPacketReceiptResponse{ + Received: value != nil, + Proof: proofBz, + ProofHeight: proofHeight, + }, nil +} + +func (cc *PenumbraProvider) QueryLatestHeight(ctx context.Context) (int64, error) { + stat, err := cc.RPCClient.Status(ctx) + if err != nil { + return -1, err + } else if stat.SyncInfo.CatchingUp { + return -1, fmt.Errorf("node at %s running chain %s not caught up", cc.PCfg.RPCAddr, cc.PCfg.ChainID) + } + return stat.SyncInfo.LatestBlockHeight, nil +} + +// QueryHeaderAtHeight returns the header at a given height +func (cc *PenumbraProvider) QueryHeaderAtHeight(ctx context.Context, height int64) (ibcexported.ClientMessage, error) { + var ( + page = 1 + perPage = 100000 + ) + if height <= 0 { + return nil, fmt.Errorf("must pass in valid height, %d not valid", height) + } + + res, err := cc.RPCClient.Commit(ctx, &height) + if err != nil { + return nil, err + } + + val, err := cc.RPCClient.Validators(ctx, &height, &page, &perPage) + if err != nil { + return nil, err + } + + protoVal, err := tmtypes.NewValidatorSet(val.Validators).ToProto() + if err != nil { + return nil, err + } + + return &tmclient.Header{ + // NOTE: This is not a SignedHeader + // We are missing a light.Commit type here + SignedHeader: res.SignedHeader.ToProto(), + ValidatorSet: protoVal, + }, nil +} + +// QueryDenomTrace takes a denom from IBC and queries the information about it +func (cc *PenumbraProvider) QueryDenomTrace(ctx context.Context, denom string) (*transfertypes.DenomTrace, error) { + transfers, err := transfertypes.NewQueryClient(cc).DenomTrace(ctx, + &transfertypes.QueryDenomTraceRequest{ + Hash: denom, + }) + if err != nil { + return nil, err + } + return transfers.DenomTrace, nil +} + +// QueryDenomTraces returns all the denom traces from a given chain +// TODO add pagination support +func (cc *PenumbraProvider) QueryDenomTraces(ctx context.Context, offset, limit uint64, height int64) ([]transfertypes.DenomTrace, error) { + transfers, err := transfertypes.NewQueryClient(cc).DenomTraces(ctx, + &transfertypes.QueryDenomTracesRequest{ + Pagination: DefaultPageRequest(), + }) + if err != nil { + return nil, err + } + return transfers.DenomTraces, nil +} + +func (cc *PenumbraProvider) QueryStakingParams(ctx context.Context) (*stakingtypes.Params, error) { + res, err := stakingtypes.NewQueryClient(cc).Params(ctx, &stakingtypes.QueryParamsRequest{}) + if err != nil { + return nil, err + } + return &res.Params, nil +} + +func DefaultPageRequest() *querytypes.PageRequest { + return &querytypes.PageRequest{ + Key: []byte(""), + Offset: 0, + Limit: 1000, + CountTotal: true, + } +} + +func (cc *PenumbraProvider) QueryConsensusStateABCI(ctx context.Context, clientID string, height ibcexported.Height) (*clienttypes.QueryConsensusStateResponse, error) { + key := host.FullConsensusStateKey(clientID, height) + + value, proofBz, proofHeight, err := cc.QueryTendermintProof(ctx, int64(height.GetRevisionHeight()), key) + if err != nil { + return nil, err + } + + // check if consensus state exists + if len(value) == 0 { + return nil, sdkerrors.Wrap(clienttypes.ErrConsensusStateNotFound, clientID) + } + + // TODO do we really want to create a new codec? ChainClient exposes proto.Marshaler + cdc := codec.NewProtoCodec(cc.Codec.InterfaceRegistry) + + cs, err := clienttypes.UnmarshalConsensusState(cdc, value) + if err != nil { + return nil, err + } + + anyConsensusState, err := clienttypes.PackConsensusState(cs) + if err != nil { + return nil, err + } + + return &clienttypes.QueryConsensusStateResponse{ + ConsensusState: anyConsensusState, + Proof: proofBz, + ProofHeight: proofHeight, + }, nil +} + +// queryIBCMessages returns an array of IBC messages given a tag +func (cc *PenumbraProvider) queryIBCMessages(ctx context.Context, log *zap.Logger, page, limit int, query string) ([]ibcMessage, error) { + if query == "" { + return nil, errors.New("query string must be provided") + } + + if page <= 0 { + return nil, errors.New("page must greater than 0") + } + + if limit <= 0 { + return nil, errors.New("limit must greater than 0") + } + + res, err := cc.RPCClient.TxSearch(ctx, query, true, &page, &limit, "") + if err != nil { + return nil, err + } + var ibcMsgs []ibcMessage + chainID := cc.ChainId() + for _, tx := range res.Txs { + ibcMsgs = append(ibcMsgs, ibcMessagesFromEvents(log, tx.TxResult.Events, chainID, 0, true)...) + } + + return ibcMsgs, nil +} + +func sendPacketQuery(channelID string, portID string, seq uint64) string { + x := []string{ + fmt.Sprintf("%s.packet_src_channel='%s'", spTag, channelID), + fmt.Sprintf("%s.packet_src_port='%s'", spTag, portID), + fmt.Sprintf("%s.packet_sequence='%d'", spTag, seq), + } + return strings.Join(x, " AND ") +} + +func (cc *PenumbraProvider) QuerySendPacket( + ctx context.Context, + srcChanID, + srcPortID string, + sequence uint64, +) (provider.PacketInfo, error) { + q := sendPacketQuery(srcChanID, srcPortID, sequence) + ibcMsgs, err := cc.queryIBCMessages(ctx, cc.log, 1, 1000, q) + if err != nil { + return provider.PacketInfo{}, err + } + for _, msg := range ibcMsgs { + if msg.eventType != chantypes.EventTypeSendPacket { + continue + } + if pi, ok := msg.info.(*packetInfo); ok { + if pi.SourceChannel == srcChanID && pi.SourcePort == srcPortID && pi.Sequence == sequence { + return provider.PacketInfo(*pi), nil + } + } + } + return provider.PacketInfo{}, fmt.Errorf("no ibc messages found for send_packet query: %s", q) +} + +func writeAcknowledgementQuery(channelID string, portID string, seq uint64) string { + x := []string{ + fmt.Sprintf("%s.packet_dst_channel='%s'", waTag, channelID), + fmt.Sprintf("%s.packet_dst_port='%s'", waTag, portID), + fmt.Sprintf("%s.packet_sequence='%d'", waTag, seq), + } + return strings.Join(x, " AND ") +} + +func (cc *PenumbraProvider) QueryRecvPacket( + ctx context.Context, + dstChanID, + dstPortID string, + sequence uint64, +) (provider.PacketInfo, error) { + q := writeAcknowledgementQuery(dstChanID, dstPortID, sequence) + ibcMsgs, err := cc.queryIBCMessages(ctx, cc.log, 1, 1000, q) + if err != nil { + return provider.PacketInfo{}, err + } + for _, msg := range ibcMsgs { + if msg.eventType != chantypes.EventTypeWriteAck { + continue + } + if pi, ok := msg.info.(*packetInfo); ok { + if pi.DestChannel == dstChanID && pi.DestPort == dstPortID && pi.Sequence == sequence { + return provider.PacketInfo(*pi), nil + } + } + } + return provider.PacketInfo{}, fmt.Errorf("no ibc messages found for write_acknowledgement query: %s", q) +} + +// QueryStatus queries the current node status. +func (cc *PenumbraProvider) QueryStatus(ctx context.Context) (*coretypes.ResultStatus, error) { + status, err := cc.RPCClient.Status(ctx) + if err != nil { + return nil, fmt.Errorf("failed to query node status: %w", err) + } + return status, nil +} + +func (cc *PenumbraProvider) QueryICQWithProof(ctx context.Context, msgType string, request []byte, height uint64) (provider.ICQProof, error) { + //TODO implement me + panic("implement me") +} diff --git a/relayer/chains/penumbra/relayer_packets.go b/relayer/chains/penumbra/relayer_packets.go new file mode 100644 index 000000000..7e5057037 --- /dev/null +++ b/relayer/chains/penumbra/relayer_packets.go @@ -0,0 +1,232 @@ +package penumbra + +import ( + "context" + "fmt" + + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + "github.com/cosmos/relayer/v2/relayer/provider" +) + +var ( + _ provider.RelayPacket = relayMsgTimeout{} + _ provider.RelayPacket = relayMsgRecvPacket{} + _ provider.RelayPacket = relayMsgPacketAck{} +) + +type relayMsgTimeout struct { + packetData []byte + seq uint64 + timeout clienttypes.Height + timeoutStamp uint64 + dstRecvRes *chantypes.QueryPacketReceiptResponse + + pass bool +} + +func (rp relayMsgTimeout) Data() []byte { + return rp.packetData +} + +func (rp relayMsgTimeout) Seq() uint64 { + return rp.seq +} + +func (rp relayMsgTimeout) Timeout() clienttypes.Height { + return rp.timeout +} + +func (rp relayMsgTimeout) TimeoutStamp() uint64 { + return rp.timeoutStamp +} + +func (rp relayMsgTimeout) FetchCommitResponse(ctx context.Context, dst provider.ChainProvider, queryHeight uint64, dstChanId, dstPortId string) error { + dstRecvRes, err := dst.QueryPacketReceipt(ctx, int64(queryHeight)-1, dstChanId, dstPortId, rp.seq) + switch { + case err != nil: + return err + case dstRecvRes.Proof == nil: + return fmt.Errorf("timeout packet receipt proof seq(%d) is nil", rp.seq) + default: + rp.dstRecvRes = dstRecvRes + return nil + } +} + +func (rp relayMsgTimeout) Msg(src provider.ChainProvider, srcPortId, srcChanId, dstPortId, dstChanId string) (provider.RelayerMessage, error) { + if rp.dstRecvRes == nil { + return nil, fmt.Errorf("timeout packet [%s]seq{%d} has no associated proofs", src.ChainId(), rp.seq) + } + addr, err := src.Address() + if err != nil { + return nil, err + } + + msg := &chantypes.MsgTimeout{ + Packet: chantypes.Packet{ + Sequence: rp.seq, + SourcePort: srcPortId, + SourceChannel: srcChanId, + DestinationPort: dstPortId, + DestinationChannel: dstChanId, + Data: rp.packetData, + TimeoutHeight: rp.timeout, + TimeoutTimestamp: rp.timeoutStamp, + }, + ProofUnreceived: rp.dstRecvRes.Proof, + ProofHeight: rp.dstRecvRes.ProofHeight, + NextSequenceRecv: rp.seq, + Signer: addr, + } + + return NewPenumbraMessage(msg), nil +} + +type relayMsgRecvPacket struct { + packetData []byte + seq uint64 + timeout clienttypes.Height + timeoutStamp uint64 + dstComRes *chantypes.QueryPacketCommitmentResponse +} + +func (rp relayMsgRecvPacket) timeoutPacket() *relayMsgTimeout { + return &relayMsgTimeout{ + packetData: rp.packetData, + seq: rp.seq, + timeout: rp.timeout, + timeoutStamp: rp.timeoutStamp, + dstRecvRes: nil, + pass: false, + } +} + +func (rp relayMsgRecvPacket) Data() []byte { + return rp.packetData +} + +func (rp relayMsgRecvPacket) Seq() uint64 { + return rp.seq +} + +func (rp relayMsgRecvPacket) Timeout() clienttypes.Height { + return rp.timeout +} + +func (rp relayMsgRecvPacket) TimeoutStamp() uint64 { + return rp.timeoutStamp +} + +func (rp relayMsgRecvPacket) FetchCommitResponse(ctx context.Context, dst provider.ChainProvider, queryHeight uint64, dstChanId, dstPortId string) error { + dstCommitRes, err := dst.QueryPacketCommitment(ctx, int64(queryHeight)-1, dstChanId, dstPortId, rp.seq) + switch { + case err != nil: + return err + case dstCommitRes.Proof == nil: + return fmt.Errorf("recv packet commitment proof seq(%d) is nil", rp.seq) + case dstCommitRes.Commitment == nil: + return fmt.Errorf("recv packet commitment query seq(%d) is nil", rp.seq) + default: + rp.dstComRes = dstCommitRes + return nil + } +} + +func (rp relayMsgRecvPacket) Msg(src provider.ChainProvider, srcPortId, srcChanId, dstPortId, dstChanId string) (provider.RelayerMessage, error) { + if rp.dstComRes == nil { + return nil, fmt.Errorf("receive packet [%s]seq{%d} has no associated proofs", src.ChainId(), rp.seq) + } + addr, err := src.Address() + if err != nil { + return nil, err + } + + msg := &chantypes.MsgRecvPacket{ + Packet: chantypes.Packet{ + Sequence: rp.seq, + SourcePort: dstPortId, + SourceChannel: dstChanId, + DestinationPort: srcPortId, + DestinationChannel: srcChanId, + Data: rp.packetData, + TimeoutHeight: rp.timeout, + TimeoutTimestamp: rp.timeoutStamp, + }, + ProofCommitment: rp.dstComRes.Proof, + ProofHeight: rp.dstComRes.ProofHeight, + Signer: addr, + } + + return NewPenumbraMessage(msg), nil +} + +type relayMsgPacketAck struct { + packetData []byte + ack []byte + seq uint64 + timeout clienttypes.Height + timeoutStamp uint64 + dstComRes *chantypes.QueryPacketAcknowledgementResponse + + pass bool +} + +func (rp relayMsgPacketAck) Data() []byte { + return rp.packetData +} +func (rp relayMsgPacketAck) Seq() uint64 { + return rp.seq +} +func (rp relayMsgPacketAck) Timeout() clienttypes.Height { + return rp.timeout +} + +func (rp relayMsgPacketAck) TimeoutStamp() uint64 { + return rp.timeoutStamp +} + +func (rp relayMsgPacketAck) Msg(src provider.ChainProvider, srcPortId, srcChanId, dstPortId, dstChanId string) (provider.RelayerMessage, error) { + if rp.dstComRes == nil { + return nil, fmt.Errorf("ack packet [%s]seq{%d} has no associated proofs", src.ChainId(), rp.seq) + } + + addr, err := src.Address() + if err != nil { + return nil, err + } + + msg := &chantypes.MsgAcknowledgement{ + Packet: chantypes.Packet{ + Sequence: rp.seq, + SourcePort: srcPortId, + SourceChannel: srcChanId, + DestinationPort: dstPortId, + DestinationChannel: dstChanId, + Data: rp.packetData, + TimeoutHeight: rp.timeout, + TimeoutTimestamp: rp.timeoutStamp, + }, + Acknowledgement: rp.ack, + ProofAcked: rp.dstComRes.Proof, + ProofHeight: rp.dstComRes.ProofHeight, + Signer: addr, + } + + return NewPenumbraMessage(msg), nil +} + +func (rp relayMsgPacketAck) FetchCommitResponse(ctx context.Context, dst provider.ChainProvider, queryHeight uint64, dstChanId, dstPortId string) error { + dstCommitRes, err := dst.QueryPacketAcknowledgement(ctx, int64(queryHeight)-1, dstChanId, dstPortId, rp.seq) + switch { + case err != nil: + return err + case dstCommitRes.Proof == nil: + return fmt.Errorf("ack packet acknowledgement proof seq(%d) is nil", rp.seq) + case dstCommitRes.Acknowledgement == nil: + return fmt.Errorf("ack packet acknowledgement query seq(%d) is nil", rp.seq) + default: + rp.dstComRes = dstCommitRes + return nil + } +} diff --git a/relayer/chains/penumbra/tx.go b/relayer/chains/penumbra/tx.go new file mode 100644 index 000000000..47e6ce81e --- /dev/null +++ b/relayer/chains/penumbra/tx.go @@ -0,0 +1,2244 @@ +package penumbra + +import ( + "context" + "encoding/base64" + "errors" + "fmt" + "math/rand" + "regexp" + "strconv" + "strings" + "time" + + "github.com/avast/retry-go/v4" + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cometbft/cometbft/libs/bytes" + "github.com/cometbft/cometbft/light" + tmcrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + rpcclient "github.com/cometbft/cometbft/rpc/client" + coretypes "github.com/cometbft/cometbft/rpc/core/types" + tmtypes "github.com/cometbft/cometbft/types" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/store/rootmulti" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + cosmosproto "github.com/cosmos/gogoproto/proto" + transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" + chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" + host "github.com/cosmos/ibc-go/v7/modules/core/24-host" + ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" + tmclient "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + ics23 "github.com/cosmos/ics23/go" + "github.com/cosmos/relayer/v2/relayer/chains/cosmos" + penumbracrypto "github.com/cosmos/relayer/v2/relayer/chains/penumbra/core/crypto/v1alpha1" + penumbraibctypes "github.com/cosmos/relayer/v2/relayer/chains/penumbra/core/ibc/v1alpha1" + penumbratypes "github.com/cosmos/relayer/v2/relayer/chains/penumbra/core/transaction/v1alpha1" + "github.com/cosmos/relayer/v2/relayer/provider" + "go.uber.org/zap" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +// Variables used for retries +var ( + rtyAttNum = uint(5) + rtyAtt = retry.Attempts(rtyAttNum) + rtyDel = retry.Delay(time.Millisecond * 400) + rtyErr = retry.LastErrorOnly(true) + numRegex = regexp.MustCompile("[0-9]+") + defaultBroadcastWaitTimeout = 10 * time.Minute + errUnknown = "unknown" +) + +// Default IBC settings +var ( + defaultChainPrefix = commitmenttypes.NewMerklePrefix([]byte("ibc")) + defaultDelayPeriod = uint64(0) +) + +// Strings for parsing events +var ( + spTag = "send_packet" + waTag = "write_acknowledgement" + srcChanTag = "packet_src_channel" + dstChanTag = "packet_dst_channel" + srcPortTag = "packet_src_port" + dstPortTag = "packet_dst_port" + dataTag = "packet_data" + ackTag = "packet_ack" + toHeightTag = "packet_timeout_height" + toTSTag = "packet_timeout_timestamp" + seqTag = "packet_sequence" +) + +const ( + ErrTimeoutAfterWaitingForTxBroadcast _err = "timed out after waiting for tx to get included in the block" +) + +type _err string + +func (e _err) Error() string { return string(e) } + +// Deprecated: this interface is used only internally for scenario we are +// deprecating (StdTxConfig support) +type intoAny interface { + AsAny() *codectypes.Any +} + +// SendMessage attempts to sign, encode & send a RelayerMessage +// This is used extensively in the relayer as an extension of the Provider interface +func (cc *PenumbraProvider) SendMessage(ctx context.Context, msg provider.RelayerMessage, memo string) (*provider.RelayerTxResponse, bool, error) { + return cc.SendMessages(ctx, []provider.RelayerMessage{msg}, memo) +} + +// takes a RelayerMessage, converts it to a PenumbraMessage, and wraps it into +// Penumbra's equivalent of the "message" abstraction, an Action. +func msgToPenumbraAction(msg sdk.Msg) (*penumbratypes.Action, error) { + anyMsg, err := codectypes.NewAnyWithValue(msg) + if err != nil { + return nil, err + } + + switch msg.(type) { + case *clienttypes.MsgCreateClient: + return &penumbratypes.Action{ + Action: &penumbratypes.Action_IbcAction{IbcAction: &penumbraibctypes.IbcAction{ + RawAction: anyMsg, + }}, + }, nil + case *clienttypes.MsgUpdateClient: + return &penumbratypes.Action{ + Action: &penumbratypes.Action_IbcAction{IbcAction: &penumbraibctypes.IbcAction{ + RawAction: anyMsg, + }}, + }, nil + case *conntypes.MsgConnectionOpenInit: + return &penumbratypes.Action{ + Action: &penumbratypes.Action_IbcAction{IbcAction: &penumbraibctypes.IbcAction{ + RawAction: anyMsg, + }}, + }, nil + case *conntypes.MsgConnectionOpenAck: + return &penumbratypes.Action{ + Action: &penumbratypes.Action_IbcAction{IbcAction: &penumbraibctypes.IbcAction{ + RawAction: anyMsg, + }}, + }, nil + case *conntypes.MsgConnectionOpenTry: + return &penumbratypes.Action{ + Action: &penumbratypes.Action_IbcAction{IbcAction: &penumbraibctypes.IbcAction{ + RawAction: anyMsg, + }}, + }, nil + case *conntypes.MsgConnectionOpenConfirm: + return &penumbratypes.Action{ + Action: &penumbratypes.Action_IbcAction{IbcAction: &penumbraibctypes.IbcAction{ + RawAction: anyMsg, + }}, + }, nil + case *chantypes.MsgChannelOpenInit: + return &penumbratypes.Action{ + Action: &penumbratypes.Action_IbcAction{IbcAction: &penumbraibctypes.IbcAction{ + RawAction: anyMsg, + }}, + }, nil + case *chantypes.MsgChannelOpenTry: + return &penumbratypes.Action{ + Action: &penumbratypes.Action_IbcAction{IbcAction: &penumbraibctypes.IbcAction{ + RawAction: anyMsg, + }}, + }, nil + case *chantypes.MsgChannelOpenAck: + return &penumbratypes.Action{ + Action: &penumbratypes.Action_IbcAction{IbcAction: &penumbraibctypes.IbcAction{ + RawAction: anyMsg, + }}, + }, nil + case *chantypes.MsgChannelOpenConfirm: + return &penumbratypes.Action{ + Action: &penumbratypes.Action_IbcAction{IbcAction: &penumbraibctypes.IbcAction{ + RawAction: anyMsg, + }}, + }, nil + case *chantypes.MsgChannelCloseInit: + return &penumbratypes.Action{ + Action: &penumbratypes.Action_IbcAction{IbcAction: &penumbraibctypes.IbcAction{ + RawAction: anyMsg, + }}, + }, nil + case *chantypes.MsgChannelCloseConfirm: + return &penumbratypes.Action{ + Action: &penumbratypes.Action_IbcAction{IbcAction: &penumbraibctypes.IbcAction{ + RawAction: anyMsg, + }}, + }, nil + case *chantypes.MsgRecvPacket: + return &penumbratypes.Action{ + Action: &penumbratypes.Action_IbcAction{IbcAction: &penumbraibctypes.IbcAction{ + RawAction: anyMsg, + }}, + }, nil + case *chantypes.MsgAcknowledgement: + return &penumbratypes.Action{ + Action: &penumbratypes.Action_IbcAction{IbcAction: &penumbraibctypes.IbcAction{ + RawAction: anyMsg, + }}, + }, nil + + default: + return nil, fmt.Errorf("unknown message type: %T", msg) + } +} + +// EventAttribute is a single key-value pair, associated with an event. +type EventAttribute struct { + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + Index bool `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"` +} + +// Event allows application developers to attach additional information to +// ResponseFinalizeBlock, ResponseDeliverTx, ExecTxResult +// Later, transactions may be queried using these events. +type Event struct { + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Attributes []EventAttribute `protobuf:"bytes,2,rep,name=attributes,proto3" json:"attributes,omitempty"` +} + +// ExecTxResult contains results of executing one individual transaction. +// +// * Its structure is equivalent to #ResponseDeliverTx which will be deprecated/deleted +type ExecTxResult struct { + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` + Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` + GasWanted int64 `protobuf:"varint,5,opt,name=gas_wanted,json=gasWanted,proto3" json:"gas_wanted,omitempty"` + GasUsed int64 `protobuf:"varint,6,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` + Events []Event `protobuf:"bytes,7,rep,name=events,proto3" json:"events,omitempty"` + Codespace string `protobuf:"bytes,8,opt,name=codespace,proto3" json:"codespace,omitempty"` +} + +// Result of querying for a tx. This is from the new tendermint API. +type ResultTx struct { + Hash bytes.HexBytes `json:"hash"` + Height int64 `json:"height,string"` + Index uint32 `json:"index"` + TxResult ExecTxResult `json:"tx_result"` + Tx tmtypes.Tx `json:"tx"` + Proof tmtypes.TxProof `json:"proof,omitempty"` +} + +// ValidatorUpdate +type ValidatorUpdate struct { + PubKey tmcrypto.PublicKey `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key"` + Power int64 `protobuf:"varint,2,opt,name=power,proto3" json:"power,omitempty"` +} + +func (cc *PenumbraProvider) getAnchor(ctx context.Context) (*penumbracrypto.MerkleRoot, error) { + status, err := cc.RPCClient.Status(ctx) + if err != nil { + return nil, err + } + maxHeight := status.SyncInfo.LatestBlockHeight + + // Generate a random block height to query between 1 and maxHeight + height := rand.Int63n(maxHeight-1) + 1 + + path := fmt.Sprintf("shielded_pool/anchor/%d", height) + + req := abci.RequestQuery{ + Path: "state/key", + Height: maxHeight, + Data: []byte(path), + Prove: false, + } + + res, err := cc.QueryABCI(ctx, req) + if err != nil { + path := fmt.Sprintf("sct/anchor/%d", height) + + req := abci.RequestQuery{ + Path: "state/key", + Height: maxHeight, + Data: []byte(path), + Prove: false, + } + res, err := cc.QueryABCI(ctx, req) + if err != nil { + return nil, err + } + + return &penumbracrypto.MerkleRoot{Inner: res.Value[2:]}, nil + } + + return &penumbracrypto.MerkleRoot{Inner: res.Value[2:]}, nil +} + +func parseEventsFromABCIResponse(resp abci.ResponseDeliverTx) []provider.RelayerEvent { + var events []provider.RelayerEvent + + for _, event := range resp.Events { + attributes := make(map[string]string) + for _, attribute := range event.Attributes { + // The key and value are base64-encoded strings, so we first have to decode them: + key, err := base64.StdEncoding.DecodeString(string(attribute.Key)) + if err != nil { + continue + } + value, err := base64.StdEncoding.DecodeString(string(attribute.Value)) + if err != nil { + continue + } + attributes[string(key)] = string(value) + } + events = append(events, provider.RelayerEvent{ + EventType: event.Type, + Attributes: attributes, + }) + } + return events + +} + +func (cc *PenumbraProvider) sendMessagesInner(ctx context.Context, msgs []provider.RelayerMessage, _memo string) (*coretypes.ResultBroadcastTx, error) { + + // TODO: fee estimation, fee payments + // NOTE: we do not actually need to sign this tx currently, since there + // are no fees required on the testnet. future versions of penumbra + // will have a signing protocol for this. + + txBody := penumbratypes.TransactionBody{ + Actions: make([]*penumbratypes.Action, 0), + Fee: &penumbracrypto.Fee{Amount: &penumbracrypto.Amount{Lo: 0, Hi: 0}}, + } + + for _, msg := range PenumbraMsgs(msgs...) { + action, err := msgToPenumbraAction(msg) + if err != nil { + return nil, err + } + txBody.Actions = append(txBody.Actions, action) + } + + anchor, err := cc.getAnchor(ctx) + if err != nil { + return nil, err + } + + tx := &penumbratypes.Transaction{ + Body: &txBody, + BindingSig: make([]byte, 64), // use the Cool Signature + Anchor: anchor, + } + + cc.log.Debug("Broadcasting penumbra tx") + txBytes, err := cosmosproto.Marshal(tx) + if err != nil { + return nil, err + } + + return cc.RPCClient.BroadcastTxSync(ctx, txBytes) +} + +// SendMessages attempts to sign, encode, & send a slice of RelayerMessages +// This is used extensively in the relayer as an extension of the Provider interface +// +// NOTE: An error is returned if there was an issue sending the transaction. A successfully sent, but failed +// transaction will not return an error. If a transaction is successfully sent, the result of the execution +// of that transaction will be logged. A boolean indicating if a transaction was successfully +// sent and executed successfully is returned. +func (cc *PenumbraProvider) SendMessages(ctx context.Context, msgs []provider.RelayerMessage, _memo string) (*provider.RelayerTxResponse, bool, error) { + var events []provider.RelayerEvent + var height int64 + var data []byte + var txhash string + var code uint32 + + syncRes, err := cc.sendMessagesInner(ctx, msgs, _memo) + if err != nil { + return nil, false, err + } + cc.log.Debug("Waiting for penumbra tx to commit", zap.String("syncRes", fmt.Sprintf("%+v", syncRes))) + + if err := retry.Do(func() error { + ctx, cancel := context.WithTimeout(ctx, 40*time.Second) + defer cancel() + + res, err := cc.RPCClient.Tx(ctx, syncRes.Hash, false) + if err != nil { + return err + } + cc.log.Debug("Received penumbra tx result", zap.String("res", fmt.Sprintf("%+v", res))) + + height = res.Height + txhash = syncRes.Hash.String() + code = res.TxResult.Code + + events = append(events, parseEventsFromABCIResponse(res.TxResult)...) + return nil + }, retry.Context(ctx), rtyAtt, rtyDel, rtyErr, retry.OnRetry(func(n uint, err error) { + cc.log.Info( + "Error building or broadcasting transaction", + zap.String("chain_id", cc.PCfg.ChainID), + zap.Uint("attempt", n+1), + zap.Uint("max_attempts", rtyAttNum), + zap.Error(err), + ) + })); err != nil { + return nil, false, err + } + + rlyResp := &provider.RelayerTxResponse{ + Height: height, + TxHash: txhash, + Code: code, + Data: string(data), + Events: events, + } + + // transaction was executed, log the success or failure using the tx response code + // NOTE: error is nil, logic should use the returned error to determine if the + // transaction was successfully executed. + if rlyResp.Code != 0 { + cc.LogFailedTx(rlyResp, nil, msgs) + return rlyResp, false, fmt.Errorf("transaction failed with code: %d", code) + } + + return rlyResp, true, nil +} + +func parseEventsFromTxResponse(resp *sdk.TxResponse) []provider.RelayerEvent { + var events []provider.RelayerEvent + + if resp == nil { + return events + } + + for _, logs := range resp.Logs { + for _, event := range logs.Events { + attributes := make(map[string]string) + for _, attribute := range event.Attributes { + attributes[attribute.Key] = attribute.Value + } + events = append(events, provider.RelayerEvent{ + EventType: event.Type, + Attributes: attributes, + }) + } + } + return events +} + +// CreateClient creates an sdk.Msg to update the client on src with consensus state from dst +func (cc *PenumbraProvider) MsgCreateClient(clientState ibcexported.ClientState, consensusState ibcexported.ConsensusState) (provider.RelayerMessage, error) { + signer, err := cc.Address() + if err != nil { + return nil, err + } + + anyClientState, err := clienttypes.PackClientState(clientState) + if err != nil { + return nil, err + } + + anyConsensusState, err := clienttypes.PackConsensusState(consensusState) + if err != nil { + return nil, err + } + + msg := &clienttypes.MsgCreateClient{ + ClientState: anyClientState, + ConsensusState: anyConsensusState, + Signer: signer, + } + + return NewPenumbraMessage(msg), nil +} + +func (cc *PenumbraProvider) SubmitMisbehavior( /*TBD*/ ) (provider.RelayerMessage, error) { + return nil, nil +} + +func (cc *PenumbraProvider) MsgUpdateClient(srcClientId string, dstHeader ibcexported.ClientMessage) (provider.RelayerMessage, error) { + acc, err := cc.Address() + if err != nil { + return nil, err + } + + cosmosheader, ok := dstHeader.(*tmclient.Header) + if !ok { + panic("not cosmos header") + } + + valSet, err := tmtypes.ValidatorSetFromProto(cosmosheader.ValidatorSet) + if err != nil { + return nil, err + } + trustedValset, err := tmtypes.ValidatorSetFromProto(cosmosheader.TrustedValidators) + if err != nil { + return nil, err + } + cosmosheader.ValidatorSet.TotalVotingPower = valSet.TotalVotingPower() + cosmosheader.TrustedValidators.TotalVotingPower = trustedValset.TotalVotingPower() + + anyHeader, err := clienttypes.PackClientMessage(cosmosheader) + if err != nil { + return nil, err + } + + msg := &clienttypes.MsgUpdateClient{ + ClientId: srcClientId, + ClientMessage: anyHeader, + Signer: acc, + } + + return cosmos.NewCosmosMessage(msg), nil +} + +func (cc *PenumbraProvider) ConnectionOpenInit(srcClientId, dstClientId string, dstPrefix commitmenttypes.MerklePrefix, dstHeader ibcexported.ClientMessage) ([]provider.RelayerMessage, error) { + var ( + acc string + err error + version *conntypes.Version + ) + version = conntypes.DefaultIBCVersion + + updateMsg, err := cc.MsgUpdateClient(srcClientId, dstHeader) + if err != nil { + return nil, err + } + + if acc, err = cc.Address(); err != nil { + return nil, err + } + + counterparty := conntypes.Counterparty{ + ClientId: dstClientId, + ConnectionId: "", + Prefix: dstPrefix, + } + msg := &conntypes.MsgConnectionOpenInit{ + ClientId: srcClientId, + Counterparty: counterparty, + Version: version, + DelayPeriod: defaultDelayPeriod, + Signer: acc, + } + + return []provider.RelayerMessage{updateMsg, cosmos.NewCosmosMessage(msg)}, nil +} + +func (cc *PenumbraProvider) ConnectionOpenTry(ctx context.Context, dstQueryProvider provider.QueryProvider, dstHeader ibcexported.ClientMessage, dstPrefix commitmenttypes.MerklePrefix, srcClientId, dstClientId, srcConnId, dstConnId string) ([]provider.RelayerMessage, error) { + var ( + acc string + err error + ) + updateMsg, err := cc.MsgUpdateClient(srcClientId, dstHeader) + if err != nil { + return nil, err + } + + cph, err := dstQueryProvider.QueryLatestHeight(ctx) + if err != nil { + return nil, err + } + + clientState, clientStateProof, consensusStateProof, connStateProof, proofHeight, err := dstQueryProvider.GenerateConnHandshakeProof(ctx, cph, dstClientId, dstConnId) + if err != nil { + return nil, err + } + + if len(connStateProof) == 0 { + // It is possible that we have asked for a proof too early. + // If the connection state proof is empty, there is no point in returning the MsgConnectionOpenTry. + // We are not using (*conntypes.MsgConnectionOpenTry).ValidateBasic here because + // that chokes on cross-chain bech32 details in ibc-go. + return nil, fmt.Errorf("received invalid zero-length connection state proof") + } + + if acc, err = cc.Address(); err != nil { + return nil, err + } + + csAny, err := clienttypes.PackClientState(clientState) + if err != nil { + return nil, err + } + + counterparty := conntypes.Counterparty{ + ClientId: dstClientId, + ConnectionId: dstConnId, + Prefix: dstPrefix, + } + + // TODO: Get DelayPeriod from counterparty connection rather than using default value + msg := &conntypes.MsgConnectionOpenTry{ + ClientId: srcClientId, + PreviousConnectionId: srcConnId, + ClientState: csAny, + Counterparty: counterparty, + DelayPeriod: defaultDelayPeriod, + CounterpartyVersions: conntypes.ExportedVersionsToProto(conntypes.GetCompatibleVersions()), + ProofHeight: clienttypes.Height{ + RevisionNumber: proofHeight.GetRevisionNumber(), + RevisionHeight: proofHeight.GetRevisionHeight(), + }, + ProofInit: connStateProof, + ProofClient: clientStateProof, + ProofConsensus: consensusStateProof, + ConsensusHeight: clientState.GetLatestHeight().(clienttypes.Height), + Signer: acc, + } + + return []provider.RelayerMessage{updateMsg, cosmos.NewCosmosMessage(msg)}, nil +} + +func (cc *PenumbraProvider) ConnectionOpenAck(ctx context.Context, dstQueryProvider provider.QueryProvider, dstHeader ibcexported.ClientMessage, srcClientId, srcConnId, dstClientId, dstConnId string) ([]provider.RelayerMessage, error) { + var ( + acc string + err error + ) + + updateMsg, err := cc.MsgUpdateClient(srcClientId, dstHeader) + if err != nil { + return nil, err + } + cph, err := dstQueryProvider.QueryLatestHeight(ctx) + if err != nil { + return nil, err + } + + clientState, clientStateProof, consensusStateProof, connStateProof, + proofHeight, err := dstQueryProvider.GenerateConnHandshakeProof(ctx, cph, dstClientId, dstConnId) + if err != nil { + return nil, err + } + cc.log.Debug("ConnectionOpenAck", zap.String("updateMsg", fmt.Sprintf("%+v", updateMsg)), zap.Any("proofHeight", proofHeight)) + + if acc, err = cc.Address(); err != nil { + return nil, err + } + + csAny, err := clienttypes.PackClientState(clientState) + if err != nil { + return nil, err + } + + msg := &conntypes.MsgConnectionOpenAck{ + ConnectionId: srcConnId, + CounterpartyConnectionId: dstConnId, + Version: conntypes.DefaultIBCVersion, + ClientState: csAny, + ProofHeight: clienttypes.Height{ + RevisionNumber: proofHeight.GetRevisionNumber(), + RevisionHeight: proofHeight.GetRevisionHeight(), + }, + ProofTry: connStateProof, + ProofClient: clientStateProof, + ProofConsensus: consensusStateProof, + ConsensusHeight: clientState.GetLatestHeight().(clienttypes.Height), + Signer: acc, + } + + return []provider.RelayerMessage{updateMsg, cosmos.NewCosmosMessage(msg)}, nil +} + +func (cc *PenumbraProvider) ConnectionOpenConfirm(ctx context.Context, dstQueryProvider provider.QueryProvider, dstHeader ibcexported.ClientMessage, dstConnId, srcClientId, srcConnId string) ([]provider.RelayerMessage, error) { + var ( + acc string + err error + ) + updateMsg, err := cc.MsgUpdateClient(srcClientId, dstHeader) + if err != nil { + return nil, err + } + + cph, err := dstQueryProvider.QueryLatestHeight(ctx) + if err != nil { + return nil, err + } + counterpartyConnState, err := dstQueryProvider.QueryConnection(ctx, cph, dstConnId) + if err != nil { + return nil, err + } + + if acc, err = cc.Address(); err != nil { + return nil, err + } + + msg := &conntypes.MsgConnectionOpenConfirm{ + ConnectionId: srcConnId, + ProofAck: counterpartyConnState.Proof, + ProofHeight: counterpartyConnState.ProofHeight, + Signer: acc, + } + + return []provider.RelayerMessage{updateMsg, cosmos.NewCosmosMessage(msg)}, nil +} + +func (cc *PenumbraProvider) ChannelOpenInit(srcClientId, srcConnId, srcPortId, srcVersion, dstPortId string, order chantypes.Order, dstHeader ibcexported.ClientMessage) ([]provider.RelayerMessage, error) { + var ( + acc string + err error + ) + updateMsg, err := cc.MsgUpdateClient(srcClientId, dstHeader) + if err != nil { + return nil, err + } + + if acc, err = cc.Address(); err != nil { + return nil, err + } + + msg := &chantypes.MsgChannelOpenInit{ + PortId: srcPortId, + Channel: chantypes.Channel{ + State: chantypes.INIT, + Ordering: order, + Counterparty: chantypes.Counterparty{ + PortId: dstPortId, + ChannelId: "", + }, + ConnectionHops: []string{srcConnId}, + Version: srcVersion, + }, + Signer: acc, + } + + return []provider.RelayerMessage{updateMsg, cosmos.NewCosmosMessage(msg)}, nil +} + +func (cc *PenumbraProvider) ChannelOpenTry(ctx context.Context, dstQueryProvider provider.QueryProvider, dstHeader ibcexported.ClientMessage, srcPortId, dstPortId, srcChanId, dstChanId, srcVersion, srcConnectionId, srcClientId string) ([]provider.RelayerMessage, error) { + var ( + acc string + err error + ) + updateMsg, err := cc.MsgUpdateClient(srcClientId, dstHeader) + if err != nil { + return nil, err + } + cph, err := dstQueryProvider.QueryLatestHeight(ctx) + if err != nil { + return nil, err + } + + counterpartyChannelRes, err := dstQueryProvider.QueryChannel(ctx, cph, dstChanId, dstPortId) + if err != nil { + return nil, err + } + + if len(counterpartyChannelRes.Proof) == 0 { + // It is possible that we have asked for a proof too early. + // If the connection state proof is empty, there is no point in returning the MsgChannelOpenTry. + // We are not using (*conntypes.MsgChannelOpenTry).ValidateBasic here because + // that chokes on cross-chain bech32 details in ibc-go. + return nil, fmt.Errorf("received invalid zero-length channel state proof") + } + + if acc, err = cc.Address(); err != nil { + return nil, err + } + + msg := &chantypes.MsgChannelOpenTry{ + PortId: srcPortId, + PreviousChannelId: srcChanId, + Channel: chantypes.Channel{ + State: chantypes.TRYOPEN, + Ordering: counterpartyChannelRes.Channel.Ordering, + Counterparty: chantypes.Counterparty{ + PortId: dstPortId, + ChannelId: dstChanId, + }, + ConnectionHops: []string{srcConnectionId}, + Version: srcVersion, + }, + CounterpartyVersion: counterpartyChannelRes.Channel.Version, + ProofInit: counterpartyChannelRes.Proof, + ProofHeight: counterpartyChannelRes.ProofHeight, + Signer: acc, + } + + return []provider.RelayerMessage{updateMsg, cosmos.NewCosmosMessage(msg)}, nil +} + +func (cc *PenumbraProvider) ChannelOpenAck(ctx context.Context, dstQueryProvider provider.QueryProvider, dstHeader ibcexported.ClientMessage, srcClientId, srcPortId, srcChanId, dstChanId, dstPortId string) ([]provider.RelayerMessage, error) { + var ( + acc string + err error + ) + updateMsg, err := cc.MsgUpdateClient(srcClientId, dstHeader) + if err != nil { + return nil, err + } + + cph, err := dstQueryProvider.QueryLatestHeight(ctx) + if err != nil { + return nil, err + } + + counterpartyChannelRes, err := dstQueryProvider.QueryChannel(ctx, cph, dstChanId, dstPortId) + if err != nil { + return nil, err + } + + if acc, err = cc.Address(); err != nil { + return nil, err + } + + msg := &chantypes.MsgChannelOpenAck{ + PortId: srcPortId, + ChannelId: srcChanId, + CounterpartyChannelId: dstChanId, + CounterpartyVersion: counterpartyChannelRes.Channel.Version, + ProofTry: counterpartyChannelRes.Proof, + ProofHeight: counterpartyChannelRes.ProofHeight, + Signer: acc, + } + + return []provider.RelayerMessage{updateMsg, cosmos.NewCosmosMessage(msg)}, nil +} + +func (cc *PenumbraProvider) ChannelOpenConfirm(ctx context.Context, dstQueryProvider provider.QueryProvider, dstHeader ibcexported.ClientMessage, srcClientId, srcPortId, srcChanId, dstPortId, dstChanId string) ([]provider.RelayerMessage, error) { + var ( + acc string + err error + ) + updateMsg, err := cc.MsgUpdateClient(srcClientId, dstHeader) + if err != nil { + return nil, err + } + cph, err := dstQueryProvider.QueryLatestHeight(ctx) + if err != nil { + return nil, err + } + + counterpartyChanState, err := dstQueryProvider.QueryChannel(ctx, cph, dstChanId, dstPortId) + if err != nil { + return nil, err + } + + if acc, err = cc.Address(); err != nil { + return nil, err + } + + msg := &chantypes.MsgChannelOpenConfirm{ + PortId: srcPortId, + ChannelId: srcChanId, + ProofAck: counterpartyChanState.Proof, + ProofHeight: counterpartyChanState.ProofHeight, + Signer: acc, + } + + return []provider.RelayerMessage{updateMsg, cosmos.NewCosmosMessage(msg)}, nil +} + +func (cc *PenumbraProvider) ChannelCloseInit(srcPortId, srcChanId string) (provider.RelayerMessage, error) { + var ( + acc string + err error + ) + if acc, err = cc.Address(); err != nil { + return nil, err + } + + msg := &chantypes.MsgChannelCloseInit{ + PortId: srcPortId, + ChannelId: srcChanId, + Signer: acc, + } + + return cosmos.NewCosmosMessage(msg), nil +} + +func (cc *PenumbraProvider) ChannelCloseConfirm(ctx context.Context, dstQueryProvider provider.QueryProvider, dsth int64, dstChanId, dstPortId, srcPortId, srcChanId string) (provider.RelayerMessage, error) { + var ( + acc string + err error + ) + dstChanResp, err := dstQueryProvider.QueryChannel(ctx, dsth, dstChanId, dstPortId) + if err != nil { + return nil, err + } + + if acc, err = cc.Address(); err != nil { + return nil, err + } + + msg := &chantypes.MsgChannelCloseConfirm{ + PortId: srcPortId, + ChannelId: srcChanId, + ProofInit: dstChanResp.Proof, + ProofHeight: dstChanResp.ProofHeight, + Signer: acc, + } + + return cosmos.NewCosmosMessage(msg), nil +} + +func (cc *PenumbraProvider) MsgUpgradeClient(srcClientId string, consRes *clienttypes.QueryConsensusStateResponse, clientRes *clienttypes.QueryClientStateResponse) (provider.RelayerMessage, error) { + var ( + acc string + err error + ) + if acc, err = cc.Address(); err != nil { + return nil, err + } + return cosmos.NewCosmosMessage(&clienttypes.MsgUpgradeClient{ClientId: srcClientId, ClientState: clientRes.ClientState, + ConsensusState: consRes.ConsensusState, ProofUpgradeClient: consRes.GetProof(), + ProofUpgradeConsensusState: consRes.ConsensusState.Value, Signer: acc}), nil +} + +func (cc *PenumbraProvider) MsgSubmitMisbehaviour(clientID string, misbehaviour ibcexported.ClientMessage) (provider.RelayerMessage, error) { + signer, err := cc.Address() + if err != nil { + return nil, err + } + + msg, err := clienttypes.NewMsgSubmitMisbehaviour(clientID, misbehaviour, signer) + if err != nil { + return nil, err + } + + return NewPenumbraMessage(msg), nil +} + +// mustGetHeight takes the height inteface and returns the actual height +func mustGetHeight(h ibcexported.Height) clienttypes.Height { + height, ok := h.(clienttypes.Height) + if !ok { + panic("height is not an instance of height!") + } + return height +} + +// MsgRelayAcknowledgement constructs the MsgAcknowledgement which is to be sent to the sending chain. +// The counterparty represents the receiving chain where the acknowledgement would be stored. +func (cc *PenumbraProvider) MsgRelayAcknowledgement(ctx context.Context, dst provider.ChainProvider, dstChanId, dstPortId, srcChanId, srcPortId string, dsth int64, packet provider.RelayPacket) (provider.RelayerMessage, error) { + var ( + acc string + err error + ) + msgPacketAck, ok := packet.(*relayMsgPacketAck) + if !ok { + return nil, fmt.Errorf("got data of type %T but wanted relayMsgPacketAck", packet) + } + + if acc, err = cc.Address(); err != nil { + return nil, err + } + + ackRes, err := dst.QueryPacketAcknowledgement(ctx, dsth, dstChanId, dstPortId, packet.Seq()) + switch { + case err != nil: + return nil, err + case ackRes.Proof == nil || ackRes.Acknowledgement == nil: + return nil, fmt.Errorf("ack packet acknowledgement query seq(%d) is nil", packet.Seq()) + case ackRes == nil: + return nil, fmt.Errorf("ack packet [%s]seq{%d} has no associated proofs", dst.ChainId(), packet.Seq()) + default: + msg := &chantypes.MsgAcknowledgement{ + Packet: chantypes.Packet{ + Sequence: packet.Seq(), + SourcePort: srcPortId, + SourceChannel: srcChanId, + DestinationPort: dstPortId, + DestinationChannel: dstChanId, + Data: packet.Data(), + TimeoutHeight: packet.Timeout(), + TimeoutTimestamp: packet.TimeoutStamp(), + }, + Acknowledgement: msgPacketAck.ack, + ProofAcked: ackRes.Proof, + ProofHeight: ackRes.ProofHeight, + Signer: acc, + } + + return cosmos.NewCosmosMessage(msg), nil + } +} + +// MsgTransfer creates a new transfer message +func (cc *PenumbraProvider) MsgTransfer( + dstAddr string, + amount sdk.Coin, + info provider.PacketInfo, +) (provider.RelayerMessage, error) { + acc, err := cc.Address() + if err != nil { + return nil, err + } + msg := &transfertypes.MsgTransfer{ + SourcePort: info.SourcePort, + SourceChannel: info.SourceChannel, + Token: amount, + Sender: acc, + Receiver: dstAddr, + TimeoutTimestamp: info.TimeoutTimestamp, + } + + // If the timeoutHeight is 0 then we don't need to explicitly set it on the MsgTransfer + if info.TimeoutHeight.RevisionHeight != 0 { + msg.TimeoutHeight = info.TimeoutHeight + } + + return cosmos.NewCosmosMessage(msg), nil +} + +// MsgRelayTimeout constructs the MsgTimeout which is to be sent to the sending chain. +// The counterparty represents the receiving chain where the receipts would have been +// stored. +func (cc *PenumbraProvider) MsgRelayTimeout( + ctx context.Context, + dst provider.ChainProvider, + dsth int64, + packet provider.RelayPacket, + dstChanId, dstPortId, srcChanId, srcPortId string, + order chantypes.Order, +) (provider.RelayerMessage, error) { + var ( + acc string + err error + msg provider.RelayerMessage + ) + if acc, err = cc.Address(); err != nil { + return nil, err + } + + switch order { + case chantypes.UNORDERED: + msg, err = cc.unorderedChannelTimeoutMsg(ctx, dst, dsth, packet, acc, dstChanId, dstPortId, srcChanId, srcPortId) + if err != nil { + return nil, err + } + case chantypes.ORDERED: + msg, err = cc.orderedChannelTimeoutMsg(ctx, dst, dsth, packet, acc, dstChanId, dstPortId, srcChanId, srcPortId) + if err != nil { + return nil, err + } + default: + return nil, fmt.Errorf("invalid order type %s, order should be %s or %s", + order, chantypes.ORDERED, chantypes.UNORDERED) + } + + return msg, nil +} + +func (cc *PenumbraProvider) orderedChannelTimeoutMsg( + ctx context.Context, + dst provider.ChainProvider, + dsth int64, + packet provider.RelayPacket, + acc, dstChanId, dstPortId, srcChanId, srcPortId string, +) (provider.RelayerMessage, error) { + seqRes, err := dst.QueryNextSeqRecv(ctx, dsth, dstChanId, dstPortId) + if err != nil { + return nil, err + } + + if seqRes == nil { + return nil, fmt.Errorf("timeout packet [%s]seq{%d} has no associated proofs", cc.PCfg.ChainID, packet.Seq()) + } + + if seqRes.Proof == nil { + return nil, fmt.Errorf("timeout packet next sequence received proof seq(%d) is nil", packet.Seq()) + } + + msg := &chantypes.MsgTimeout{ + Packet: chantypes.Packet{ + Sequence: packet.Seq(), + SourcePort: srcPortId, + SourceChannel: srcChanId, + DestinationPort: dstPortId, + DestinationChannel: dstChanId, + Data: packet.Data(), + TimeoutHeight: packet.Timeout(), + TimeoutTimestamp: packet.TimeoutStamp(), + }, + ProofUnreceived: seqRes.Proof, + ProofHeight: seqRes.ProofHeight, + NextSequenceRecv: packet.Seq(), + Signer: acc, + } + + return cosmos.NewCosmosMessage(msg), nil +} + +func (cc *PenumbraProvider) unorderedChannelTimeoutMsg( + ctx context.Context, + dst provider.ChainProvider, + dsth int64, + packet provider.RelayPacket, + acc, dstChanId, dstPortId, srcChanId, srcPortId string, +) (provider.RelayerMessage, error) { + recvRes, err := dst.QueryPacketReceipt(ctx, dsth, dstChanId, dstPortId, packet.Seq()) + if err != nil { + return nil, err + } + + if recvRes == nil { + return nil, fmt.Errorf("timeout packet [%s]seq{%d} has no associated proofs", cc.PCfg.ChainID, packet.Seq()) + } + + if recvRes.Proof == nil { + return nil, fmt.Errorf("timeout packet receipt proof seq(%d) is nil", packet.Seq()) + } + + msg := &chantypes.MsgTimeout{ + Packet: chantypes.Packet{ + Sequence: packet.Seq(), + SourcePort: srcPortId, + SourceChannel: srcChanId, + DestinationPort: dstPortId, + DestinationChannel: dstChanId, + Data: packet.Data(), + TimeoutHeight: packet.Timeout(), + TimeoutTimestamp: packet.TimeoutStamp(), + }, + ProofUnreceived: recvRes.Proof, + ProofHeight: recvRes.ProofHeight, + NextSequenceRecv: packet.Seq(), + Signer: acc, + } + return cosmos.NewCosmosMessage(msg), nil +} + +// MsgRelayRecvPacket constructs the MsgRecvPacket which is to be sent to the receiving chain. +// The counterparty represents the sending chain where the packet commitment would be stored. +func (cc *PenumbraProvider) MsgRelayRecvPacket(ctx context.Context, dst provider.ChainProvider, dsth int64, packet provider.RelayPacket, dstChanId, dstPortId, srcChanId, srcPortId string) (provider.RelayerMessage, error) { + var ( + acc string + err error + ) + if acc, err = cc.Address(); err != nil { + return nil, err + } + + comRes, err := dst.QueryPacketCommitment(ctx, dsth, dstChanId, dstPortId, packet.Seq()) + switch { + case err != nil: + return nil, err + case comRes.Proof == nil || comRes.Commitment == nil: + return nil, fmt.Errorf("recv packet commitment query seq(%d) is nil", packet.Seq()) + case comRes == nil: + return nil, fmt.Errorf("receive packet [%s]seq{%d} has no associated proofs", cc.PCfg.ChainID, packet.Seq()) + default: + msg := &chantypes.MsgRecvPacket{ + Packet: chantypes.Packet{ + Sequence: packet.Seq(), + SourcePort: dstPortId, + SourceChannel: dstChanId, + DestinationPort: srcPortId, + DestinationChannel: srcChanId, + Data: packet.Data(), + TimeoutHeight: packet.Timeout(), + TimeoutTimestamp: packet.TimeoutStamp(), + }, + ProofCommitment: comRes.Proof, + ProofHeight: comRes.ProofHeight, + Signer: acc, + } + + return cosmos.NewCosmosMessage(msg), nil + } +} + +func (cc *PenumbraProvider) ValidatePacket(msgTransfer provider.PacketInfo, latest provider.LatestBlock) error { + if msgTransfer.Sequence == 0 { + return errors.New("refusing to relay packet with sequence: 0") + } + + if len(msgTransfer.Data) == 0 { + return errors.New("refusing to relay packet with empty data") + } + + // This should not be possible, as it violates IBC spec + if msgTransfer.TimeoutHeight.IsZero() && msgTransfer.TimeoutTimestamp == 0 { + return errors.New("refusing to relay packet without a timeout (height or timestamp must be set)") + } + + revision := clienttypes.ParseChainID(cc.PCfg.ChainID) + latestClientTypesHeight := clienttypes.NewHeight(revision, latest.Height) + if !msgTransfer.TimeoutHeight.IsZero() && latestClientTypesHeight.GTE(msgTransfer.TimeoutHeight) { + return provider.NewTimeoutHeightError(latest.Height, msgTransfer.TimeoutHeight.RevisionHeight) + } + latestTimestamp := uint64(latest.Time.UnixNano()) + if msgTransfer.TimeoutTimestamp > 0 && latestTimestamp > msgTransfer.TimeoutTimestamp { + return provider.NewTimeoutTimestampError(latestTimestamp, msgTransfer.TimeoutTimestamp) + } + + return nil +} + +func (cc *PenumbraProvider) PacketCommitment(ctx context.Context, msgTransfer provider.PacketInfo, height uint64) (provider.PacketProof, error) { + key := host.PacketCommitmentKey(msgTransfer.SourcePort, msgTransfer.SourceChannel, msgTransfer.Sequence) + _, proof, proofHeight, err := cc.QueryTendermintProof(ctx, int64(height), key) + if err != nil { + return provider.PacketProof{}, fmt.Errorf("error querying tendermint proof for packet commitment: %w", err) + } + return provider.PacketProof{ + Proof: proof, + ProofHeight: proofHeight, + }, nil +} + +func (cc *PenumbraProvider) MsgRecvPacket(msgTransfer provider.PacketInfo, proof provider.PacketProof) (provider.RelayerMessage, error) { + signer, err := cc.Address() + if err != nil { + return nil, err + } + msg := &chantypes.MsgRecvPacket{ + Packet: toPenumbraPacket(msgTransfer), + ProofCommitment: proof.Proof, + ProofHeight: proof.ProofHeight, + Signer: signer, + } + + return cosmos.NewCosmosMessage(msg), nil +} + +func (cc *PenumbraProvider) PacketAcknowledgement(ctx context.Context, msgRecvPacket provider.PacketInfo, height uint64) (provider.PacketProof, error) { + key := host.PacketAcknowledgementKey(msgRecvPacket.DestPort, msgRecvPacket.DestChannel, msgRecvPacket.Sequence) + _, proof, proofHeight, err := cc.QueryTendermintProof(ctx, int64(height), key) + if err != nil { + return provider.PacketProof{}, fmt.Errorf("error querying tendermint proof for packet acknowledgement: %w", err) + } + return provider.PacketProof{ + Proof: proof, + ProofHeight: proofHeight, + }, nil +} + +func (cc *PenumbraProvider) MsgAcknowledgement(msgRecvPacket provider.PacketInfo, proof provider.PacketProof) (provider.RelayerMessage, error) { + signer, err := cc.Address() + if err != nil { + return nil, err + } + msg := &chantypes.MsgAcknowledgement{ + Packet: toPenumbraPacket(msgRecvPacket), + Acknowledgement: msgRecvPacket.Ack, + ProofAcked: proof.Proof, + ProofHeight: proof.ProofHeight, + Signer: signer, + } + + return cosmos.NewCosmosMessage(msg), nil +} + +func (cc *PenumbraProvider) PacketReceipt(ctx context.Context, msgTransfer provider.PacketInfo, height uint64) (provider.PacketProof, error) { + key := host.PacketReceiptKey(msgTransfer.DestPort, msgTransfer.DestChannel, msgTransfer.Sequence) + _, proof, proofHeight, err := cc.QueryTendermintProof(ctx, int64(height), key) + if err != nil { + return provider.PacketProof{}, fmt.Errorf("error querying tendermint proof for packet receipt: %w", err) + } + + return provider.PacketProof{ + Proof: proof, + ProofHeight: proofHeight, + }, nil +} + +func (cc *PenumbraProvider) MsgTimeout(msgTransfer provider.PacketInfo, proof provider.PacketProof) (provider.RelayerMessage, error) { + signer, err := cc.Address() + if err != nil { + return nil, err + } + assembled := &chantypes.MsgTimeout{ + Packet: toPenumbraPacket(msgTransfer), + ProofUnreceived: proof.Proof, + ProofHeight: proof.ProofHeight, + NextSequenceRecv: msgTransfer.Sequence, + Signer: signer, + } + + return cosmos.NewCosmosMessage(assembled), nil +} + +func (cc *PenumbraProvider) MsgTimeoutOnClose(msgTransfer provider.PacketInfo, proof provider.PacketProof) (provider.RelayerMessage, error) { + signer, err := cc.Address() + if err != nil { + return nil, err + } + assembled := &chantypes.MsgTimeoutOnClose{ + Packet: toPenumbraPacket(msgTransfer), + ProofUnreceived: proof.Proof, + ProofHeight: proof.ProofHeight, + NextSequenceRecv: msgTransfer.Sequence, + Signer: signer, + } + + return cosmos.NewCosmosMessage(assembled), nil +} + +func (cc *PenumbraProvider) MsgConnectionOpenInit(info provider.ConnectionInfo, proof provider.ConnectionProof) (provider.RelayerMessage, error) { + signer, err := cc.Address() + if err != nil { + return nil, err + } + msg := &conntypes.MsgConnectionOpenInit{ + ClientId: info.ClientID, + Counterparty: conntypes.Counterparty{ + ClientId: info.CounterpartyClientID, + ConnectionId: "", + Prefix: info.CounterpartyCommitmentPrefix, + }, + Version: conntypes.DefaultIBCVersion, + DelayPeriod: defaultDelayPeriod, + Signer: signer, + } + + return cosmos.NewCosmosMessage(msg), nil +} + +func (cc *PenumbraProvider) ConnectionHandshakeProof(ctx context.Context, msgOpenInit provider.ConnectionInfo, height uint64) (provider.ConnectionProof, error) { + clientState, clientStateProof, consensusStateProof, connStateProof, proofHeight, err := cc.GenerateConnHandshakeProof(ctx, int64(height), msgOpenInit.ClientID, msgOpenInit.ConnID) + if err != nil { + return provider.ConnectionProof{}, err + } + + if len(connStateProof) == 0 { + // It is possible that we have asked for a proof too early. + // If the connection state proof is empty, there is no point in returning the next message. + // We are not using (*conntypes.MsgConnectionOpenTry).ValidateBasic here because + // that chokes on cross-chain bech32 details in ibc-go. + return provider.ConnectionProof{}, fmt.Errorf("received invalid zero-length connection state proof") + } + + return provider.ConnectionProof{ + ClientState: clientState, + ClientStateProof: clientStateProof, + ConsensusStateProof: consensusStateProof, + ConnectionStateProof: connStateProof, + ProofHeight: proofHeight.(clienttypes.Height), + }, nil +} + +func (cc *PenumbraProvider) MsgConnectionOpenTry(msgOpenInit provider.ConnectionInfo, proof provider.ConnectionProof) (provider.RelayerMessage, error) { + signer, err := cc.Address() + if err != nil { + return nil, err + } + + csAny, err := clienttypes.PackClientState(proof.ClientState) + if err != nil { + return nil, err + } + + counterparty := conntypes.Counterparty{ + ClientId: msgOpenInit.ClientID, + ConnectionId: msgOpenInit.ConnID, + Prefix: msgOpenInit.CounterpartyCommitmentPrefix, + } + + msg := &conntypes.MsgConnectionOpenTry{ + ClientId: msgOpenInit.CounterpartyClientID, + PreviousConnectionId: msgOpenInit.CounterpartyConnID, + ClientState: csAny, + Counterparty: counterparty, + DelayPeriod: defaultDelayPeriod, + CounterpartyVersions: conntypes.ExportedVersionsToProto(conntypes.GetCompatibleVersions()), + ProofHeight: proof.ProofHeight, + ProofInit: proof.ConnectionStateProof, + ProofClient: proof.ClientStateProof, + ProofConsensus: proof.ConsensusStateProof, + ConsensusHeight: proof.ClientState.GetLatestHeight().(clienttypes.Height), + Signer: signer, + } + + return cosmos.NewCosmosMessage(msg), nil +} + +func (cc *PenumbraProvider) MsgConnectionOpenAck(msgOpenTry provider.ConnectionInfo, proof provider.ConnectionProof) (provider.RelayerMessage, error) { + signer, err := cc.Address() + if err != nil { + return nil, err + } + + csAny, err := clienttypes.PackClientState(proof.ClientState) + if err != nil { + return nil, err + } + + msg := &conntypes.MsgConnectionOpenAck{ + ConnectionId: msgOpenTry.CounterpartyConnID, + CounterpartyConnectionId: msgOpenTry.ConnID, + Version: conntypes.DefaultIBCVersion, + ClientState: csAny, + ProofHeight: clienttypes.Height{ + RevisionNumber: proof.ProofHeight.GetRevisionNumber(), + RevisionHeight: proof.ProofHeight.GetRevisionHeight(), + }, + ProofTry: proof.ConnectionStateProof, + ProofClient: proof.ClientStateProof, + ProofConsensus: proof.ConsensusStateProof, + ConsensusHeight: proof.ClientState.GetLatestHeight().(clienttypes.Height), + Signer: signer, + } + + return cosmos.NewCosmosMessage(msg), nil +} + +// NextSeqRecv queries for the appropriate Tendermint proof required to prove the next expected packet sequence number +// for a given counterparty channel. This is used in ORDERED channels to ensure packets are being delivered in the +// exact same order as they were sent over the wire. +func (cc *PenumbraProvider) NextSeqRecv( + ctx context.Context, + msgTransfer provider.PacketInfo, + height uint64, +) (provider.PacketProof, error) { + key := host.NextSequenceRecvKey(msgTransfer.DestPort, msgTransfer.DestChannel) + _, proof, proofHeight, err := cc.QueryTendermintProof(ctx, int64(height), key) + if err != nil { + return provider.PacketProof{}, fmt.Errorf("error querying tendermint proof for next sequence receive: %w", err) + } + + return provider.PacketProof{ + Proof: proof, + ProofHeight: proofHeight, + }, nil +} + +func (cc *PenumbraProvider) ConnectionProof(ctx context.Context, msgOpenAck provider.ConnectionInfo, height uint64) (provider.ConnectionProof, error) { + connState, err := cc.QueryConnection(ctx, int64(height), msgOpenAck.ConnID) + if err != nil { + return provider.ConnectionProof{}, err + } + + return provider.ConnectionProof{ + ConnectionStateProof: connState.Proof, + ProofHeight: connState.ProofHeight, + }, nil +} + +func (cc *PenumbraProvider) MsgConnectionOpenConfirm(msgOpenAck provider.ConnectionInfo, proof provider.ConnectionProof) (provider.RelayerMessage, error) { + signer, err := cc.Address() + if err != nil { + return nil, err + } + msg := &conntypes.MsgConnectionOpenConfirm{ + ConnectionId: msgOpenAck.CounterpartyConnID, + ProofAck: proof.ConnectionStateProof, + ProofHeight: proof.ProofHeight, + Signer: signer, + } + + return cosmos.NewCosmosMessage(msg), nil +} + +func (cc *PenumbraProvider) MsgChannelOpenInit(info provider.ChannelInfo, proof provider.ChannelProof) (provider.RelayerMessage, error) { + signer, err := cc.Address() + if err != nil { + return nil, err + } + msg := &chantypes.MsgChannelOpenInit{ + PortId: info.PortID, + Channel: chantypes.Channel{ + State: chantypes.INIT, + Ordering: info.Order, + Counterparty: chantypes.Counterparty{ + PortId: info.CounterpartyPortID, + ChannelId: "", + }, + ConnectionHops: []string{info.ConnID}, + Version: info.Version, + }, + Signer: signer, + } + + return cosmos.NewCosmosMessage(msg), nil +} + +func (cc *PenumbraProvider) ChannelProof(ctx context.Context, msg provider.ChannelInfo, height uint64) (provider.ChannelProof, error) { + channelRes, err := cc.QueryChannel(ctx, int64(height), msg.ChannelID, msg.PortID) + if err != nil { + return provider.ChannelProof{}, err + } + return provider.ChannelProof{ + Proof: channelRes.Proof, + ProofHeight: channelRes.ProofHeight, + Version: channelRes.Channel.Version, + Ordering: channelRes.Channel.Ordering, + }, nil +} + +func (cc *PenumbraProvider) MsgChannelOpenTry(msgOpenInit provider.ChannelInfo, proof provider.ChannelProof) (provider.RelayerMessage, error) { + signer, err := cc.Address() + if err != nil { + return nil, err + } + msg := &chantypes.MsgChannelOpenTry{ + PortId: msgOpenInit.CounterpartyPortID, + PreviousChannelId: msgOpenInit.CounterpartyChannelID, + Channel: chantypes.Channel{ + State: chantypes.TRYOPEN, + Ordering: proof.Ordering, + Counterparty: chantypes.Counterparty{ + PortId: msgOpenInit.PortID, + ChannelId: msgOpenInit.ChannelID, + }, + ConnectionHops: []string{msgOpenInit.CounterpartyConnID}, + // In the future, may need to separate this from the CounterpartyVersion. + // https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#definitions + // Using same version as counterparty for now. + Version: proof.Version, + }, + CounterpartyVersion: proof.Version, + ProofInit: proof.Proof, + ProofHeight: proof.ProofHeight, + Signer: signer, + } + + return cosmos.NewCosmosMessage(msg), nil +} + +func (cc *PenumbraProvider) MsgChannelOpenAck(msgOpenTry provider.ChannelInfo, proof provider.ChannelProof) (provider.RelayerMessage, error) { + signer, err := cc.Address() + if err != nil { + return nil, err + } + msg := &chantypes.MsgChannelOpenAck{ + PortId: msgOpenTry.CounterpartyPortID, + ChannelId: msgOpenTry.CounterpartyChannelID, + CounterpartyChannelId: msgOpenTry.ChannelID, + CounterpartyVersion: proof.Version, + ProofTry: proof.Proof, + ProofHeight: proof.ProofHeight, + Signer: signer, + } + + return cosmos.NewCosmosMessage(msg), nil +} + +func (cc *PenumbraProvider) MsgChannelOpenConfirm(msgOpenAck provider.ChannelInfo, proof provider.ChannelProof) (provider.RelayerMessage, error) { + signer, err := cc.Address() + if err != nil { + return nil, err + } + msg := &chantypes.MsgChannelOpenConfirm{ + PortId: msgOpenAck.CounterpartyPortID, + ChannelId: msgOpenAck.CounterpartyChannelID, + ProofAck: proof.Proof, + ProofHeight: proof.ProofHeight, + Signer: signer, + } + + return cosmos.NewCosmosMessage(msg), nil +} + +func (cc *PenumbraProvider) MsgChannelCloseInit(info provider.ChannelInfo, proof provider.ChannelProof) (provider.RelayerMessage, error) { + signer, err := cc.Address() + if err != nil { + return nil, err + } + msg := &chantypes.MsgChannelCloseInit{ + PortId: info.PortID, + ChannelId: info.ChannelID, + Signer: signer, + } + + return cosmos.NewCosmosMessage(msg), nil +} + +func (cc *PenumbraProvider) MsgChannelCloseConfirm(msgCloseInit provider.ChannelInfo, proof provider.ChannelProof) (provider.RelayerMessage, error) { + signer, err := cc.Address() + if err != nil { + return nil, err + } + msg := &chantypes.MsgChannelCloseConfirm{ + PortId: msgCloseInit.CounterpartyPortID, + ChannelId: msgCloseInit.CounterpartyChannelID, + ProofInit: proof.Proof, + ProofHeight: proof.ProofHeight, + Signer: signer, + } + + return cosmos.NewCosmosMessage(msg), nil +} + +func (cc *PenumbraProvider) MsgUpdateClientHeader(latestHeader provider.IBCHeader, trustedHeight clienttypes.Height, trustedHeader provider.IBCHeader) (ibcexported.ClientMessage, error) { + trustedCosmosHeader, ok := trustedHeader.(PenumbraIBCHeader) + if !ok { + return nil, fmt.Errorf("unsupported IBC trusted header type, expected: PenumbraIBCHeader, actual: %T", trustedHeader) + } + + latestCosmosHeader, ok := latestHeader.(PenumbraIBCHeader) + if !ok { + return nil, fmt.Errorf("unsupported IBC header type, expected: PenumbraIBCHeader, actual: %T", latestHeader) + } + + trustedValidatorsProto, err := trustedCosmosHeader.ValidatorSet.ToProto() + if err != nil { + return nil, fmt.Errorf("error converting trusted validators to proto object: %w", err) + } + + signedHeaderProto := latestCosmosHeader.SignedHeader.ToProto() + + validatorSetProto, err := latestCosmosHeader.ValidatorSet.ToProto() + if err != nil { + return nil, fmt.Errorf("error converting validator set to proto object: %w", err) + } + + return &tmclient.Header{ + SignedHeader: signedHeaderProto, + ValidatorSet: validatorSetProto, + TrustedValidators: trustedValidatorsProto, + TrustedHeight: trustedHeight, + }, nil +} + +// RelayPacketFromSequence relays a packet with a given seq on src and returns recvPacket msgs, timeoutPacketmsgs and error +func (cc *PenumbraProvider) RelayPacketFromSequence( + ctx context.Context, + src provider.ChainProvider, + srch, dsth, seq uint64, + srcChanID, srcPortID string, + order chantypes.Order, +) (provider.RelayerMessage, provider.RelayerMessage, error) { + msgTransfer, err := src.QuerySendPacket(ctx, srcChanID, srcPortID, seq) + if err != nil { + return nil, nil, err + } + + dstTime, err := cc.BlockTime(ctx, int64(dsth)) + if err != nil { + return nil, nil, err + } + + if err := cc.ValidatePacket(msgTransfer, provider.LatestBlock{ + Height: dsth, + Time: dstTime, + }); err != nil { + switch err.(type) { + case *provider.TimeoutHeightError, *provider.TimeoutTimestampError, *provider.TimeoutOnCloseError: + var pp provider.PacketProof + switch order { + case chantypes.UNORDERED: + pp, err = cc.PacketReceipt(ctx, msgTransfer, dsth) + if err != nil { + return nil, nil, err + } + case chantypes.ORDERED: + pp, err = cc.NextSeqRecv(ctx, msgTransfer, dsth) + if err != nil { + return nil, nil, err + } + } + if _, ok := err.(*provider.TimeoutOnCloseError); ok { + timeout, err := src.MsgTimeoutOnClose(msgTransfer, pp) + if err != nil { + return nil, nil, err + } + return nil, timeout, nil + } else { + timeout, err := src.MsgTimeout(msgTransfer, pp) + if err != nil { + return nil, nil, err + } + return nil, timeout, nil + } + default: + return nil, nil, err + } + } + + pp, err := src.PacketCommitment(ctx, msgTransfer, srch) + if err != nil { + return nil, nil, err + } + + packet, err := cc.MsgRecvPacket(msgTransfer, pp) + if err != nil { + return nil, nil, err + } + + return packet, nil, nil +} + +// AcknowledgementFromSequence relays an acknowledgement with a given seq on src, source is the sending chain, destination is the receiving chain +func (cc *PenumbraProvider) AcknowledgementFromSequence(ctx context.Context, dst provider.ChainProvider, dsth, seq uint64, dstChanId, dstPortId, srcChanId, srcPortId string) (provider.RelayerMessage, error) { + txs, err := dst.QueryTxs(ctx, 1, 1000, ackPacketQuery(dstChanId, int(seq))) + switch { + case err != nil: + return nil, err + case len(txs) == 0: + return nil, fmt.Errorf("no transactions returned with query") + case len(txs) > 1: + return nil, fmt.Errorf("more than one transaction returned with query") + } + + acks, err := cc.acknowledgementsFromResultTx(dstChanId, dstPortId, srcChanId, srcPortId, txs[0]) + switch { + case err != nil: + return nil, err + case len(acks) == 0: + return nil, fmt.Errorf("no ack msgs created from query response") + } + + var out provider.RelayerMessage + for _, ack := range acks { + if seq != ack.Seq() { + continue + } + msg, err := cc.MsgRelayAcknowledgement(ctx, dst, dstChanId, dstPortId, srcChanId, srcPortId, int64(dsth), ack) + if err != nil { + return nil, err + } + out = msg + } + return out, nil +} + +func rcvPacketQuery(channelID string, seq int) []string { + return []string{fmt.Sprintf("%s.packet_src_channel='%s'", spTag, channelID), + fmt.Sprintf("%s.packet_sequence='%d'", spTag, seq)} +} + +func ackPacketQuery(channelID string, seq int) []string { + return []string{fmt.Sprintf("%s.packet_dst_channel='%s'", waTag, channelID), + fmt.Sprintf("%s.packet_sequence='%d'", waTag, seq)} +} + +// acknowledgementsFromResultTx looks through the events in a *ctypes.ResultTx and returns +// relayPackets with the appropriate data +func (cc *PenumbraProvider) acknowledgementsFromResultTx(dstChanId, dstPortId, srcChanId, srcPortId string, resp *provider.RelayerTxResponse) ([]provider.RelayPacket, error) { + var ackPackets []provider.RelayPacket + +EventLoop: + for _, event := range resp.Events { + rp := &relayMsgPacketAck{} + + if event.EventType != waTag { + continue + } + + for attributeKey, attributeValue := range event.Attributes { + + switch attributeKey { + case srcChanTag: + if attributeValue != srcChanId { + continue EventLoop + } + case dstChanTag: + if attributeValue != dstChanId { + continue EventLoop + } + case srcPortTag: + if attributeValue != srcPortId { + continue EventLoop + } + case dstPortTag: + if attributeValue != dstPortId { + continue EventLoop + } + case ackTag: + rp.ack = []byte(attributeValue) + case dataTag: + rp.packetData = []byte(attributeValue) + case toHeightTag: + timeout, err := clienttypes.ParseHeight(attributeValue) + if err != nil { + cc.log.Warn("error parsing height timeout", + zap.String("chain_id", cc.ChainId()), + zap.Uint64("sequence", rp.seq), + zap.Error(err), + ) + continue EventLoop + } + rp.timeout = timeout + case toTSTag: + timeout, err := strconv.ParseUint(attributeValue, 10, 64) + if err != nil { + cc.log.Warn("error parsing timestamp timeout", + zap.String("chain_id", cc.ChainId()), + zap.Uint64("sequence", rp.seq), + zap.Error(err), + ) + continue EventLoop + } + rp.timeoutStamp = timeout + case seqTag: + seq, err := strconv.ParseUint(attributeValue, 10, 64) + if err != nil { + cc.log.Warn("error parsing packet sequence", + zap.String("chain_id", cc.ChainId()), + zap.Error(err), + ) + continue EventLoop + } + rp.seq = seq + } + } + + // If packet data is nil or sequence number is 0 keep parsing events, + // also check that at least the block height or timestamp is set. + if rp.ack == nil || rp.packetData == nil || rp.seq == 0 || (rp.timeout.IsZero() && rp.timeoutStamp == 0) { + continue + } + + ackPackets = append(ackPackets, rp) + + } + + // If there is a relayPacket, return it + if len(ackPackets) > 0 { + return ackPackets, nil + } + + return nil, fmt.Errorf("no packet data found") +} + +// GetIBCUpdateHeader updates the off chain tendermint light client and +// returns an IBC Update Header which can be used to update an on chain +// light client on the destination chain. The source is used to construct +// the header data. +func (cc *PenumbraProvider) GetIBCUpdateHeader(ctx context.Context, srch int64, dst provider.ChainProvider, dstClientId string) (ibcexported.ClientMessage, error) { + // Construct header data from light client representing source. + h, err := cc.GetLightSignedHeaderAtHeight(ctx, srch) + if err != nil { + return nil, err + } + + // Inject trusted fields based on previous header data from source + return cc.InjectTrustedFields(ctx, h, dst, dstClientId) +} + +func (cc *PenumbraProvider) IBCHeaderAtHeight(ctx context.Context, h int64) (provider.IBCHeader, error) { + if h == 0 { + return nil, fmt.Errorf("height cannot be 0") + } + + lightBlock, err := cc.LightProvider.LightBlock(ctx, h) + if err != nil { + return nil, err + } + + return PenumbraIBCHeader{ + SignedHeader: lightBlock.SignedHeader, + ValidatorSet: lightBlock.ValidatorSet, + }, nil +} + +func (cc *PenumbraProvider) GetLightSignedHeaderAtHeight(ctx context.Context, h int64) (ibcexported.ClientMessage, error) { + if h == 0 { + return nil, fmt.Errorf("height cannot be 0") + } + + lightBlock, err := cc.LightProvider.LightBlock(ctx, h) + if err != nil { + return nil, err + } + + protoVal, err := tmtypes.NewValidatorSet(lightBlock.ValidatorSet.Validators).ToProto() + if err != nil { + return nil, err + } + + return &tmclient.Header{ + SignedHeader: lightBlock.SignedHeader.ToProto(), + ValidatorSet: protoVal, + }, nil +} + +// InjectTrustedFields injects the necessary trusted fields for a header to update a light +// client stored on the destination chain, using the information provided by the source +// chain. +// TrustedHeight is the latest height of the IBC client on dst +// TrustedValidators is the validator set of srcChain at the TrustedHeight +// InjectTrustedFields returns a copy of the header with TrustedFields modified +func (cc *PenumbraProvider) InjectTrustedFields(ctx context.Context, header ibcexported.ClientMessage, dst provider.ChainProvider, dstClientId string) (ibcexported.ClientMessage, error) { + // make copy of header stored in mop + h, ok := header.(*tmclient.Header) + if !ok { + return nil, fmt.Errorf("trying to inject fields into non-tendermint headers") + } + + // retrieve dst client from src chain + // this is the client that will be updated + cs, err := dst.QueryClientState(ctx, int64(h.TrustedHeight.RevisionHeight), dstClientId) + if err != nil { + return nil, err + } + + // inject TrustedHeight as latest height stored on dst client + h.TrustedHeight = cs.GetLatestHeight().(clienttypes.Height) + + // NOTE: We need to get validators from the source chain at height: trustedHeight+1 + // since the last trusted validators for a header at height h is the NextValidators + // at h+1 committed to in header h by NextValidatorsHash + + // TODO: this is likely a source of off by 1 errors but may be impossible to change? Maybe this is the + // place where we need to fix the upstream query proof issue? + var trustedHeader *tmclient.Header + if err := retry.Do(func() error { + tmpHeader, err := cc.GetLightSignedHeaderAtHeight(ctx, int64(h.TrustedHeight.RevisionHeight+1)) + if err != nil { + return err + } + + th, ok := tmpHeader.(*tmclient.Header) + if !ok { + err = fmt.Errorf("non-tm client header") + } + + trustedHeader = th + return err + }, retry.Context(ctx), rtyAtt, rtyDel, rtyErr); err != nil { + return nil, fmt.Errorf( + "failed to get trusted header, please ensure header at the height %d has not been pruned by the connected node: %w", + h.TrustedHeight.RevisionHeight, err, + ) + } + + // inject TrustedValidators into header + h.TrustedValidators = trustedHeader.ValidatorSet + return h, nil +} + +// queryTMClientState retrieves the latest consensus state for a client in state at a given height +// and unpacks/cast it to tendermint clientstate +func (cc *PenumbraProvider) queryTMClientState(ctx context.Context, srch int64, srcClientId string) (*tmclient.ClientState, error) { + clientStateRes, err := cc.QueryClientStateResponse(ctx, srch, srcClientId) + if err != nil { + return &tmclient.ClientState{}, err + } + + return castClientStateToTMType(clientStateRes.ClientState) +} + +// castClientStateToTMType casts client state to tendermint type +func castClientStateToTMType(cs *codectypes.Any) (*tmclient.ClientState, error) { + clientStateExported, err := clienttypes.UnpackClientState(cs) + if err != nil { + return &tmclient.ClientState{}, err + } + + // cast from interface to concrete type + clientState, ok := clientStateExported.(*tmclient.ClientState) + if !ok { + return &tmclient.ClientState{}, + fmt.Errorf("error when casting exported clientstate to tendermint type") + } + + return clientState, nil +} + +// DefaultUpgradePath is the default IBC upgrade path set for an on-chain light client +var defaultUpgradePath = []string{"upgrade", "upgradedIBCState"} + +var JmtSpec = &ics23.ProofSpec{ + LeafSpec: &ics23.LeafOp{ + Hash: ics23.HashOp_SHA256, + PrehashKey: ics23.HashOp_SHA256, + PrehashValue: ics23.HashOp_SHA256, + Length: ics23.LengthOp_NO_PREFIX, + Prefix: []byte("JMT::LeafNode"), + }, + InnerSpec: &ics23.InnerSpec{ + Hash: ics23.HashOp_SHA256, + ChildOrder: []int32{0, 1}, + MinPrefixLength: 16, + MaxPrefixLength: 48, + ChildSize: 32, + EmptyChild: nil, + }, + MinDepth: 0, + MaxDepth: 64, +} + +var ApphashSpec = &ics23.ProofSpec{ + LeafSpec: &ics23.LeafOp{ + Prefix: nil, + Hash: ics23.HashOp_SHA256, + Length: ics23.LengthOp_NO_PREFIX, + PrehashKey: ics23.HashOp_NO_HASH, + PrehashValue: ics23.HashOp_NO_HASH, + }, + InnerSpec: &ics23.InnerSpec{ + Hash: ics23.HashOp_SHA256, + MaxPrefixLength: 0, + MinPrefixLength: 0, + ChildOrder: []int32{0, 1}, + ChildSize: 32, + EmptyChild: nil, + }, + MinDepth: 0, + MaxDepth: 1, +} + +var PenumbraProofSpecs = []*ics23.ProofSpec{JmtSpec, ApphashSpec} + +// NewClientState creates a new tendermint client state tracking the dst chain. +func (cc *PenumbraProvider) NewClientState( + dstChainID string, + dstUpdateHeader provider.IBCHeader, + dstTrustingPeriod, + dstUbdPeriod time.Duration, + allowUpdateAfterExpiry, + allowUpdateAfterMisbehaviour bool, +) (ibcexported.ClientState, error) { + revisionNumber := clienttypes.ParseChainID(dstChainID) + + // Create the ClientState we want on 'c' tracking 'dst' + return &tmclient.ClientState{ + ChainId: dstChainID, + TrustLevel: tmclient.NewFractionFromTm(light.DefaultTrustLevel), + TrustingPeriod: dstTrustingPeriod, + UnbondingPeriod: dstUbdPeriod, + MaxClockDrift: time.Minute * 10, + FrozenHeight: clienttypes.ZeroHeight(), + LatestHeight: clienttypes.Height{ + RevisionNumber: revisionNumber, + RevisionHeight: dstUpdateHeader.Height(), + }, + ProofSpecs: PenumbraProofSpecs, + UpgradePath: defaultUpgradePath, + AllowUpdateAfterExpiry: allowUpdateAfterExpiry, + AllowUpdateAfterMisbehaviour: allowUpdateAfterMisbehaviour, + }, nil +} + +// QueryIBCHeader returns the IBC compatible block header (CosmosIBCHeader) at a specific height. +func (cc *PenumbraProvider) QueryIBCHeader(ctx context.Context, h int64) (provider.IBCHeader, error) { + if h == 0 { + return nil, fmt.Errorf("height cannot be 0") + } + + lightBlock, err := cc.LightProvider.LightBlock(ctx, h) + if err != nil { + return nil, err + } + + return PenumbraIBCHeader{ + SignedHeader: lightBlock.SignedHeader, + ValidatorSet: lightBlock.ValidatorSet, + }, nil +} + +// QueryABCI performs an ABCI query and returns the appropriate response and error sdk error code. +func (cc *PenumbraProvider) QueryABCI(ctx context.Context, req abci.RequestQuery) (abci.ResponseQuery, error) { + opts := rpcclient.ABCIQueryOptions{ + Height: req.Height, + Prove: req.Prove, + } + result, err := cc.RPCClient.ABCIQueryWithOptions(ctx, req.Path, req.Data, opts) + if err != nil { + return abci.ResponseQuery{}, err + } + + if !result.Response.IsOK() { + return abci.ResponseQuery{}, sdkErrorToGRPCError(result.Response) + } + + // data from trusted node or subspace query doesn't need verification + if !opts.Prove || !isQueryStoreWithProof(req.Path) { + return result.Response, nil + } + + return result.Response, nil +} + +func sdkErrorToGRPCError(resp abci.ResponseQuery) error { + switch resp.Code { + case sdkerrors.ErrInvalidRequest.ABCICode(): + return status.Error(codes.InvalidArgument, resp.Log) + case sdkerrors.ErrUnauthorized.ABCICode(): + return status.Error(codes.Unauthenticated, resp.Log) + case sdkerrors.ErrKeyNotFound.ABCICode(): + return status.Error(codes.NotFound, resp.Log) + default: + return status.Error(codes.Unknown, resp.Log) + } +} + +// isQueryStoreWithProof expects a format like /// +// queryType must be "store" and subpath must be "key" to require a proof. +func isQueryStoreWithProof(path string) bool { + if !strings.HasPrefix(path, "/") { + return false + } + + paths := strings.SplitN(path[1:], "/", 3) + + switch { + case len(paths) != 3: + return false + case paths[0] != "store": + return false + case rootmulti.RequireProof("/" + paths[2]): + return true + } + + return false +} + +// sdkError will return the Cosmos SDK registered error for a given codespace/code combo if registered, otherwise nil. +func (cc *PenumbraProvider) sdkError(codespace string, code uint32) error { + // ABCIError will return an error other than "unknown" if syncRes.Code is a registered error in syncRes.Codespace + // This catches all of the sdk errors https://github.com/cosmos/cosmos-sdk/blob/f10f5e5974d2ecbf9efc05bc0bfe1c99fdeed4b6/types/errors/errors.go + err := errors.Unwrap(sdkerrors.ABCIError(codespace, code, "error broadcasting transaction")) + if err.Error() != errUnknown { + return err + } + return nil +} + +// broadcastTx broadcasts a transaction with the given raw bytes and then, in an async goroutine, waits for the tx to be included in the block. +// The wait will end after either the asyncTimeout has run out or the asyncCtx exits. +// If there is no error broadcasting, the asyncCallback will be called with success/failure of the wait for block inclusion. +func (cc *PenumbraProvider) broadcastTx( + ctx context.Context, // context for tx broadcast + tx []byte, // raw tx to be broadcasted + msgs []provider.RelayerMessage, // used for logging only + fees sdk.Coins, // used for metrics + + asyncCtx context.Context, // context for async wait for block inclusion after successful tx broadcast + asyncTimeout time.Duration, // timeout for waiting for block inclusion + asyncCallback func(*provider.RelayerTxResponse, error), // callback for success/fail of the wait for block inclusion +) error { + res, err := cc.RPCClient.BroadcastTxSync(ctx, tx) + isErr := err != nil + isFailed := res != nil && res.Code != 0 + if isErr || isFailed { + if isErr && res == nil { + // There are some cases where BroadcastTxSync will return an error but the associated + // ResultBroadcastTx will be nil. + return err + } + rlyResp := &provider.RelayerTxResponse{ + TxHash: res.Hash.String(), + Codespace: res.Codespace, + Code: res.Code, + Data: res.Data.String(), + } + if isFailed { + err = cc.sdkError(res.Codespace, res.Code) + if err == nil { + err = fmt.Errorf("transaction failed to execute") + } + } + cc.LogFailedTx(rlyResp, err, msgs) + return err + } + + // TODO: maybe we need to check if the node has tx indexing enabled? + // if not, we need to find a new way to block until inclusion in a block + + go cc.waitForTx(asyncCtx, res.Hash, msgs, asyncTimeout, asyncCallback) + + return nil +} + +// waitForTx waits for a transaction to be included in a block, logs success/fail, then invokes callback. +// This is intended to be called as an async goroutine. +func (cc *PenumbraProvider) waitForTx( + ctx context.Context, + txHash []byte, + msgs []provider.RelayerMessage, // used for logging only + waitTimeout time.Duration, + callback func(*provider.RelayerTxResponse, error), +) { + res, err := cc.waitForBlockInclusion(ctx, txHash, waitTimeout) + if err != nil { + cc.log.Error("Failed to wait for block inclusion", zap.Error(err)) + if callback != nil { + callback(nil, err) + } + return + } + + rlyResp := &provider.RelayerTxResponse{ + Height: res.Height, + TxHash: res.TxHash, + Codespace: res.Codespace, + Code: res.Code, + Data: res.Data, + Events: parseEventsFromTxResponse(res), + } + + // transaction was executed, log the success or failure using the tx response code + // NOTE: error is nil, logic should use the returned error to determine if the + // transaction was successfully executed. + + if res.Code != 0 { + // Check for any registered SDK errors + err := cc.sdkError(res.Codespace, res.Code) + if err == nil { + err = fmt.Errorf("transaction failed to execute") + } + if callback != nil { + callback(nil, err) + } + cc.LogFailedTx(rlyResp, nil, msgs) + return + } + + if callback != nil { + callback(rlyResp, nil) + } + cc.LogSuccessTx(res, msgs) +} + +// waitForBlockInclusion will wait for a transaction to be included in a block, up to waitTimeout or context cancellation. +func (cc *PenumbraProvider) waitForBlockInclusion( + ctx context.Context, + txHash []byte, + waitTimeout time.Duration, +) (*sdk.TxResponse, error) { + exitAfter := time.After(waitTimeout) + for { + select { + case <-exitAfter: + return nil, fmt.Errorf("timed out after: %d; %w", waitTimeout, ErrTimeoutAfterWaitingForTxBroadcast) + // This fixed poll is fine because it's only for logging and updating prometheus metrics currently. + case <-time.After(time.Millisecond * 100): + res, err := cc.RPCClient.Tx(ctx, txHash, false) + if err == nil { + return cc.mkTxResult(res) + } + if strings.Contains(err.Error(), "transaction indexing is disabled") { + return nil, fmt.Errorf("cannot determine success/failure of tx because transaction indexing is disabled on rpc url") + } + case <-ctx.Done(): + return nil, ctx.Err() + } + } +} + +// mkTxResult decodes a comet transaction into an SDK TxResponse. +func (cc *PenumbraProvider) mkTxResult(resTx *coretypes.ResultTx) (*sdk.TxResponse, error) { + txbz, err := cc.Codec.TxConfig.TxDecoder()(resTx.Tx) + if err != nil { + return nil, err + } + p, ok := txbz.(intoAny) + if !ok { + return nil, fmt.Errorf("expecting a type implementing intoAny, got: %T", txbz) + } + any := p.AsAny() + return sdk.NewResponseResultTx(resTx, any, ""), nil +} + +func (cc *PenumbraProvider) MsgSubmitQueryResponse(chainID string, queryID provider.ClientICQQueryID, proof provider.ICQProof) (provider.RelayerMessage, error) { + //TODO implement me + panic("implement me") +} + +func (cc *PenumbraProvider) SendMessagesToMempool(ctx context.Context, msgs []provider.RelayerMessage, memo string, asyncCtx context.Context, asyncCallback func(*provider.RelayerTxResponse, error)) error { + sendRsp, err := cc.sendMessagesInner(ctx, msgs, memo) + cc.log.Debug("Received response from sending messages", zap.Any("response", sendRsp), zap.Error(err)) + return err +} + +// MsgRegisterCounterpartyPayee creates an sdk.Msg to broadcast the counterparty address +func (cc *PenumbraProvider) MsgRegisterCounterpartyPayee(portID, channelID, relayerAddr, counterpartyPayee string) (provider.RelayerMessage, error) { + //TODO implement me + panic("implement me") +} +func (cc *PenumbraProvider) MsgTimeoutRequest(msgTransfer provider.PacketInfo, proof provider.PacketProof) (provider.RelayerMessage, error) { + //TODO implement me + panic("implement me") +} diff --git a/relayer/chains/penumbra/view/v1alpha1/view.pb.go b/relayer/chains/penumbra/view/v1alpha1/view.pb.go new file mode 100644 index 000000000..217129d5f --- /dev/null +++ b/relayer/chains/penumbra/view/v1alpha1/view.pb.go @@ -0,0 +1,13899 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: penumbra/view/v1alpha1/view.proto + +package viewv1alpha1 + +import ( + context "context" + fmt "fmt" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + v1alpha13 "github.com/cosmos/relayer/v2/relayer/chains/penumbra/core/chain/v1alpha1" + v1alpha11 "github.com/cosmos/relayer/v2/relayer/chains/penumbra/core/crypto/v1alpha1" + v1alpha14 "github.com/cosmos/relayer/v2/relayer/chains/penumbra/core/dex/v1alpha1" + v1alpha12 "github.com/cosmos/relayer/v2/relayer/chains/penumbra/core/ibc/v1alpha1" + v1alpha1 "github.com/cosmos/relayer/v2/relayer/chains/penumbra/core/transaction/v1alpha1" + 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 + +type BroadcastTransactionRequest struct { + // The transaction to broadcast. + Transaction *v1alpha1.Transaction `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"` + // If true, wait for the view service to detect the transaction during sync. + AwaitDetection bool `protobuf:"varint,2,opt,name=await_detection,json=awaitDetection,proto3" json:"await_detection,omitempty"` +} + +func (m *BroadcastTransactionRequest) Reset() { *m = BroadcastTransactionRequest{} } +func (m *BroadcastTransactionRequest) String() string { return proto.CompactTextString(m) } +func (*BroadcastTransactionRequest) ProtoMessage() {} +func (*BroadcastTransactionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{0} +} +func (m *BroadcastTransactionRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BroadcastTransactionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BroadcastTransactionRequest.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 *BroadcastTransactionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_BroadcastTransactionRequest.Merge(m, src) +} +func (m *BroadcastTransactionRequest) XXX_Size() int { + return m.Size() +} +func (m *BroadcastTransactionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_BroadcastTransactionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_BroadcastTransactionRequest proto.InternalMessageInfo + +func (m *BroadcastTransactionRequest) GetTransaction() *v1alpha1.Transaction { + if m != nil { + return m.Transaction + } + return nil +} + +func (m *BroadcastTransactionRequest) GetAwaitDetection() bool { + if m != nil { + return m.AwaitDetection + } + return false +} + +type BroadcastTransactionResponse struct { + // The hash of the transaction that was broadcast. + Id *v1alpha1.Id `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // The height in which the transaction was detected as included in the chain, if any. + // Will not be included unless await_detection was true. + DetectionHeight uint64 `protobuf:"varint,2,opt,name=detection_height,json=detectionHeight,proto3" json:"detection_height,omitempty"` +} + +func (m *BroadcastTransactionResponse) Reset() { *m = BroadcastTransactionResponse{} } +func (m *BroadcastTransactionResponse) String() string { return proto.CompactTextString(m) } +func (*BroadcastTransactionResponse) ProtoMessage() {} +func (*BroadcastTransactionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{1} +} +func (m *BroadcastTransactionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BroadcastTransactionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BroadcastTransactionResponse.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 *BroadcastTransactionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_BroadcastTransactionResponse.Merge(m, src) +} +func (m *BroadcastTransactionResponse) XXX_Size() int { + return m.Size() +} +func (m *BroadcastTransactionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_BroadcastTransactionResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_BroadcastTransactionResponse proto.InternalMessageInfo + +func (m *BroadcastTransactionResponse) GetId() *v1alpha1.Id { + if m != nil { + return m.Id + } + return nil +} + +func (m *BroadcastTransactionResponse) GetDetectionHeight() uint64 { + if m != nil { + return m.DetectionHeight + } + return 0 +} + +type TransactionPlannerRequest struct { + // The expiry height for the requested TransactionPlan + ExpiryHeight uint64 `protobuf:"varint,1,opt,name=expiry_height,json=expiryHeight,proto3" json:"expiry_height,omitempty"` + // The fee for the requested TransactionPlan, if any. + Fee *v1alpha11.Fee `protobuf:"bytes,2,opt,name=fee,proto3" json:"fee,omitempty"` + // The memo for the requested TransactionPlan + Memo string `protobuf:"bytes,3,opt,name=memo,proto3" json:"memo,omitempty"` + // Types that are valid to be assigned to XAccountGroupId: + // *TransactionPlannerRequest_AccountGroupId + XAccountGroupId isTransactionPlannerRequest_XAccountGroupId `protobuf_oneof:"_account_group_id"` + // Request contents + Outputs []*TransactionPlannerRequest_Output `protobuf:"bytes,20,rep,name=outputs,proto3" json:"outputs,omitempty"` + Swaps []*TransactionPlannerRequest_Swap `protobuf:"bytes,30,rep,name=swaps,proto3" json:"swaps,omitempty"` + Delegations []*TransactionPlannerRequest_Delegate `protobuf:"bytes,40,rep,name=delegations,proto3" json:"delegations,omitempty"` + Undelegations []*TransactionPlannerRequest_Undelegate `protobuf:"bytes,50,rep,name=undelegations,proto3" json:"undelegations,omitempty"` + IbcActions []*v1alpha12.IbcAction `protobuf:"bytes,60,rep,name=ibc_actions,json=ibcActions,proto3" json:"ibc_actions,omitempty"` +} + +func (m *TransactionPlannerRequest) Reset() { *m = TransactionPlannerRequest{} } +func (m *TransactionPlannerRequest) String() string { return proto.CompactTextString(m) } +func (*TransactionPlannerRequest) ProtoMessage() {} +func (*TransactionPlannerRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{2} +} +func (m *TransactionPlannerRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TransactionPlannerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TransactionPlannerRequest.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 *TransactionPlannerRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransactionPlannerRequest.Merge(m, src) +} +func (m *TransactionPlannerRequest) XXX_Size() int { + return m.Size() +} +func (m *TransactionPlannerRequest) XXX_DiscardUnknown() { + xxx_messageInfo_TransactionPlannerRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_TransactionPlannerRequest proto.InternalMessageInfo + +type isTransactionPlannerRequest_XAccountGroupId interface { + isTransactionPlannerRequest_XAccountGroupId() + MarshalTo([]byte) (int, error) + Size() int +} + +type TransactionPlannerRequest_AccountGroupId struct { + AccountGroupId *v1alpha11.AccountGroupId `protobuf:"bytes,14,opt,name=account_group_id,json=accountGroupId,proto3,oneof" json:"account_group_id,omitempty"` +} + +func (*TransactionPlannerRequest_AccountGroupId) isTransactionPlannerRequest_XAccountGroupId() {} + +func (m *TransactionPlannerRequest) GetXAccountGroupId() isTransactionPlannerRequest_XAccountGroupId { + if m != nil { + return m.XAccountGroupId + } + return nil +} + +func (m *TransactionPlannerRequest) GetExpiryHeight() uint64 { + if m != nil { + return m.ExpiryHeight + } + return 0 +} + +func (m *TransactionPlannerRequest) GetFee() *v1alpha11.Fee { + if m != nil { + return m.Fee + } + return nil +} + +func (m *TransactionPlannerRequest) GetMemo() string { + if m != nil { + return m.Memo + } + return "" +} + +func (m *TransactionPlannerRequest) GetAccountGroupId() *v1alpha11.AccountGroupId { + if x, ok := m.GetXAccountGroupId().(*TransactionPlannerRequest_AccountGroupId); ok { + return x.AccountGroupId + } + return nil +} + +func (m *TransactionPlannerRequest) GetOutputs() []*TransactionPlannerRequest_Output { + if m != nil { + return m.Outputs + } + return nil +} + +func (m *TransactionPlannerRequest) GetSwaps() []*TransactionPlannerRequest_Swap { + if m != nil { + return m.Swaps + } + return nil +} + +func (m *TransactionPlannerRequest) GetDelegations() []*TransactionPlannerRequest_Delegate { + if m != nil { + return m.Delegations + } + return nil +} + +func (m *TransactionPlannerRequest) GetUndelegations() []*TransactionPlannerRequest_Undelegate { + if m != nil { + return m.Undelegations + } + return nil +} + +func (m *TransactionPlannerRequest) GetIbcActions() []*v1alpha12.IbcAction { + if m != nil { + return m.IbcActions + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*TransactionPlannerRequest) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*TransactionPlannerRequest_AccountGroupId)(nil), + } +} + +// Request message subtypes +type TransactionPlannerRequest_Output struct { + Value *v1alpha11.Value `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + Address *v1alpha11.Address `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *TransactionPlannerRequest_Output) Reset() { *m = TransactionPlannerRequest_Output{} } +func (m *TransactionPlannerRequest_Output) String() string { return proto.CompactTextString(m) } +func (*TransactionPlannerRequest_Output) ProtoMessage() {} +func (*TransactionPlannerRequest_Output) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{2, 0} +} +func (m *TransactionPlannerRequest_Output) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TransactionPlannerRequest_Output) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TransactionPlannerRequest_Output.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 *TransactionPlannerRequest_Output) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransactionPlannerRequest_Output.Merge(m, src) +} +func (m *TransactionPlannerRequest_Output) XXX_Size() int { + return m.Size() +} +func (m *TransactionPlannerRequest_Output) XXX_DiscardUnknown() { + xxx_messageInfo_TransactionPlannerRequest_Output.DiscardUnknown(m) +} + +var xxx_messageInfo_TransactionPlannerRequest_Output proto.InternalMessageInfo + +func (m *TransactionPlannerRequest_Output) GetValue() *v1alpha11.Value { + if m != nil { + return m.Value + } + return nil +} + +func (m *TransactionPlannerRequest_Output) GetAddress() *v1alpha11.Address { + if m != nil { + return m.Address + } + return nil +} + +type TransactionPlannerRequest_Swap struct { + Value *v1alpha11.Value `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + TargetAsset *v1alpha11.AssetId `protobuf:"bytes,2,opt,name=target_asset,json=targetAsset,proto3" json:"target_asset,omitempty"` + Fee *v1alpha11.Fee `protobuf:"bytes,3,opt,name=fee,proto3" json:"fee,omitempty"` +} + +func (m *TransactionPlannerRequest_Swap) Reset() { *m = TransactionPlannerRequest_Swap{} } +func (m *TransactionPlannerRequest_Swap) String() string { return proto.CompactTextString(m) } +func (*TransactionPlannerRequest_Swap) ProtoMessage() {} +func (*TransactionPlannerRequest_Swap) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{2, 1} +} +func (m *TransactionPlannerRequest_Swap) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TransactionPlannerRequest_Swap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TransactionPlannerRequest_Swap.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 *TransactionPlannerRequest_Swap) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransactionPlannerRequest_Swap.Merge(m, src) +} +func (m *TransactionPlannerRequest_Swap) XXX_Size() int { + return m.Size() +} +func (m *TransactionPlannerRequest_Swap) XXX_DiscardUnknown() { + xxx_messageInfo_TransactionPlannerRequest_Swap.DiscardUnknown(m) +} + +var xxx_messageInfo_TransactionPlannerRequest_Swap proto.InternalMessageInfo + +func (m *TransactionPlannerRequest_Swap) GetValue() *v1alpha11.Value { + if m != nil { + return m.Value + } + return nil +} + +func (m *TransactionPlannerRequest_Swap) GetTargetAsset() *v1alpha11.AssetId { + if m != nil { + return m.TargetAsset + } + return nil +} + +func (m *TransactionPlannerRequest_Swap) GetFee() *v1alpha11.Fee { + if m != nil { + return m.Fee + } + return nil +} + +type TransactionPlannerRequest_Delegate struct { + Amount *v1alpha11.Amount `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount,omitempty"` + IdentityKey *v1alpha11.IdentityKey `protobuf:"bytes,2,opt,name=identity_key,json=identityKey,proto3" json:"identity_key,omitempty"` +} + +func (m *TransactionPlannerRequest_Delegate) Reset() { *m = TransactionPlannerRequest_Delegate{} } +func (m *TransactionPlannerRequest_Delegate) String() string { return proto.CompactTextString(m) } +func (*TransactionPlannerRequest_Delegate) ProtoMessage() {} +func (*TransactionPlannerRequest_Delegate) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{2, 2} +} +func (m *TransactionPlannerRequest_Delegate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TransactionPlannerRequest_Delegate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TransactionPlannerRequest_Delegate.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 *TransactionPlannerRequest_Delegate) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransactionPlannerRequest_Delegate.Merge(m, src) +} +func (m *TransactionPlannerRequest_Delegate) XXX_Size() int { + return m.Size() +} +func (m *TransactionPlannerRequest_Delegate) XXX_DiscardUnknown() { + xxx_messageInfo_TransactionPlannerRequest_Delegate.DiscardUnknown(m) +} + +var xxx_messageInfo_TransactionPlannerRequest_Delegate proto.InternalMessageInfo + +func (m *TransactionPlannerRequest_Delegate) GetAmount() *v1alpha11.Amount { + if m != nil { + return m.Amount + } + return nil +} + +func (m *TransactionPlannerRequest_Delegate) GetIdentityKey() *v1alpha11.IdentityKey { + if m != nil { + return m.IdentityKey + } + return nil +} + +type TransactionPlannerRequest_Undelegate struct { + Value *v1alpha11.Value `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *TransactionPlannerRequest_Undelegate) Reset() { *m = TransactionPlannerRequest_Undelegate{} } +func (m *TransactionPlannerRequest_Undelegate) String() string { return proto.CompactTextString(m) } +func (*TransactionPlannerRequest_Undelegate) ProtoMessage() {} +func (*TransactionPlannerRequest_Undelegate) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{2, 3} +} +func (m *TransactionPlannerRequest_Undelegate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TransactionPlannerRequest_Undelegate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TransactionPlannerRequest_Undelegate.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 *TransactionPlannerRequest_Undelegate) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransactionPlannerRequest_Undelegate.Merge(m, src) +} +func (m *TransactionPlannerRequest_Undelegate) XXX_Size() int { + return m.Size() +} +func (m *TransactionPlannerRequest_Undelegate) XXX_DiscardUnknown() { + xxx_messageInfo_TransactionPlannerRequest_Undelegate.DiscardUnknown(m) +} + +var xxx_messageInfo_TransactionPlannerRequest_Undelegate proto.InternalMessageInfo + +func (m *TransactionPlannerRequest_Undelegate) GetValue() *v1alpha11.Value { + if m != nil { + return m.Value + } + return nil +} + +type TransactionPlannerResponse struct { + Plan *v1alpha1.TransactionPlan `protobuf:"bytes,1,opt,name=plan,proto3" json:"plan,omitempty"` +} + +func (m *TransactionPlannerResponse) Reset() { *m = TransactionPlannerResponse{} } +func (m *TransactionPlannerResponse) String() string { return proto.CompactTextString(m) } +func (*TransactionPlannerResponse) ProtoMessage() {} +func (*TransactionPlannerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{3} +} +func (m *TransactionPlannerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TransactionPlannerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TransactionPlannerResponse.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 *TransactionPlannerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransactionPlannerResponse.Merge(m, src) +} +func (m *TransactionPlannerResponse) XXX_Size() int { + return m.Size() +} +func (m *TransactionPlannerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_TransactionPlannerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_TransactionPlannerResponse proto.InternalMessageInfo + +func (m *TransactionPlannerResponse) GetPlan() *v1alpha1.TransactionPlan { + if m != nil { + return m.Plan + } + return nil +} + +type AddressByIndexRequest struct { + AddressIndex *v1alpha11.AddressIndex `protobuf:"bytes,1,opt,name=address_index,json=addressIndex,proto3" json:"address_index,omitempty"` +} + +func (m *AddressByIndexRequest) Reset() { *m = AddressByIndexRequest{} } +func (m *AddressByIndexRequest) String() string { return proto.CompactTextString(m) } +func (*AddressByIndexRequest) ProtoMessage() {} +func (*AddressByIndexRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{4} +} +func (m *AddressByIndexRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddressByIndexRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddressByIndexRequest.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 *AddressByIndexRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddressByIndexRequest.Merge(m, src) +} +func (m *AddressByIndexRequest) XXX_Size() int { + return m.Size() +} +func (m *AddressByIndexRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AddressByIndexRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AddressByIndexRequest proto.InternalMessageInfo + +func (m *AddressByIndexRequest) GetAddressIndex() *v1alpha11.AddressIndex { + if m != nil { + return m.AddressIndex + } + return nil +} + +type AddressByIndexResponse struct { + Address *v1alpha11.Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *AddressByIndexResponse) Reset() { *m = AddressByIndexResponse{} } +func (m *AddressByIndexResponse) String() string { return proto.CompactTextString(m) } +func (*AddressByIndexResponse) ProtoMessage() {} +func (*AddressByIndexResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{5} +} +func (m *AddressByIndexResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddressByIndexResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddressByIndexResponse.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 *AddressByIndexResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddressByIndexResponse.Merge(m, src) +} +func (m *AddressByIndexResponse) XXX_Size() int { + return m.Size() +} +func (m *AddressByIndexResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AddressByIndexResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AddressByIndexResponse proto.InternalMessageInfo + +func (m *AddressByIndexResponse) GetAddress() *v1alpha11.Address { + if m != nil { + return m.Address + } + return nil +} + +type IndexByAddressRequest struct { + Address *v1alpha11.Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *IndexByAddressRequest) Reset() { *m = IndexByAddressRequest{} } +func (m *IndexByAddressRequest) String() string { return proto.CompactTextString(m) } +func (*IndexByAddressRequest) ProtoMessage() {} +func (*IndexByAddressRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{6} +} +func (m *IndexByAddressRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IndexByAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IndexByAddressRequest.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 *IndexByAddressRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_IndexByAddressRequest.Merge(m, src) +} +func (m *IndexByAddressRequest) XXX_Size() int { + return m.Size() +} +func (m *IndexByAddressRequest) XXX_DiscardUnknown() { + xxx_messageInfo_IndexByAddressRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_IndexByAddressRequest proto.InternalMessageInfo + +func (m *IndexByAddressRequest) GetAddress() *v1alpha11.Address { + if m != nil { + return m.Address + } + return nil +} + +type IndexByAddressResponse struct { + // Types that are valid to be assigned to XAddressIndex: + // *IndexByAddressResponse_AddressIndex + XAddressIndex isIndexByAddressResponse_XAddressIndex `protobuf_oneof:"_address_index"` +} + +func (m *IndexByAddressResponse) Reset() { *m = IndexByAddressResponse{} } +func (m *IndexByAddressResponse) String() string { return proto.CompactTextString(m) } +func (*IndexByAddressResponse) ProtoMessage() {} +func (*IndexByAddressResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{7} +} +func (m *IndexByAddressResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IndexByAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IndexByAddressResponse.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 *IndexByAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_IndexByAddressResponse.Merge(m, src) +} +func (m *IndexByAddressResponse) XXX_Size() int { + return m.Size() +} +func (m *IndexByAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_IndexByAddressResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_IndexByAddressResponse proto.InternalMessageInfo + +type isIndexByAddressResponse_XAddressIndex interface { + isIndexByAddressResponse_XAddressIndex() + MarshalTo([]byte) (int, error) + Size() int +} + +type IndexByAddressResponse_AddressIndex struct { + AddressIndex *v1alpha11.AddressIndex `protobuf:"bytes,1,opt,name=address_index,json=addressIndex,proto3,oneof" json:"address_index,omitempty"` +} + +func (*IndexByAddressResponse_AddressIndex) isIndexByAddressResponse_XAddressIndex() {} + +func (m *IndexByAddressResponse) GetXAddressIndex() isIndexByAddressResponse_XAddressIndex { + if m != nil { + return m.XAddressIndex + } + return nil +} + +func (m *IndexByAddressResponse) GetAddressIndex() *v1alpha11.AddressIndex { + if x, ok := m.GetXAddressIndex().(*IndexByAddressResponse_AddressIndex); ok { + return x.AddressIndex + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*IndexByAddressResponse) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*IndexByAddressResponse_AddressIndex)(nil), + } +} + +type EphemeralAddressRequest struct { + AddressIndex *v1alpha11.AddressIndex `protobuf:"bytes,1,opt,name=address_index,json=addressIndex,proto3" json:"address_index,omitempty"` +} + +func (m *EphemeralAddressRequest) Reset() { *m = EphemeralAddressRequest{} } +func (m *EphemeralAddressRequest) String() string { return proto.CompactTextString(m) } +func (*EphemeralAddressRequest) ProtoMessage() {} +func (*EphemeralAddressRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{8} +} +func (m *EphemeralAddressRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EphemeralAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EphemeralAddressRequest.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 *EphemeralAddressRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_EphemeralAddressRequest.Merge(m, src) +} +func (m *EphemeralAddressRequest) XXX_Size() int { + return m.Size() +} +func (m *EphemeralAddressRequest) XXX_DiscardUnknown() { + xxx_messageInfo_EphemeralAddressRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_EphemeralAddressRequest proto.InternalMessageInfo + +func (m *EphemeralAddressRequest) GetAddressIndex() *v1alpha11.AddressIndex { + if m != nil { + return m.AddressIndex + } + return nil +} + +type EphemeralAddressResponse struct { + Address *v1alpha11.Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *EphemeralAddressResponse) Reset() { *m = EphemeralAddressResponse{} } +func (m *EphemeralAddressResponse) String() string { return proto.CompactTextString(m) } +func (*EphemeralAddressResponse) ProtoMessage() {} +func (*EphemeralAddressResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{9} +} +func (m *EphemeralAddressResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EphemeralAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EphemeralAddressResponse.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 *EphemeralAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_EphemeralAddressResponse.Merge(m, src) +} +func (m *EphemeralAddressResponse) XXX_Size() int { + return m.Size() +} +func (m *EphemeralAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_EphemeralAddressResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_EphemeralAddressResponse proto.InternalMessageInfo + +func (m *EphemeralAddressResponse) GetAddress() *v1alpha11.Address { + if m != nil { + return m.Address + } + return nil +} + +type BalanceByAddressRequest struct { + Address *v1alpha11.Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *BalanceByAddressRequest) Reset() { *m = BalanceByAddressRequest{} } +func (m *BalanceByAddressRequest) String() string { return proto.CompactTextString(m) } +func (*BalanceByAddressRequest) ProtoMessage() {} +func (*BalanceByAddressRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{10} +} +func (m *BalanceByAddressRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BalanceByAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BalanceByAddressRequest.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 *BalanceByAddressRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_BalanceByAddressRequest.Merge(m, src) +} +func (m *BalanceByAddressRequest) XXX_Size() int { + return m.Size() +} +func (m *BalanceByAddressRequest) XXX_DiscardUnknown() { + xxx_messageInfo_BalanceByAddressRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_BalanceByAddressRequest proto.InternalMessageInfo + +func (m *BalanceByAddressRequest) GetAddress() *v1alpha11.Address { + if m != nil { + return m.Address + } + return nil +} + +type BalanceByAddressResponse struct { + Asset *v1alpha11.AssetId `protobuf:"bytes,1,opt,name=asset,proto3" json:"asset,omitempty"` + Amount *v1alpha11.Amount `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (m *BalanceByAddressResponse) Reset() { *m = BalanceByAddressResponse{} } +func (m *BalanceByAddressResponse) String() string { return proto.CompactTextString(m) } +func (*BalanceByAddressResponse) ProtoMessage() {} +func (*BalanceByAddressResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{11} +} +func (m *BalanceByAddressResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BalanceByAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BalanceByAddressResponse.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 *BalanceByAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_BalanceByAddressResponse.Merge(m, src) +} +func (m *BalanceByAddressResponse) XXX_Size() int { + return m.Size() +} +func (m *BalanceByAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_BalanceByAddressResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_BalanceByAddressResponse proto.InternalMessageInfo + +func (m *BalanceByAddressResponse) GetAsset() *v1alpha11.AssetId { + if m != nil { + return m.Asset + } + return nil +} + +func (m *BalanceByAddressResponse) GetAmount() *v1alpha11.Amount { + if m != nil { + return m.Amount + } + return nil +} + +// Scaffolding for bearer-token authentication for the ViewService. +type ViewAuthToken struct { + Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (m *ViewAuthToken) Reset() { *m = ViewAuthToken{} } +func (m *ViewAuthToken) String() string { return proto.CompactTextString(m) } +func (*ViewAuthToken) ProtoMessage() {} +func (*ViewAuthToken) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{12} +} +func (m *ViewAuthToken) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ViewAuthToken) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ViewAuthToken.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 *ViewAuthToken) XXX_Merge(src proto.Message) { + xxx_messageInfo_ViewAuthToken.Merge(m, src) +} +func (m *ViewAuthToken) XXX_Size() int { + return m.Size() +} +func (m *ViewAuthToken) XXX_DiscardUnknown() { + xxx_messageInfo_ViewAuthToken.DiscardUnknown(m) +} + +var xxx_messageInfo_ViewAuthToken proto.InternalMessageInfo + +func (m *ViewAuthToken) GetInner() []byte { + if m != nil { + return m.Inner + } + return nil +} + +type ViewAuthRequest struct { + Fvk *v1alpha11.FullViewingKey `protobuf:"bytes,1,opt,name=fvk,proto3" json:"fvk,omitempty"` +} + +func (m *ViewAuthRequest) Reset() { *m = ViewAuthRequest{} } +func (m *ViewAuthRequest) String() string { return proto.CompactTextString(m) } +func (*ViewAuthRequest) ProtoMessage() {} +func (*ViewAuthRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{13} +} +func (m *ViewAuthRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ViewAuthRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ViewAuthRequest.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 *ViewAuthRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ViewAuthRequest.Merge(m, src) +} +func (m *ViewAuthRequest) XXX_Size() int { + return m.Size() +} +func (m *ViewAuthRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ViewAuthRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ViewAuthRequest proto.InternalMessageInfo + +func (m *ViewAuthRequest) GetFvk() *v1alpha11.FullViewingKey { + if m != nil { + return m.Fvk + } + return nil +} + +type ViewAuthResponse struct { + Token *ViewAuthToken `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` +} + +func (m *ViewAuthResponse) Reset() { *m = ViewAuthResponse{} } +func (m *ViewAuthResponse) String() string { return proto.CompactTextString(m) } +func (*ViewAuthResponse) ProtoMessage() {} +func (*ViewAuthResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{14} +} +func (m *ViewAuthResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ViewAuthResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ViewAuthResponse.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 *ViewAuthResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ViewAuthResponse.Merge(m, src) +} +func (m *ViewAuthResponse) XXX_Size() int { + return m.Size() +} +func (m *ViewAuthResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ViewAuthResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ViewAuthResponse proto.InternalMessageInfo + +func (m *ViewAuthResponse) GetToken() *ViewAuthToken { + if m != nil { + return m.Token + } + return nil +} + +// Requests sync status of the view service. +type StatusRequest struct { + // Types that are valid to be assigned to XAccountGroupId: + // *StatusRequest_AccountGroupId + XAccountGroupId isStatusRequest_XAccountGroupId `protobuf_oneof:"_account_group_id"` +} + +func (m *StatusRequest) Reset() { *m = StatusRequest{} } +func (m *StatusRequest) String() string { return proto.CompactTextString(m) } +func (*StatusRequest) ProtoMessage() {} +func (*StatusRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{15} +} +func (m *StatusRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StatusRequest.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 *StatusRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_StatusRequest.Merge(m, src) +} +func (m *StatusRequest) XXX_Size() int { + return m.Size() +} +func (m *StatusRequest) XXX_DiscardUnknown() { + xxx_messageInfo_StatusRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_StatusRequest proto.InternalMessageInfo + +type isStatusRequest_XAccountGroupId interface { + isStatusRequest_XAccountGroupId() + MarshalTo([]byte) (int, error) + Size() int +} + +type StatusRequest_AccountGroupId struct { + AccountGroupId *v1alpha11.AccountGroupId `protobuf:"bytes,14,opt,name=account_group_id,json=accountGroupId,proto3,oneof" json:"account_group_id,omitempty"` +} + +func (*StatusRequest_AccountGroupId) isStatusRequest_XAccountGroupId() {} + +func (m *StatusRequest) GetXAccountGroupId() isStatusRequest_XAccountGroupId { + if m != nil { + return m.XAccountGroupId + } + return nil +} + +func (m *StatusRequest) GetAccountGroupId() *v1alpha11.AccountGroupId { + if x, ok := m.GetXAccountGroupId().(*StatusRequest_AccountGroupId); ok { + return x.AccountGroupId + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*StatusRequest) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*StatusRequest_AccountGroupId)(nil), + } +} + +// Returns the status of the view service and whether it is synchronized with the chain state. +type StatusResponse struct { + // The height the view service has synchronized to so far + SyncHeight uint64 `protobuf:"varint,1,opt,name=sync_height,json=syncHeight,proto3" json:"sync_height,omitempty"` + // Whether the view service is catching up with the chain state + CatchingUp bool `protobuf:"varint,2,opt,name=catching_up,json=catchingUp,proto3" json:"catching_up,omitempty"` +} + +func (m *StatusResponse) Reset() { *m = StatusResponse{} } +func (m *StatusResponse) String() string { return proto.CompactTextString(m) } +func (*StatusResponse) ProtoMessage() {} +func (*StatusResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{16} +} +func (m *StatusResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StatusResponse.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 *StatusResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_StatusResponse.Merge(m, src) +} +func (m *StatusResponse) XXX_Size() int { + return m.Size() +} +func (m *StatusResponse) XXX_DiscardUnknown() { + xxx_messageInfo_StatusResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_StatusResponse proto.InternalMessageInfo + +func (m *StatusResponse) GetSyncHeight() uint64 { + if m != nil { + return m.SyncHeight + } + return 0 +} + +func (m *StatusResponse) GetCatchingUp() bool { + if m != nil { + return m.CatchingUp + } + return false +} + +// Requests streaming updates on the sync height until the view service is synchronized. +type StatusStreamRequest struct { + // Types that are valid to be assigned to XAccountGroupId: + // *StatusStreamRequest_AccountGroupId + XAccountGroupId isStatusStreamRequest_XAccountGroupId `protobuf_oneof:"_account_group_id"` +} + +func (m *StatusStreamRequest) Reset() { *m = StatusStreamRequest{} } +func (m *StatusStreamRequest) String() string { return proto.CompactTextString(m) } +func (*StatusStreamRequest) ProtoMessage() {} +func (*StatusStreamRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{17} +} +func (m *StatusStreamRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StatusStreamRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StatusStreamRequest.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 *StatusStreamRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_StatusStreamRequest.Merge(m, src) +} +func (m *StatusStreamRequest) XXX_Size() int { + return m.Size() +} +func (m *StatusStreamRequest) XXX_DiscardUnknown() { + xxx_messageInfo_StatusStreamRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_StatusStreamRequest proto.InternalMessageInfo + +type isStatusStreamRequest_XAccountGroupId interface { + isStatusStreamRequest_XAccountGroupId() + MarshalTo([]byte) (int, error) + Size() int +} + +type StatusStreamRequest_AccountGroupId struct { + AccountGroupId *v1alpha11.AccountGroupId `protobuf:"bytes,14,opt,name=account_group_id,json=accountGroupId,proto3,oneof" json:"account_group_id,omitempty"` +} + +func (*StatusStreamRequest_AccountGroupId) isStatusStreamRequest_XAccountGroupId() {} + +func (m *StatusStreamRequest) GetXAccountGroupId() isStatusStreamRequest_XAccountGroupId { + if m != nil { + return m.XAccountGroupId + } + return nil +} + +func (m *StatusStreamRequest) GetAccountGroupId() *v1alpha11.AccountGroupId { + if x, ok := m.GetXAccountGroupId().(*StatusStreamRequest_AccountGroupId); ok { + return x.AccountGroupId + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*StatusStreamRequest) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*StatusStreamRequest_AccountGroupId)(nil), + } +} + +// A streaming sync status update +type StatusStreamResponse struct { + LatestKnownBlockHeight uint64 `protobuf:"varint,1,opt,name=latest_known_block_height,json=latestKnownBlockHeight,proto3" json:"latest_known_block_height,omitempty"` + SyncHeight uint64 `protobuf:"varint,2,opt,name=sync_height,json=syncHeight,proto3" json:"sync_height,omitempty"` +} + +func (m *StatusStreamResponse) Reset() { *m = StatusStreamResponse{} } +func (m *StatusStreamResponse) String() string { return proto.CompactTextString(m) } +func (*StatusStreamResponse) ProtoMessage() {} +func (*StatusStreamResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{18} +} +func (m *StatusStreamResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StatusStreamResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StatusStreamResponse.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 *StatusStreamResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_StatusStreamResponse.Merge(m, src) +} +func (m *StatusStreamResponse) XXX_Size() int { + return m.Size() +} +func (m *StatusStreamResponse) XXX_DiscardUnknown() { + xxx_messageInfo_StatusStreamResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_StatusStreamResponse proto.InternalMessageInfo + +func (m *StatusStreamResponse) GetLatestKnownBlockHeight() uint64 { + if m != nil { + return m.LatestKnownBlockHeight + } + return 0 +} + +func (m *StatusStreamResponse) GetSyncHeight() uint64 { + if m != nil { + return m.SyncHeight + } + return 0 +} + +// A query for notes known by the view service. +// +// This message uses the fact that all proto fields are optional +// to allow various filtering on the returned notes. +type NotesRequest struct { + // If set, return spent notes as well as unspent notes. + IncludeSpent bool `protobuf:"varint,2,opt,name=include_spent,json=includeSpent,proto3" json:"include_spent,omitempty"` + // If set, only return notes with the specified asset id. + AssetId *v1alpha11.AssetId `protobuf:"bytes,3,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + // If set, only return notes with the specified address incore.dex.v1alpha1. + AddressIndex *v1alpha11.AddressIndex `protobuf:"bytes,4,opt,name=address_index,json=addressIndex,proto3" json:"address_index,omitempty"` + // If set, stop returning notes once the total exceeds this amount. + // + // Ignored if `asset_id` is unset or if `include_spent` is set. + AmountToSpend *v1alpha11.Amount `protobuf:"bytes,6,opt,name=amount_to_spend,json=amountToSpend,proto3" json:"amount_to_spend,omitempty"` + // Types that are valid to be assigned to XAccountGroupId: + // *NotesRequest_AccountGroupId + XAccountGroupId isNotesRequest_XAccountGroupId `protobuf_oneof:"_account_group_id"` +} + +func (m *NotesRequest) Reset() { *m = NotesRequest{} } +func (m *NotesRequest) String() string { return proto.CompactTextString(m) } +func (*NotesRequest) ProtoMessage() {} +func (*NotesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{19} +} +func (m *NotesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NotesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NotesRequest.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 *NotesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_NotesRequest.Merge(m, src) +} +func (m *NotesRequest) XXX_Size() int { + return m.Size() +} +func (m *NotesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_NotesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_NotesRequest proto.InternalMessageInfo + +type isNotesRequest_XAccountGroupId interface { + isNotesRequest_XAccountGroupId() + MarshalTo([]byte) (int, error) + Size() int +} + +type NotesRequest_AccountGroupId struct { + AccountGroupId *v1alpha11.AccountGroupId `protobuf:"bytes,14,opt,name=account_group_id,json=accountGroupId,proto3,oneof" json:"account_group_id,omitempty"` +} + +func (*NotesRequest_AccountGroupId) isNotesRequest_XAccountGroupId() {} + +func (m *NotesRequest) GetXAccountGroupId() isNotesRequest_XAccountGroupId { + if m != nil { + return m.XAccountGroupId + } + return nil +} + +func (m *NotesRequest) GetIncludeSpent() bool { + if m != nil { + return m.IncludeSpent + } + return false +} + +func (m *NotesRequest) GetAssetId() *v1alpha11.AssetId { + if m != nil { + return m.AssetId + } + return nil +} + +func (m *NotesRequest) GetAddressIndex() *v1alpha11.AddressIndex { + if m != nil { + return m.AddressIndex + } + return nil +} + +func (m *NotesRequest) GetAmountToSpend() *v1alpha11.Amount { + if m != nil { + return m.AmountToSpend + } + return nil +} + +func (m *NotesRequest) GetAccountGroupId() *v1alpha11.AccountGroupId { + if x, ok := m.GetXAccountGroupId().(*NotesRequest_AccountGroupId); ok { + return x.AccountGroupId + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*NotesRequest) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*NotesRequest_AccountGroupId)(nil), + } +} + +// A query for notes to be used for voting on a proposal. +type NotesForVotingRequest struct { + // The starting height of the proposal. + VotableAtHeight uint64 `protobuf:"varint,1,opt,name=votable_at_height,json=votableAtHeight,proto3" json:"votable_at_height,omitempty"` + // If set, only return notes with the specified asset id. + AddressIndex *v1alpha11.AddressIndex `protobuf:"bytes,3,opt,name=address_index,json=addressIndex,proto3" json:"address_index,omitempty"` + // Types that are valid to be assigned to XAccountGroupId: + // *NotesForVotingRequest_AccountGroupId + XAccountGroupId isNotesForVotingRequest_XAccountGroupId `protobuf_oneof:"_account_group_id"` +} + +func (m *NotesForVotingRequest) Reset() { *m = NotesForVotingRequest{} } +func (m *NotesForVotingRequest) String() string { return proto.CompactTextString(m) } +func (*NotesForVotingRequest) ProtoMessage() {} +func (*NotesForVotingRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{20} +} +func (m *NotesForVotingRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NotesForVotingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NotesForVotingRequest.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 *NotesForVotingRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_NotesForVotingRequest.Merge(m, src) +} +func (m *NotesForVotingRequest) XXX_Size() int { + return m.Size() +} +func (m *NotesForVotingRequest) XXX_DiscardUnknown() { + xxx_messageInfo_NotesForVotingRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_NotesForVotingRequest proto.InternalMessageInfo + +type isNotesForVotingRequest_XAccountGroupId interface { + isNotesForVotingRequest_XAccountGroupId() + MarshalTo([]byte) (int, error) + Size() int +} + +type NotesForVotingRequest_AccountGroupId struct { + AccountGroupId *v1alpha11.AccountGroupId `protobuf:"bytes,14,opt,name=account_group_id,json=accountGroupId,proto3,oneof" json:"account_group_id,omitempty"` +} + +func (*NotesForVotingRequest_AccountGroupId) isNotesForVotingRequest_XAccountGroupId() {} + +func (m *NotesForVotingRequest) GetXAccountGroupId() isNotesForVotingRequest_XAccountGroupId { + if m != nil { + return m.XAccountGroupId + } + return nil +} + +func (m *NotesForVotingRequest) GetVotableAtHeight() uint64 { + if m != nil { + return m.VotableAtHeight + } + return 0 +} + +func (m *NotesForVotingRequest) GetAddressIndex() *v1alpha11.AddressIndex { + if m != nil { + return m.AddressIndex + } + return nil +} + +func (m *NotesForVotingRequest) GetAccountGroupId() *v1alpha11.AccountGroupId { + if x, ok := m.GetXAccountGroupId().(*NotesForVotingRequest_AccountGroupId); ok { + return x.AccountGroupId + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*NotesForVotingRequest) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*NotesForVotingRequest_AccountGroupId)(nil), + } +} + +type WitnessRequest struct { + // The note commitments to obtain auth paths for. + NoteCommitments []*v1alpha11.StateCommitment `protobuf:"bytes,2,rep,name=note_commitments,json=noteCommitments,proto3" json:"note_commitments,omitempty"` + // The transaction plan to witness + TransactionPlan *v1alpha1.TransactionPlan `protobuf:"bytes,3,opt,name=transaction_plan,json=transactionPlan,proto3" json:"transaction_plan,omitempty"` + // Types that are valid to be assigned to XAccountGroupId: + // *WitnessRequest_AccountGroupId + XAccountGroupId isWitnessRequest_XAccountGroupId `protobuf_oneof:"_account_group_id"` +} + +func (m *WitnessRequest) Reset() { *m = WitnessRequest{} } +func (m *WitnessRequest) String() string { return proto.CompactTextString(m) } +func (*WitnessRequest) ProtoMessage() {} +func (*WitnessRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{21} +} +func (m *WitnessRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WitnessRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WitnessRequest.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 *WitnessRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_WitnessRequest.Merge(m, src) +} +func (m *WitnessRequest) XXX_Size() int { + return m.Size() +} +func (m *WitnessRequest) XXX_DiscardUnknown() { + xxx_messageInfo_WitnessRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_WitnessRequest proto.InternalMessageInfo + +type isWitnessRequest_XAccountGroupId interface { + isWitnessRequest_XAccountGroupId() + MarshalTo([]byte) (int, error) + Size() int +} + +type WitnessRequest_AccountGroupId struct { + AccountGroupId *v1alpha11.AccountGroupId `protobuf:"bytes,14,opt,name=account_group_id,json=accountGroupId,proto3,oneof" json:"account_group_id,omitempty"` +} + +func (*WitnessRequest_AccountGroupId) isWitnessRequest_XAccountGroupId() {} + +func (m *WitnessRequest) GetXAccountGroupId() isWitnessRequest_XAccountGroupId { + if m != nil { + return m.XAccountGroupId + } + return nil +} + +func (m *WitnessRequest) GetNoteCommitments() []*v1alpha11.StateCommitment { + if m != nil { + return m.NoteCommitments + } + return nil +} + +func (m *WitnessRequest) GetTransactionPlan() *v1alpha1.TransactionPlan { + if m != nil { + return m.TransactionPlan + } + return nil +} + +func (m *WitnessRequest) GetAccountGroupId() *v1alpha11.AccountGroupId { + if x, ok := m.GetXAccountGroupId().(*WitnessRequest_AccountGroupId); ok { + return x.AccountGroupId + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*WitnessRequest) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*WitnessRequest_AccountGroupId)(nil), + } +} + +type WitnessResponse struct { + WitnessData *v1alpha1.WitnessData `protobuf:"bytes,1,opt,name=witness_data,json=witnessData,proto3" json:"witness_data,omitempty"` +} + +func (m *WitnessResponse) Reset() { *m = WitnessResponse{} } +func (m *WitnessResponse) String() string { return proto.CompactTextString(m) } +func (*WitnessResponse) ProtoMessage() {} +func (*WitnessResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{22} +} +func (m *WitnessResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WitnessResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WitnessResponse.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 *WitnessResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_WitnessResponse.Merge(m, src) +} +func (m *WitnessResponse) XXX_Size() int { + return m.Size() +} +func (m *WitnessResponse) XXX_DiscardUnknown() { + xxx_messageInfo_WitnessResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_WitnessResponse proto.InternalMessageInfo + +func (m *WitnessResponse) GetWitnessData() *v1alpha1.WitnessData { + if m != nil { + return m.WitnessData + } + return nil +} + +type WitnessAndBuildRequest struct { + TransactionPlan *v1alpha1.TransactionPlan `protobuf:"bytes,1,opt,name=transaction_plan,json=transactionPlan,proto3" json:"transaction_plan,omitempty"` + AuthorizationData *v1alpha1.AuthorizationData `protobuf:"bytes,2,opt,name=authorization_data,json=authorizationData,proto3" json:"authorization_data,omitempty"` +} + +func (m *WitnessAndBuildRequest) Reset() { *m = WitnessAndBuildRequest{} } +func (m *WitnessAndBuildRequest) String() string { return proto.CompactTextString(m) } +func (*WitnessAndBuildRequest) ProtoMessage() {} +func (*WitnessAndBuildRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{23} +} +func (m *WitnessAndBuildRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WitnessAndBuildRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WitnessAndBuildRequest.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 *WitnessAndBuildRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_WitnessAndBuildRequest.Merge(m, src) +} +func (m *WitnessAndBuildRequest) XXX_Size() int { + return m.Size() +} +func (m *WitnessAndBuildRequest) XXX_DiscardUnknown() { + xxx_messageInfo_WitnessAndBuildRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_WitnessAndBuildRequest proto.InternalMessageInfo + +func (m *WitnessAndBuildRequest) GetTransactionPlan() *v1alpha1.TransactionPlan { + if m != nil { + return m.TransactionPlan + } + return nil +} + +func (m *WitnessAndBuildRequest) GetAuthorizationData() *v1alpha1.AuthorizationData { + if m != nil { + return m.AuthorizationData + } + return nil +} + +type WitnessAndBuildResponse struct { + Transaction *v1alpha1.Transaction `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"` +} + +func (m *WitnessAndBuildResponse) Reset() { *m = WitnessAndBuildResponse{} } +func (m *WitnessAndBuildResponse) String() string { return proto.CompactTextString(m) } +func (*WitnessAndBuildResponse) ProtoMessage() {} +func (*WitnessAndBuildResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{24} +} +func (m *WitnessAndBuildResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WitnessAndBuildResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WitnessAndBuildResponse.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 *WitnessAndBuildResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_WitnessAndBuildResponse.Merge(m, src) +} +func (m *WitnessAndBuildResponse) XXX_Size() int { + return m.Size() +} +func (m *WitnessAndBuildResponse) XXX_DiscardUnknown() { + xxx_messageInfo_WitnessAndBuildResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_WitnessAndBuildResponse proto.InternalMessageInfo + +func (m *WitnessAndBuildResponse) GetTransaction() *v1alpha1.Transaction { + if m != nil { + return m.Transaction + } + return nil +} + +// Requests all assets known to the view service. +type AssetsRequest struct { + // If set to false (default), returns all assets, regardless of whether the rest of the fields of + // the request indicate a filter. + Filtered bool `protobuf:"varint,1,opt,name=filtered,proto3" json:"filtered,omitempty"` + // Include these specific denominations in the response. + IncludeSpecificDenominations []*v1alpha11.Denom `protobuf:"bytes,2,rep,name=include_specific_denominations,json=includeSpecificDenominations,proto3" json:"include_specific_denominations,omitempty"` + // Include all delegation tokens, to any validator, in the response. + IncludeDelegationTokens bool `protobuf:"varint,3,opt,name=include_delegation_tokens,json=includeDelegationTokens,proto3" json:"include_delegation_tokens,omitempty"` + // Include all unbonding tokens, from any validator, in the response. + IncludeUnbondingTokens bool `protobuf:"varint,4,opt,name=include_unbonding_tokens,json=includeUnbondingTokens,proto3" json:"include_unbonding_tokens,omitempty"` + // Include all LP NFTs in the response. + IncludeLpNfts bool `protobuf:"varint,5,opt,name=include_lp_nfts,json=includeLpNfts,proto3" json:"include_lp_nfts,omitempty"` + // Include all proposal NFTs in the response. + IncludeProposalNfts bool `protobuf:"varint,6,opt,name=include_proposal_nfts,json=includeProposalNfts,proto3" json:"include_proposal_nfts,omitempty"` + // Include all voting receipt tokens in the response. + IncludeVotingReceiptTokens bool `protobuf:"varint,7,opt,name=include_voting_receipt_tokens,json=includeVotingReceiptTokens,proto3" json:"include_voting_receipt_tokens,omitempty"` +} + +func (m *AssetsRequest) Reset() { *m = AssetsRequest{} } +func (m *AssetsRequest) String() string { return proto.CompactTextString(m) } +func (*AssetsRequest) ProtoMessage() {} +func (*AssetsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{25} +} +func (m *AssetsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AssetsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AssetsRequest.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 *AssetsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AssetsRequest.Merge(m, src) +} +func (m *AssetsRequest) XXX_Size() int { + return m.Size() +} +func (m *AssetsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AssetsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AssetsRequest proto.InternalMessageInfo + +func (m *AssetsRequest) GetFiltered() bool { + if m != nil { + return m.Filtered + } + return false +} + +func (m *AssetsRequest) GetIncludeSpecificDenominations() []*v1alpha11.Denom { + if m != nil { + return m.IncludeSpecificDenominations + } + return nil +} + +func (m *AssetsRequest) GetIncludeDelegationTokens() bool { + if m != nil { + return m.IncludeDelegationTokens + } + return false +} + +func (m *AssetsRequest) GetIncludeUnbondingTokens() bool { + if m != nil { + return m.IncludeUnbondingTokens + } + return false +} + +func (m *AssetsRequest) GetIncludeLpNfts() bool { + if m != nil { + return m.IncludeLpNfts + } + return false +} + +func (m *AssetsRequest) GetIncludeProposalNfts() bool { + if m != nil { + return m.IncludeProposalNfts + } + return false +} + +func (m *AssetsRequest) GetIncludeVotingReceiptTokens() bool { + if m != nil { + return m.IncludeVotingReceiptTokens + } + return false +} + +// Requests all assets known to the view service. +type AssetsResponse struct { + Asset *v1alpha11.Asset `protobuf:"bytes,1,opt,name=asset,proto3" json:"asset,omitempty"` +} + +func (m *AssetsResponse) Reset() { *m = AssetsResponse{} } +func (m *AssetsResponse) String() string { return proto.CompactTextString(m) } +func (*AssetsResponse) ProtoMessage() {} +func (*AssetsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{26} +} +func (m *AssetsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AssetsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AssetsResponse.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 *AssetsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AssetsResponse.Merge(m, src) +} +func (m *AssetsResponse) XXX_Size() int { + return m.Size() +} +func (m *AssetsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AssetsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AssetsResponse proto.InternalMessageInfo + +func (m *AssetsResponse) GetAsset() *v1alpha11.Asset { + if m != nil { + return m.Asset + } + return nil +} + +// Requests the current chain parameters from the view service. +type ChainParametersRequest struct { +} + +func (m *ChainParametersRequest) Reset() { *m = ChainParametersRequest{} } +func (m *ChainParametersRequest) String() string { return proto.CompactTextString(m) } +func (*ChainParametersRequest) ProtoMessage() {} +func (*ChainParametersRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{27} +} +func (m *ChainParametersRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ChainParametersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ChainParametersRequest.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 *ChainParametersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChainParametersRequest.Merge(m, src) +} +func (m *ChainParametersRequest) XXX_Size() int { + return m.Size() +} +func (m *ChainParametersRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ChainParametersRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ChainParametersRequest proto.InternalMessageInfo + +type ChainParametersResponse struct { + Parameters *v1alpha13.ChainParameters `protobuf:"bytes,1,opt,name=parameters,proto3" json:"parameters,omitempty"` +} + +func (m *ChainParametersResponse) Reset() { *m = ChainParametersResponse{} } +func (m *ChainParametersResponse) String() string { return proto.CompactTextString(m) } +func (*ChainParametersResponse) ProtoMessage() {} +func (*ChainParametersResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{28} +} +func (m *ChainParametersResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ChainParametersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ChainParametersResponse.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 *ChainParametersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChainParametersResponse.Merge(m, src) +} +func (m *ChainParametersResponse) XXX_Size() int { + return m.Size() +} +func (m *ChainParametersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ChainParametersResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ChainParametersResponse proto.InternalMessageInfo + +func (m *ChainParametersResponse) GetParameters() *v1alpha13.ChainParameters { + if m != nil { + return m.Parameters + } + return nil +} + +// Requests the current FMD parameters from the view service. +type FMDParametersRequest struct { +} + +func (m *FMDParametersRequest) Reset() { *m = FMDParametersRequest{} } +func (m *FMDParametersRequest) String() string { return proto.CompactTextString(m) } +func (*FMDParametersRequest) ProtoMessage() {} +func (*FMDParametersRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{29} +} +func (m *FMDParametersRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FMDParametersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FMDParametersRequest.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 *FMDParametersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_FMDParametersRequest.Merge(m, src) +} +func (m *FMDParametersRequest) XXX_Size() int { + return m.Size() +} +func (m *FMDParametersRequest) XXX_DiscardUnknown() { + xxx_messageInfo_FMDParametersRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_FMDParametersRequest proto.InternalMessageInfo + +type FMDParametersResponse struct { + Parameters *v1alpha13.FmdParameters `protobuf:"bytes,1,opt,name=parameters,proto3" json:"parameters,omitempty"` +} + +func (m *FMDParametersResponse) Reset() { *m = FMDParametersResponse{} } +func (m *FMDParametersResponse) String() string { return proto.CompactTextString(m) } +func (*FMDParametersResponse) ProtoMessage() {} +func (*FMDParametersResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{30} +} +func (m *FMDParametersResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FMDParametersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FMDParametersResponse.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 *FMDParametersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_FMDParametersResponse.Merge(m, src) +} +func (m *FMDParametersResponse) XXX_Size() int { + return m.Size() +} +func (m *FMDParametersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_FMDParametersResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_FMDParametersResponse proto.InternalMessageInfo + +func (m *FMDParametersResponse) GetParameters() *v1alpha13.FmdParameters { + if m != nil { + return m.Parameters + } + return nil +} + +type NoteByCommitmentRequest struct { + NoteCommitment *v1alpha11.StateCommitment `protobuf:"bytes,2,opt,name=note_commitment,json=noteCommitment,proto3" json:"note_commitment,omitempty"` + // If set to true, waits to return until the requested note is detected. + AwaitDetection bool `protobuf:"varint,3,opt,name=await_detection,json=awaitDetection,proto3" json:"await_detection,omitempty"` + // Types that are valid to be assigned to XAccountGroupId: + // *NoteByCommitmentRequest_AccountGroupId + XAccountGroupId isNoteByCommitmentRequest_XAccountGroupId `protobuf_oneof:"_account_group_id"` +} + +func (m *NoteByCommitmentRequest) Reset() { *m = NoteByCommitmentRequest{} } +func (m *NoteByCommitmentRequest) String() string { return proto.CompactTextString(m) } +func (*NoteByCommitmentRequest) ProtoMessage() {} +func (*NoteByCommitmentRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{31} +} +func (m *NoteByCommitmentRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NoteByCommitmentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NoteByCommitmentRequest.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 *NoteByCommitmentRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_NoteByCommitmentRequest.Merge(m, src) +} +func (m *NoteByCommitmentRequest) XXX_Size() int { + return m.Size() +} +func (m *NoteByCommitmentRequest) XXX_DiscardUnknown() { + xxx_messageInfo_NoteByCommitmentRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_NoteByCommitmentRequest proto.InternalMessageInfo + +type isNoteByCommitmentRequest_XAccountGroupId interface { + isNoteByCommitmentRequest_XAccountGroupId() + MarshalTo([]byte) (int, error) + Size() int +} + +type NoteByCommitmentRequest_AccountGroupId struct { + AccountGroupId *v1alpha11.AccountGroupId `protobuf:"bytes,14,opt,name=account_group_id,json=accountGroupId,proto3,oneof" json:"account_group_id,omitempty"` +} + +func (*NoteByCommitmentRequest_AccountGroupId) isNoteByCommitmentRequest_XAccountGroupId() {} + +func (m *NoteByCommitmentRequest) GetXAccountGroupId() isNoteByCommitmentRequest_XAccountGroupId { + if m != nil { + return m.XAccountGroupId + } + return nil +} + +func (m *NoteByCommitmentRequest) GetNoteCommitment() *v1alpha11.StateCommitment { + if m != nil { + return m.NoteCommitment + } + return nil +} + +func (m *NoteByCommitmentRequest) GetAwaitDetection() bool { + if m != nil { + return m.AwaitDetection + } + return false +} + +func (m *NoteByCommitmentRequest) GetAccountGroupId() *v1alpha11.AccountGroupId { + if x, ok := m.GetXAccountGroupId().(*NoteByCommitmentRequest_AccountGroupId); ok { + return x.AccountGroupId + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*NoteByCommitmentRequest) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*NoteByCommitmentRequest_AccountGroupId)(nil), + } +} + +type NoteByCommitmentResponse struct { + SpendableNote *SpendableNoteRecord `protobuf:"bytes,1,opt,name=spendable_note,json=spendableNote,proto3" json:"spendable_note,omitempty"` +} + +func (m *NoteByCommitmentResponse) Reset() { *m = NoteByCommitmentResponse{} } +func (m *NoteByCommitmentResponse) String() string { return proto.CompactTextString(m) } +func (*NoteByCommitmentResponse) ProtoMessage() {} +func (*NoteByCommitmentResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{32} +} +func (m *NoteByCommitmentResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NoteByCommitmentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NoteByCommitmentResponse.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 *NoteByCommitmentResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_NoteByCommitmentResponse.Merge(m, src) +} +func (m *NoteByCommitmentResponse) XXX_Size() int { + return m.Size() +} +func (m *NoteByCommitmentResponse) XXX_DiscardUnknown() { + xxx_messageInfo_NoteByCommitmentResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_NoteByCommitmentResponse proto.InternalMessageInfo + +func (m *NoteByCommitmentResponse) GetSpendableNote() *SpendableNoteRecord { + if m != nil { + return m.SpendableNote + } + return nil +} + +type SwapByCommitmentRequest struct { + SwapCommitment *v1alpha11.StateCommitment `protobuf:"bytes,2,opt,name=swap_commitment,json=swapCommitment,proto3" json:"swap_commitment,omitempty"` + // If set to true, waits to return until the requested swap is detected. + AwaitDetection bool `protobuf:"varint,3,opt,name=await_detection,json=awaitDetection,proto3" json:"await_detection,omitempty"` + // Types that are valid to be assigned to XAccountGroupId: + // *SwapByCommitmentRequest_AccountGroupId + XAccountGroupId isSwapByCommitmentRequest_XAccountGroupId `protobuf_oneof:"_account_group_id"` +} + +func (m *SwapByCommitmentRequest) Reset() { *m = SwapByCommitmentRequest{} } +func (m *SwapByCommitmentRequest) String() string { return proto.CompactTextString(m) } +func (*SwapByCommitmentRequest) ProtoMessage() {} +func (*SwapByCommitmentRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{33} +} +func (m *SwapByCommitmentRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SwapByCommitmentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SwapByCommitmentRequest.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 *SwapByCommitmentRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SwapByCommitmentRequest.Merge(m, src) +} +func (m *SwapByCommitmentRequest) XXX_Size() int { + return m.Size() +} +func (m *SwapByCommitmentRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SwapByCommitmentRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_SwapByCommitmentRequest proto.InternalMessageInfo + +type isSwapByCommitmentRequest_XAccountGroupId interface { + isSwapByCommitmentRequest_XAccountGroupId() + MarshalTo([]byte) (int, error) + Size() int +} + +type SwapByCommitmentRequest_AccountGroupId struct { + AccountGroupId *v1alpha11.AccountGroupId `protobuf:"bytes,14,opt,name=account_group_id,json=accountGroupId,proto3,oneof" json:"account_group_id,omitempty"` +} + +func (*SwapByCommitmentRequest_AccountGroupId) isSwapByCommitmentRequest_XAccountGroupId() {} + +func (m *SwapByCommitmentRequest) GetXAccountGroupId() isSwapByCommitmentRequest_XAccountGroupId { + if m != nil { + return m.XAccountGroupId + } + return nil +} + +func (m *SwapByCommitmentRequest) GetSwapCommitment() *v1alpha11.StateCommitment { + if m != nil { + return m.SwapCommitment + } + return nil +} + +func (m *SwapByCommitmentRequest) GetAwaitDetection() bool { + if m != nil { + return m.AwaitDetection + } + return false +} + +func (m *SwapByCommitmentRequest) GetAccountGroupId() *v1alpha11.AccountGroupId { + if x, ok := m.GetXAccountGroupId().(*SwapByCommitmentRequest_AccountGroupId); ok { + return x.AccountGroupId + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*SwapByCommitmentRequest) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*SwapByCommitmentRequest_AccountGroupId)(nil), + } +} + +type SwapByCommitmentResponse struct { + Swap *SwapRecord `protobuf:"bytes,1,opt,name=swap,proto3" json:"swap,omitempty"` +} + +func (m *SwapByCommitmentResponse) Reset() { *m = SwapByCommitmentResponse{} } +func (m *SwapByCommitmentResponse) String() string { return proto.CompactTextString(m) } +func (*SwapByCommitmentResponse) ProtoMessage() {} +func (*SwapByCommitmentResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{34} +} +func (m *SwapByCommitmentResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SwapByCommitmentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SwapByCommitmentResponse.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 *SwapByCommitmentResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SwapByCommitmentResponse.Merge(m, src) +} +func (m *SwapByCommitmentResponse) XXX_Size() int { + return m.Size() +} +func (m *SwapByCommitmentResponse) XXX_DiscardUnknown() { + xxx_messageInfo_SwapByCommitmentResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_SwapByCommitmentResponse proto.InternalMessageInfo + +func (m *SwapByCommitmentResponse) GetSwap() *SwapRecord { + if m != nil { + return m.Swap + } + return nil +} + +type NullifierStatusRequest struct { + Nullifier *v1alpha11.Nullifier `protobuf:"bytes,2,opt,name=nullifier,proto3" json:"nullifier,omitempty"` + AwaitDetection bool `protobuf:"varint,3,opt,name=await_detection,json=awaitDetection,proto3" json:"await_detection,omitempty"` + // Types that are valid to be assigned to XAccountGroupId: + // *NullifierStatusRequest_AccountGroupId + XAccountGroupId isNullifierStatusRequest_XAccountGroupId `protobuf_oneof:"_account_group_id"` +} + +func (m *NullifierStatusRequest) Reset() { *m = NullifierStatusRequest{} } +func (m *NullifierStatusRequest) String() string { return proto.CompactTextString(m) } +func (*NullifierStatusRequest) ProtoMessage() {} +func (*NullifierStatusRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{35} +} +func (m *NullifierStatusRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NullifierStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NullifierStatusRequest.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 *NullifierStatusRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_NullifierStatusRequest.Merge(m, src) +} +func (m *NullifierStatusRequest) XXX_Size() int { + return m.Size() +} +func (m *NullifierStatusRequest) XXX_DiscardUnknown() { + xxx_messageInfo_NullifierStatusRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_NullifierStatusRequest proto.InternalMessageInfo + +type isNullifierStatusRequest_XAccountGroupId interface { + isNullifierStatusRequest_XAccountGroupId() + MarshalTo([]byte) (int, error) + Size() int +} + +type NullifierStatusRequest_AccountGroupId struct { + AccountGroupId *v1alpha11.AccountGroupId `protobuf:"bytes,14,opt,name=account_group_id,json=accountGroupId,proto3,oneof" json:"account_group_id,omitempty"` +} + +func (*NullifierStatusRequest_AccountGroupId) isNullifierStatusRequest_XAccountGroupId() {} + +func (m *NullifierStatusRequest) GetXAccountGroupId() isNullifierStatusRequest_XAccountGroupId { + if m != nil { + return m.XAccountGroupId + } + return nil +} + +func (m *NullifierStatusRequest) GetNullifier() *v1alpha11.Nullifier { + if m != nil { + return m.Nullifier + } + return nil +} + +func (m *NullifierStatusRequest) GetAwaitDetection() bool { + if m != nil { + return m.AwaitDetection + } + return false +} + +func (m *NullifierStatusRequest) GetAccountGroupId() *v1alpha11.AccountGroupId { + if x, ok := m.GetXAccountGroupId().(*NullifierStatusRequest_AccountGroupId); ok { + return x.AccountGroupId + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*NullifierStatusRequest) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*NullifierStatusRequest_AccountGroupId)(nil), + } +} + +type NullifierStatusResponse struct { + Spent bool `protobuf:"varint,1,opt,name=spent,proto3" json:"spent,omitempty"` +} + +func (m *NullifierStatusResponse) Reset() { *m = NullifierStatusResponse{} } +func (m *NullifierStatusResponse) String() string { return proto.CompactTextString(m) } +func (*NullifierStatusResponse) ProtoMessage() {} +func (*NullifierStatusResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{36} +} +func (m *NullifierStatusResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NullifierStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NullifierStatusResponse.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 *NullifierStatusResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_NullifierStatusResponse.Merge(m, src) +} +func (m *NullifierStatusResponse) XXX_Size() int { + return m.Size() +} +func (m *NullifierStatusResponse) XXX_DiscardUnknown() { + xxx_messageInfo_NullifierStatusResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_NullifierStatusResponse proto.InternalMessageInfo + +func (m *NullifierStatusResponse) GetSpent() bool { + if m != nil { + return m.Spent + } + return false +} + +type TransactionInfoByHashRequest struct { + // The transaction hash to query for. + Id *v1alpha1.Id `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *TransactionInfoByHashRequest) Reset() { *m = TransactionInfoByHashRequest{} } +func (m *TransactionInfoByHashRequest) String() string { return proto.CompactTextString(m) } +func (*TransactionInfoByHashRequest) ProtoMessage() {} +func (*TransactionInfoByHashRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{37} +} +func (m *TransactionInfoByHashRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TransactionInfoByHashRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TransactionInfoByHashRequest.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 *TransactionInfoByHashRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransactionInfoByHashRequest.Merge(m, src) +} +func (m *TransactionInfoByHashRequest) XXX_Size() int { + return m.Size() +} +func (m *TransactionInfoByHashRequest) XXX_DiscardUnknown() { + xxx_messageInfo_TransactionInfoByHashRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_TransactionInfoByHashRequest proto.InternalMessageInfo + +func (m *TransactionInfoByHashRequest) GetId() *v1alpha1.Id { + if m != nil { + return m.Id + } + return nil +} + +type TransactionInfoRequest struct { + // Types that are valid to be assigned to XStartHeight: + // *TransactionInfoRequest_StartHeight + XStartHeight isTransactionInfoRequest_XStartHeight `protobuf_oneof:"_start_height"` + // Types that are valid to be assigned to XEndHeight: + // *TransactionInfoRequest_EndHeight + XEndHeight isTransactionInfoRequest_XEndHeight `protobuf_oneof:"_end_height"` +} + +func (m *TransactionInfoRequest) Reset() { *m = TransactionInfoRequest{} } +func (m *TransactionInfoRequest) String() string { return proto.CompactTextString(m) } +func (*TransactionInfoRequest) ProtoMessage() {} +func (*TransactionInfoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{38} +} +func (m *TransactionInfoRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TransactionInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TransactionInfoRequest.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 *TransactionInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransactionInfoRequest.Merge(m, src) +} +func (m *TransactionInfoRequest) XXX_Size() int { + return m.Size() +} +func (m *TransactionInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_TransactionInfoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_TransactionInfoRequest proto.InternalMessageInfo + +type isTransactionInfoRequest_XStartHeight interface { + isTransactionInfoRequest_XStartHeight() + MarshalTo([]byte) (int, error) + Size() int +} +type isTransactionInfoRequest_XEndHeight interface { + isTransactionInfoRequest_XEndHeight() + MarshalTo([]byte) (int, error) + Size() int +} + +type TransactionInfoRequest_StartHeight struct { + StartHeight uint64 `protobuf:"varint,1,opt,name=start_height,json=startHeight,proto3,oneof" json:"start_height,omitempty"` +} +type TransactionInfoRequest_EndHeight struct { + EndHeight uint64 `protobuf:"varint,2,opt,name=end_height,json=endHeight,proto3,oneof" json:"end_height,omitempty"` +} + +func (*TransactionInfoRequest_StartHeight) isTransactionInfoRequest_XStartHeight() {} +func (*TransactionInfoRequest_EndHeight) isTransactionInfoRequest_XEndHeight() {} + +func (m *TransactionInfoRequest) GetXStartHeight() isTransactionInfoRequest_XStartHeight { + if m != nil { + return m.XStartHeight + } + return nil +} +func (m *TransactionInfoRequest) GetXEndHeight() isTransactionInfoRequest_XEndHeight { + if m != nil { + return m.XEndHeight + } + return nil +} + +func (m *TransactionInfoRequest) GetStartHeight() uint64 { + if x, ok := m.GetXStartHeight().(*TransactionInfoRequest_StartHeight); ok { + return x.StartHeight + } + return 0 +} + +func (m *TransactionInfoRequest) GetEndHeight() uint64 { + if x, ok := m.GetXEndHeight().(*TransactionInfoRequest_EndHeight); ok { + return x.EndHeight + } + return 0 +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*TransactionInfoRequest) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*TransactionInfoRequest_StartHeight)(nil), + (*TransactionInfoRequest_EndHeight)(nil), + } +} + +type TransactionInfo struct { + // Types that are valid to be assigned to XHeight: + // *TransactionInfo_Height + XHeight isTransactionInfo_XHeight `protobuf_oneof:"_height"` + // The hash of the transaction. + Id *v1alpha1.Id `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + // The transaction data itself. + Transaction *v1alpha1.Transaction `protobuf:"bytes,3,opt,name=transaction,proto3" json:"transaction,omitempty"` + // The transaction perspective, as seen by this view server. + Perspective *v1alpha1.TransactionPerspective `protobuf:"bytes,4,opt,name=perspective,proto3" json:"perspective,omitempty"` + // A precomputed transaction view of `transaction` from `perspective`, included for convenience of clients that don't have support for viewing transactions on their own. + View *v1alpha1.TransactionView `protobuf:"bytes,5,opt,name=view,proto3" json:"view,omitempty"` +} + +func (m *TransactionInfo) Reset() { *m = TransactionInfo{} } +func (m *TransactionInfo) String() string { return proto.CompactTextString(m) } +func (*TransactionInfo) ProtoMessage() {} +func (*TransactionInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{39} +} +func (m *TransactionInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TransactionInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TransactionInfo.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 *TransactionInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransactionInfo.Merge(m, src) +} +func (m *TransactionInfo) XXX_Size() int { + return m.Size() +} +func (m *TransactionInfo) XXX_DiscardUnknown() { + xxx_messageInfo_TransactionInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_TransactionInfo proto.InternalMessageInfo + +type isTransactionInfo_XHeight interface { + isTransactionInfo_XHeight() + MarshalTo([]byte) (int, error) + Size() int +} + +type TransactionInfo_Height struct { + Height uint64 `protobuf:"varint,1,opt,name=height,proto3,oneof" json:"height,omitempty"` +} + +func (*TransactionInfo_Height) isTransactionInfo_XHeight() {} + +func (m *TransactionInfo) GetXHeight() isTransactionInfo_XHeight { + if m != nil { + return m.XHeight + } + return nil +} + +func (m *TransactionInfo) GetHeight() uint64 { + if x, ok := m.GetXHeight().(*TransactionInfo_Height); ok { + return x.Height + } + return 0 +} + +func (m *TransactionInfo) GetId() *v1alpha1.Id { + if m != nil { + return m.Id + } + return nil +} + +func (m *TransactionInfo) GetTransaction() *v1alpha1.Transaction { + if m != nil { + return m.Transaction + } + return nil +} + +func (m *TransactionInfo) GetPerspective() *v1alpha1.TransactionPerspective { + if m != nil { + return m.Perspective + } + return nil +} + +func (m *TransactionInfo) GetView() *v1alpha1.TransactionView { + if m != nil { + return m.View + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*TransactionInfo) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*TransactionInfo_Height)(nil), + } +} + +type TransactionInfoResponse struct { + TxInfo *TransactionInfo `protobuf:"bytes,1,opt,name=tx_info,json=txInfo,proto3" json:"tx_info,omitempty"` +} + +func (m *TransactionInfoResponse) Reset() { *m = TransactionInfoResponse{} } +func (m *TransactionInfoResponse) String() string { return proto.CompactTextString(m) } +func (*TransactionInfoResponse) ProtoMessage() {} +func (*TransactionInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{40} +} +func (m *TransactionInfoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TransactionInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TransactionInfoResponse.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 *TransactionInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransactionInfoResponse.Merge(m, src) +} +func (m *TransactionInfoResponse) XXX_Size() int { + return m.Size() +} +func (m *TransactionInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_TransactionInfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_TransactionInfoResponse proto.InternalMessageInfo + +func (m *TransactionInfoResponse) GetTxInfo() *TransactionInfo { + if m != nil { + return m.TxInfo + } + return nil +} + +type TransactionInfoByHashResponse struct { + TxInfo *TransactionInfo `protobuf:"bytes,1,opt,name=tx_info,json=txInfo,proto3" json:"tx_info,omitempty"` +} + +func (m *TransactionInfoByHashResponse) Reset() { *m = TransactionInfoByHashResponse{} } +func (m *TransactionInfoByHashResponse) String() string { return proto.CompactTextString(m) } +func (*TransactionInfoByHashResponse) ProtoMessage() {} +func (*TransactionInfoByHashResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{41} +} +func (m *TransactionInfoByHashResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TransactionInfoByHashResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TransactionInfoByHashResponse.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 *TransactionInfoByHashResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransactionInfoByHashResponse.Merge(m, src) +} +func (m *TransactionInfoByHashResponse) XXX_Size() int { + return m.Size() +} +func (m *TransactionInfoByHashResponse) XXX_DiscardUnknown() { + xxx_messageInfo_TransactionInfoByHashResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_TransactionInfoByHashResponse proto.InternalMessageInfo + +func (m *TransactionInfoByHashResponse) GetTxInfo() *TransactionInfo { + if m != nil { + return m.TxInfo + } + return nil +} + +type NotesResponse struct { + NoteRecord *SpendableNoteRecord `protobuf:"bytes,1,opt,name=note_record,json=noteRecord,proto3" json:"note_record,omitempty"` +} + +func (m *NotesResponse) Reset() { *m = NotesResponse{} } +func (m *NotesResponse) String() string { return proto.CompactTextString(m) } +func (*NotesResponse) ProtoMessage() {} +func (*NotesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{42} +} +func (m *NotesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NotesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NotesResponse.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 *NotesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_NotesResponse.Merge(m, src) +} +func (m *NotesResponse) XXX_Size() int { + return m.Size() +} +func (m *NotesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_NotesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_NotesResponse proto.InternalMessageInfo + +func (m *NotesResponse) GetNoteRecord() *SpendableNoteRecord { + if m != nil { + return m.NoteRecord + } + return nil +} + +type NotesForVotingResponse struct { + NoteRecord *SpendableNoteRecord `protobuf:"bytes,1,opt,name=note_record,json=noteRecord,proto3" json:"note_record,omitempty"` + IdentityKey *v1alpha11.IdentityKey `protobuf:"bytes,2,opt,name=identity_key,json=identityKey,proto3" json:"identity_key,omitempty"` +} + +func (m *NotesForVotingResponse) Reset() { *m = NotesForVotingResponse{} } +func (m *NotesForVotingResponse) String() string { return proto.CompactTextString(m) } +func (*NotesForVotingResponse) ProtoMessage() {} +func (*NotesForVotingResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{43} +} +func (m *NotesForVotingResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NotesForVotingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NotesForVotingResponse.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 *NotesForVotingResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_NotesForVotingResponse.Merge(m, src) +} +func (m *NotesForVotingResponse) XXX_Size() int { + return m.Size() +} +func (m *NotesForVotingResponse) XXX_DiscardUnknown() { + xxx_messageInfo_NotesForVotingResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_NotesForVotingResponse proto.InternalMessageInfo + +func (m *NotesForVotingResponse) GetNoteRecord() *SpendableNoteRecord { + if m != nil { + return m.NoteRecord + } + return nil +} + +func (m *NotesForVotingResponse) GetIdentityKey() *v1alpha11.IdentityKey { + if m != nil { + return m.IdentityKey + } + return nil +} + +// A note plaintext with associated metadata about its status. +type SpendableNoteRecord struct { + // The note commitment, identifying the note. + NoteCommitment *v1alpha11.StateCommitment `protobuf:"bytes,1,opt,name=note_commitment,json=noteCommitment,proto3" json:"note_commitment,omitempty"` + // The note plaintext itself. + Note *v1alpha11.Note `protobuf:"bytes,2,opt,name=note,proto3" json:"note,omitempty"` + // A precomputed decryption of the note's address incore.dex.v1alpha1. + AddressIndex *v1alpha11.AddressIndex `protobuf:"bytes,3,opt,name=address_index,json=addressIndex,proto3" json:"address_index,omitempty"` + // The note's nullifier. + Nullifier *v1alpha11.Nullifier `protobuf:"bytes,4,opt,name=nullifier,proto3" json:"nullifier,omitempty"` + // The height at which the note was created. + HeightCreated uint64 `protobuf:"varint,5,opt,name=height_created,json=heightCreated,proto3" json:"height_created,omitempty"` + // Types that are valid to be assigned to XHeightSpent: + // *SpendableNoteRecord_HeightSpent + XHeightSpent isSpendableNoteRecord_XHeightSpent `protobuf_oneof:"_height_spent"` + // The note position. + Position uint64 `protobuf:"varint,7,opt,name=position,proto3" json:"position,omitempty"` + // The source of the note (a tx hash or otherwise) + Source *v1alpha13.NoteSource `protobuf:"bytes,8,opt,name=source,proto3" json:"source,omitempty"` +} + +func (m *SpendableNoteRecord) Reset() { *m = SpendableNoteRecord{} } +func (m *SpendableNoteRecord) String() string { return proto.CompactTextString(m) } +func (*SpendableNoteRecord) ProtoMessage() {} +func (*SpendableNoteRecord) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{44} +} +func (m *SpendableNoteRecord) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SpendableNoteRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SpendableNoteRecord.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 *SpendableNoteRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpendableNoteRecord.Merge(m, src) +} +func (m *SpendableNoteRecord) XXX_Size() int { + return m.Size() +} +func (m *SpendableNoteRecord) XXX_DiscardUnknown() { + xxx_messageInfo_SpendableNoteRecord.DiscardUnknown(m) +} + +var xxx_messageInfo_SpendableNoteRecord proto.InternalMessageInfo + +type isSpendableNoteRecord_XHeightSpent interface { + isSpendableNoteRecord_XHeightSpent() + MarshalTo([]byte) (int, error) + Size() int +} + +type SpendableNoteRecord_HeightSpent struct { + HeightSpent uint64 `protobuf:"varint,6,opt,name=height_spent,json=heightSpent,proto3,oneof" json:"height_spent,omitempty"` +} + +func (*SpendableNoteRecord_HeightSpent) isSpendableNoteRecord_XHeightSpent() {} + +func (m *SpendableNoteRecord) GetXHeightSpent() isSpendableNoteRecord_XHeightSpent { + if m != nil { + return m.XHeightSpent + } + return nil +} + +func (m *SpendableNoteRecord) GetNoteCommitment() *v1alpha11.StateCommitment { + if m != nil { + return m.NoteCommitment + } + return nil +} + +func (m *SpendableNoteRecord) GetNote() *v1alpha11.Note { + if m != nil { + return m.Note + } + return nil +} + +func (m *SpendableNoteRecord) GetAddressIndex() *v1alpha11.AddressIndex { + if m != nil { + return m.AddressIndex + } + return nil +} + +func (m *SpendableNoteRecord) GetNullifier() *v1alpha11.Nullifier { + if m != nil { + return m.Nullifier + } + return nil +} + +func (m *SpendableNoteRecord) GetHeightCreated() uint64 { + if m != nil { + return m.HeightCreated + } + return 0 +} + +func (m *SpendableNoteRecord) GetHeightSpent() uint64 { + if x, ok := m.GetXHeightSpent().(*SpendableNoteRecord_HeightSpent); ok { + return x.HeightSpent + } + return 0 +} + +func (m *SpendableNoteRecord) GetPosition() uint64 { + if m != nil { + return m.Position + } + return 0 +} + +func (m *SpendableNoteRecord) GetSource() *v1alpha13.NoteSource { + if m != nil { + return m.Source + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*SpendableNoteRecord) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*SpendableNoteRecord_HeightSpent)(nil), + } +} + +type SwapRecord struct { + SwapCommitment *v1alpha11.StateCommitment `protobuf:"bytes,1,opt,name=swap_commitment,json=swapCommitment,proto3" json:"swap_commitment,omitempty"` + Swap *v1alpha14.SwapPlaintext `protobuf:"bytes,2,opt,name=swap,proto3" json:"swap,omitempty"` + Position uint64 `protobuf:"varint,3,opt,name=position,proto3" json:"position,omitempty"` + Nullifier *v1alpha11.Nullifier `protobuf:"bytes,4,opt,name=nullifier,proto3" json:"nullifier,omitempty"` + OutputData *v1alpha14.BatchSwapOutputData `protobuf:"bytes,5,opt,name=output_data,json=outputData,proto3" json:"output_data,omitempty"` + // Types that are valid to be assigned to XHeightClaimed: + // *SwapRecord_HeightClaimed + XHeightClaimed isSwapRecord_XHeightClaimed `protobuf_oneof:"_height_claimed"` + Source *v1alpha13.NoteSource `protobuf:"bytes,7,opt,name=source,proto3" json:"source,omitempty"` +} + +func (m *SwapRecord) Reset() { *m = SwapRecord{} } +func (m *SwapRecord) String() string { return proto.CompactTextString(m) } +func (*SwapRecord) ProtoMessage() {} +func (*SwapRecord) Descriptor() ([]byte, []int) { + return fileDescriptor_0aa947b204e6a7c2, []int{45} +} +func (m *SwapRecord) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SwapRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SwapRecord.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 *SwapRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_SwapRecord.Merge(m, src) +} +func (m *SwapRecord) XXX_Size() int { + return m.Size() +} +func (m *SwapRecord) XXX_DiscardUnknown() { + xxx_messageInfo_SwapRecord.DiscardUnknown(m) +} + +var xxx_messageInfo_SwapRecord proto.InternalMessageInfo + +type isSwapRecord_XHeightClaimed interface { + isSwapRecord_XHeightClaimed() + MarshalTo([]byte) (int, error) + Size() int +} + +type SwapRecord_HeightClaimed struct { + HeightClaimed uint64 `protobuf:"varint,6,opt,name=height_claimed,json=heightClaimed,proto3,oneof" json:"height_claimed,omitempty"` +} + +func (*SwapRecord_HeightClaimed) isSwapRecord_XHeightClaimed() {} + +func (m *SwapRecord) GetXHeightClaimed() isSwapRecord_XHeightClaimed { + if m != nil { + return m.XHeightClaimed + } + return nil +} + +func (m *SwapRecord) GetSwapCommitment() *v1alpha11.StateCommitment { + if m != nil { + return m.SwapCommitment + } + return nil +} + +func (m *SwapRecord) GetSwap() *v1alpha14.SwapPlaintext { + if m != nil { + return m.Swap + } + return nil +} + +func (m *SwapRecord) GetPosition() uint64 { + if m != nil { + return m.Position + } + return 0 +} + +func (m *SwapRecord) GetNullifier() *v1alpha11.Nullifier { + if m != nil { + return m.Nullifier + } + return nil +} + +func (m *SwapRecord) GetOutputData() *v1alpha14.BatchSwapOutputData { + if m != nil { + return m.OutputData + } + return nil +} + +func (m *SwapRecord) GetHeightClaimed() uint64 { + if x, ok := m.GetXHeightClaimed().(*SwapRecord_HeightClaimed); ok { + return x.HeightClaimed + } + return 0 +} + +func (m *SwapRecord) GetSource() *v1alpha13.NoteSource { + if m != nil { + return m.Source + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*SwapRecord) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*SwapRecord_HeightClaimed)(nil), + } +} + +func init() { + proto.RegisterType((*BroadcastTransactionRequest)(nil), "penumbra.view.v1alpha1.BroadcastTransactionRequest") + proto.RegisterType((*BroadcastTransactionResponse)(nil), "penumbra.view.v1alpha1.BroadcastTransactionResponse") + proto.RegisterType((*TransactionPlannerRequest)(nil), "penumbra.view.v1alpha1.TransactionPlannerRequest") + proto.RegisterType((*TransactionPlannerRequest_Output)(nil), "penumbra.view.v1alpha1.TransactionPlannerRequest.Output") + proto.RegisterType((*TransactionPlannerRequest_Swap)(nil), "penumbra.view.v1alpha1.TransactionPlannerRequest.Swap") + proto.RegisterType((*TransactionPlannerRequest_Delegate)(nil), "penumbra.view.v1alpha1.TransactionPlannerRequest.Delegate") + proto.RegisterType((*TransactionPlannerRequest_Undelegate)(nil), "penumbra.view.v1alpha1.TransactionPlannerRequest.Undelegate") + proto.RegisterType((*TransactionPlannerResponse)(nil), "penumbra.view.v1alpha1.TransactionPlannerResponse") + proto.RegisterType((*AddressByIndexRequest)(nil), "penumbra.view.v1alpha1.AddressByIndexRequest") + proto.RegisterType((*AddressByIndexResponse)(nil), "penumbra.view.v1alpha1.AddressByIndexResponse") + proto.RegisterType((*IndexByAddressRequest)(nil), "penumbra.view.v1alpha1.IndexByAddressRequest") + proto.RegisterType((*IndexByAddressResponse)(nil), "penumbra.view.v1alpha1.IndexByAddressResponse") + proto.RegisterType((*EphemeralAddressRequest)(nil), "penumbra.view.v1alpha1.EphemeralAddressRequest") + proto.RegisterType((*EphemeralAddressResponse)(nil), "penumbra.view.v1alpha1.EphemeralAddressResponse") + proto.RegisterType((*BalanceByAddressRequest)(nil), "penumbra.view.v1alpha1.BalanceByAddressRequest") + proto.RegisterType((*BalanceByAddressResponse)(nil), "penumbra.view.v1alpha1.BalanceByAddressResponse") + proto.RegisterType((*ViewAuthToken)(nil), "penumbra.view.v1alpha1.ViewAuthToken") + proto.RegisterType((*ViewAuthRequest)(nil), "penumbra.view.v1alpha1.ViewAuthRequest") + proto.RegisterType((*ViewAuthResponse)(nil), "penumbra.view.v1alpha1.ViewAuthResponse") + proto.RegisterType((*StatusRequest)(nil), "penumbra.view.v1alpha1.StatusRequest") + proto.RegisterType((*StatusResponse)(nil), "penumbra.view.v1alpha1.StatusResponse") + proto.RegisterType((*StatusStreamRequest)(nil), "penumbra.view.v1alpha1.StatusStreamRequest") + proto.RegisterType((*StatusStreamResponse)(nil), "penumbra.view.v1alpha1.StatusStreamResponse") + proto.RegisterType((*NotesRequest)(nil), "penumbra.view.v1alpha1.NotesRequest") + proto.RegisterType((*NotesForVotingRequest)(nil), "penumbra.view.v1alpha1.NotesForVotingRequest") + proto.RegisterType((*WitnessRequest)(nil), "penumbra.view.v1alpha1.WitnessRequest") + proto.RegisterType((*WitnessResponse)(nil), "penumbra.view.v1alpha1.WitnessResponse") + proto.RegisterType((*WitnessAndBuildRequest)(nil), "penumbra.view.v1alpha1.WitnessAndBuildRequest") + proto.RegisterType((*WitnessAndBuildResponse)(nil), "penumbra.view.v1alpha1.WitnessAndBuildResponse") + proto.RegisterType((*AssetsRequest)(nil), "penumbra.view.v1alpha1.AssetsRequest") + proto.RegisterType((*AssetsResponse)(nil), "penumbra.view.v1alpha1.AssetsResponse") + proto.RegisterType((*ChainParametersRequest)(nil), "penumbra.view.v1alpha1.ChainParametersRequest") + proto.RegisterType((*ChainParametersResponse)(nil), "penumbra.view.v1alpha1.ChainParametersResponse") + proto.RegisterType((*FMDParametersRequest)(nil), "penumbra.view.v1alpha1.FMDParametersRequest") + proto.RegisterType((*FMDParametersResponse)(nil), "penumbra.view.v1alpha1.FMDParametersResponse") + proto.RegisterType((*NoteByCommitmentRequest)(nil), "penumbra.view.v1alpha1.NoteByCommitmentRequest") + proto.RegisterType((*NoteByCommitmentResponse)(nil), "penumbra.view.v1alpha1.NoteByCommitmentResponse") + proto.RegisterType((*SwapByCommitmentRequest)(nil), "penumbra.view.v1alpha1.SwapByCommitmentRequest") + proto.RegisterType((*SwapByCommitmentResponse)(nil), "penumbra.view.v1alpha1.SwapByCommitmentResponse") + proto.RegisterType((*NullifierStatusRequest)(nil), "penumbra.view.v1alpha1.NullifierStatusRequest") + proto.RegisterType((*NullifierStatusResponse)(nil), "penumbra.view.v1alpha1.NullifierStatusResponse") + proto.RegisterType((*TransactionInfoByHashRequest)(nil), "penumbra.view.v1alpha1.TransactionInfoByHashRequest") + proto.RegisterType((*TransactionInfoRequest)(nil), "penumbra.view.v1alpha1.TransactionInfoRequest") + proto.RegisterType((*TransactionInfo)(nil), "penumbra.view.v1alpha1.TransactionInfo") + proto.RegisterType((*TransactionInfoResponse)(nil), "penumbra.view.v1alpha1.TransactionInfoResponse") + proto.RegisterType((*TransactionInfoByHashResponse)(nil), "penumbra.view.v1alpha1.TransactionInfoByHashResponse") + proto.RegisterType((*NotesResponse)(nil), "penumbra.view.v1alpha1.NotesResponse") + proto.RegisterType((*NotesForVotingResponse)(nil), "penumbra.view.v1alpha1.NotesForVotingResponse") + proto.RegisterType((*SpendableNoteRecord)(nil), "penumbra.view.v1alpha1.SpendableNoteRecord") + proto.RegisterType((*SwapRecord)(nil), "penumbra.view.v1alpha1.SwapRecord") +} + +func init() { proto.RegisterFile("penumbra/view/v1alpha1/view.proto", fileDescriptor_0aa947b204e6a7c2) } + +var fileDescriptor_0aa947b204e6a7c2 = []byte{ + // 2695 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x5a, 0xcd, 0x73, 0x23, 0x47, + 0x15, 0xf7, 0x48, 0xfe, 0x7c, 0xb2, 0x24, 0x6f, 0xaf, 0x3f, 0x14, 0x25, 0x71, 0x96, 0xc9, 0x7e, + 0x38, 0x1b, 0x22, 0x6f, 0x9c, 0x4d, 0x08, 0x4e, 0x52, 0xc4, 0x8a, 0xf1, 0xda, 0x95, 0xdd, 0xc4, + 0x8c, 0xb3, 0x0e, 0x49, 0x1c, 0xa6, 0xda, 0x33, 0x6d, 0x6b, 0xf0, 0x68, 0x66, 0x32, 0xd3, 0xb2, + 0x6c, 0x38, 0x85, 0x4a, 0x51, 0x5b, 0x39, 0x50, 0xdc, 0x80, 0x2b, 0x47, 0x8a, 0x2b, 0x57, 0x2e, + 0x5c, 0x28, 0x4e, 0x39, 0x52, 0x45, 0x41, 0x51, 0x9b, 0xe2, 0x02, 0xff, 0x02, 0x55, 0x50, 0xfd, + 0x31, 0xa3, 0x99, 0x91, 0x66, 0x25, 0xd9, 0xde, 0x5a, 0x38, 0x49, 0xdd, 0xfd, 0xde, 0xef, 0xbd, + 0x7e, 0xdd, 0xfd, 0xfa, 0xbd, 0xd7, 0x03, 0xdf, 0xf0, 0x88, 0xd3, 0x6a, 0xee, 0xfb, 0x78, 0xf9, + 0xd8, 0x22, 0xed, 0xe5, 0xe3, 0x97, 0xb1, 0xed, 0x35, 0xf0, 0xcb, 0xbc, 0x55, 0xf3, 0x7c, 0x97, + 0xba, 0x68, 0x3e, 0x24, 0xa9, 0xf1, 0xce, 0x90, 0xa4, 0xba, 0x14, 0xb1, 0x1a, 0xae, 0x4f, 0x96, + 0x8d, 0x06, 0xb6, 0x9c, 0x0e, 0x00, 0x6f, 0x0a, 0x84, 0xea, 0xcd, 0x14, 0xa5, 0x7f, 0xea, 0x51, + 0x37, 0x46, 0xca, 0xdb, 0x92, 0xf6, 0x6a, 0x92, 0xd6, 0x24, 0x27, 0x1d, 0x42, 0x93, 0x9c, 0x48, + 0xaa, 0xdb, 0x49, 0x2a, 0xea, 0x63, 0x27, 0xc0, 0x06, 0xb5, 0xdc, 0x98, 0x06, 0xb1, 0xce, 0xde, + 0xd8, 0xd6, 0xbe, 0xd1, 0xa1, 0xb6, 0xf6, 0x0d, 0x41, 0xa5, 0xfe, 0x4a, 0x81, 0xa7, 0xeb, 0xbe, + 0x8b, 0x4d, 0x03, 0x07, 0xf4, 0x83, 0x0e, 0x88, 0x46, 0x3e, 0x6b, 0x91, 0x80, 0xa2, 0xef, 0x41, + 0x21, 0x06, 0x5d, 0x51, 0xae, 0x28, 0x4b, 0x85, 0x95, 0xe5, 0x5a, 0x64, 0x25, 0x86, 0x5d, 0x8b, + 0x0b, 0x0f, 0x65, 0xd4, 0xe2, 0x60, 0x71, 0x0c, 0x74, 0x03, 0xca, 0xb8, 0x8d, 0x2d, 0xaa, 0x9b, + 0x84, 0x12, 0x01, 0x9b, 0xbb, 0xa2, 0x2c, 0x4d, 0x6a, 0x25, 0xde, 0xbd, 0x1e, 0xf6, 0xaa, 0x9f, + 0x2b, 0xf0, 0x4c, 0x6f, 0xdd, 0x02, 0xcf, 0x75, 0x02, 0x82, 0x5e, 0x83, 0x9c, 0x65, 0x4a, 0x9d, + 0xae, 0x0f, 0xa2, 0xd3, 0x96, 0xa9, 0xe5, 0x2c, 0x13, 0xbd, 0x00, 0x33, 0x91, 0x6c, 0xbd, 0x41, + 0xac, 0xc3, 0x06, 0xe5, 0x2a, 0x8c, 0x6a, 0xe5, 0xa8, 0x7f, 0x93, 0x77, 0xab, 0x7f, 0x9d, 0x82, + 0xa7, 0x62, 0xa2, 0xb7, 0x6d, 0xec, 0x38, 0xc4, 0x0f, 0xad, 0xf3, 0x3c, 0x14, 0xc9, 0x89, 0x67, + 0xf9, 0xa7, 0x21, 0x8a, 0xc2, 0x51, 0xa6, 0x45, 0xa7, 0x80, 0x40, 0xb7, 0x21, 0x7f, 0x40, 0x08, + 0x17, 0x50, 0x58, 0x51, 0x53, 0x6a, 0xca, 0xed, 0x10, 0x69, 0xb8, 0x41, 0x88, 0xc6, 0xc8, 0x11, + 0x82, 0xd1, 0x26, 0x69, 0xba, 0x95, 0xfc, 0x15, 0x65, 0x69, 0x4a, 0xe3, 0xff, 0xd1, 0x1e, 0xcc, + 0x60, 0xc3, 0x70, 0x5b, 0x0e, 0xd5, 0x0f, 0x7d, 0xb7, 0xe5, 0xe9, 0x96, 0x59, 0x29, 0x71, 0xd8, + 0x97, 0xfa, 0xc0, 0xae, 0x09, 0xb6, 0x3b, 0x8c, 0x6b, 0xcb, 0xdc, 0x1c, 0xd1, 0x4a, 0x38, 0xd1, + 0xf3, 0x40, 0x51, 0x90, 0x06, 0x13, 0x6e, 0x8b, 0x7a, 0x2d, 0x1a, 0x54, 0x66, 0xaf, 0xe4, 0x97, + 0x0a, 0x2b, 0xaf, 0xd7, 0x7a, 0x1f, 0x86, 0x5a, 0xa6, 0x41, 0x6a, 0xef, 0x73, 0x00, 0x2d, 0x04, + 0x42, 0x77, 0x61, 0x2c, 0x68, 0x63, 0x2f, 0xa8, 0x2c, 0x72, 0xc4, 0xd7, 0x86, 0x47, 0xdc, 0x69, + 0x63, 0x4f, 0x13, 0x20, 0x68, 0x0f, 0x0a, 0x26, 0xb1, 0xc9, 0x21, 0x66, 0x74, 0x41, 0x65, 0x89, + 0x63, 0xae, 0x0e, 0x8f, 0xb9, 0x2e, 0x40, 0x88, 0x16, 0x87, 0x43, 0xfb, 0x50, 0x6c, 0x39, 0x71, + 0xfc, 0x15, 0x8e, 0xff, 0xe6, 0xf0, 0xf8, 0xf7, 0x43, 0x18, 0xa2, 0x25, 0x21, 0xd1, 0x06, 0x14, + 0xac, 0x7d, 0x43, 0x17, 0x5c, 0x41, 0xe5, 0x4d, 0x2e, 0xe1, 0x5a, 0x6a, 0xf1, 0xd8, 0xe9, 0xec, + 0x6c, 0xd9, 0x7d, 0x63, 0x4d, 0xec, 0x7a, 0xb0, 0xc2, 0xbf, 0x41, 0xf5, 0xa7, 0x0a, 0x8c, 0x0b, + 0x5b, 0xa3, 0x55, 0x18, 0x3b, 0xc6, 0x76, 0x8b, 0xc8, 0x73, 0x70, 0xb5, 0xcf, 0x4e, 0xd8, 0x65, + 0xb4, 0x9a, 0x60, 0x41, 0x6f, 0xc3, 0x04, 0x36, 0x4d, 0x9f, 0x04, 0x81, 0xdc, 0x9e, 0xd7, 0xfb, + 0xed, 0x23, 0x41, 0xad, 0x85, 0x6c, 0xd5, 0x3f, 0x28, 0x30, 0xca, 0x96, 0xe8, 0x5c, 0x6a, 0x6c, + 0xc1, 0x34, 0xc5, 0xfe, 0x21, 0xa1, 0x3a, 0x0e, 0x02, 0x42, 0x07, 0xd5, 0x85, 0xd1, 0x6e, 0x99, + 0x5a, 0x41, 0xf0, 0xf2, 0x66, 0x78, 0xd8, 0xf2, 0x43, 0x1d, 0xb6, 0xea, 0x2f, 0x15, 0x98, 0x0c, + 0x37, 0x05, 0x7a, 0x0b, 0xc6, 0x71, 0x93, 0x9d, 0x0d, 0x39, 0x95, 0x6b, 0xfd, 0xf4, 0xe0, 0xc4, + 0x9a, 0x64, 0x42, 0xf7, 0x60, 0xda, 0x32, 0x89, 0x43, 0x2d, 0x7a, 0xaa, 0x1f, 0x91, 0x53, 0x39, + 0x99, 0x9b, 0x7d, 0x40, 0xb6, 0x24, 0xcb, 0xbb, 0xe4, 0x54, 0x2b, 0x58, 0x9d, 0x46, 0x75, 0x13, + 0xa0, 0xb3, 0x9d, 0xce, 0x63, 0xe5, 0xfa, 0x65, 0xb8, 0xa4, 0xa7, 0xdd, 0x87, 0x4a, 0xa0, 0xda, + 0x6b, 0x1f, 0x4b, 0x07, 0x7b, 0x07, 0x46, 0x3d, 0x1b, 0x87, 0x6e, 0xff, 0x95, 0x21, 0xdd, 0x3e, + 0x43, 0xd3, 0x38, 0x80, 0x6a, 0xc1, 0x9c, 0xdc, 0x3a, 0xf5, 0xd3, 0x2d, 0xc7, 0x24, 0x27, 0xa1, + 0x07, 0xdd, 0x86, 0xa2, 0xdc, 0x4a, 0xba, 0xc5, 0xfa, 0xa5, 0xa8, 0x17, 0x07, 0xdb, 0x87, 0x02, + 0x6a, 0x1a, 0xc7, 0x5a, 0xea, 0xc7, 0x30, 0x9f, 0x16, 0x25, 0x67, 0x13, 0xdb, 0xed, 0xca, 0x99, + 0x76, 0xbb, 0xfa, 0x11, 0xcc, 0x71, 0xc8, 0xfa, 0x69, 0x38, 0x24, 0xa7, 0x71, 0x7e, 0xe8, 0xcf, + 0x15, 0x98, 0x4f, 0x63, 0x4b, 0xbd, 0xef, 0x9f, 0xdf, 0x46, 0x9b, 0x23, 0x49, 0x2b, 0x3d, 0x50, + 0x94, 0xfa, 0x0c, 0x94, 0xf4, 0x04, 0xae, 0x7a, 0x04, 0x0b, 0xdf, 0xf5, 0x1a, 0xa4, 0x49, 0x7c, + 0x6c, 0xa7, 0x26, 0x78, 0xf1, 0xeb, 0xb4, 0x07, 0x95, 0x6e, 0x61, 0x17, 0xb6, 0x52, 0x9f, 0xc0, + 0x42, 0x1d, 0xdb, 0xd8, 0x31, 0xc8, 0x63, 0x58, 0xab, 0x5f, 0x28, 0x50, 0xe9, 0x46, 0x97, 0xba, + 0xbf, 0x09, 0x63, 0xc2, 0x8b, 0x29, 0x43, 0x79, 0x31, 0xc1, 0x14, 0x73, 0x3e, 0xb9, 0x33, 0x38, + 0x1f, 0xf5, 0x1a, 0x14, 0x77, 0x2d, 0xd2, 0x5e, 0x6b, 0xd1, 0xc6, 0x07, 0xee, 0x11, 0x71, 0xd0, + 0x2c, 0x8c, 0x59, 0xec, 0x48, 0x73, 0x6d, 0xa6, 0x35, 0xd1, 0x50, 0x35, 0x28, 0x87, 0x64, 0xa1, + 0x55, 0xbe, 0x03, 0xf9, 0x83, 0xe3, 0x23, 0xa9, 0x74, 0xbf, 0x70, 0x62, 0xa3, 0x65, 0xdb, 0x0c, + 0xc0, 0x72, 0x0e, 0x99, 0xc3, 0x62, 0x9c, 0xea, 0xfb, 0x30, 0xd3, 0xc1, 0x94, 0xb6, 0x78, 0x03, + 0xc6, 0x28, 0x53, 0xa3, 0xdb, 0x93, 0x26, 0xaf, 0xd2, 0x84, 0xce, 0x9a, 0xe0, 0x51, 0x7f, 0xa2, + 0x40, 0x71, 0x87, 0x62, 0xda, 0x8a, 0x56, 0xee, 0xb1, 0xc6, 0x3f, 0xbd, 0xfd, 0xa3, 0x06, 0xa5, + 0x50, 0x07, 0x39, 0xa7, 0xe7, 0xa0, 0x10, 0x9c, 0x3a, 0x46, 0x32, 0xe2, 0x03, 0xd6, 0x25, 0xe3, + 0xbd, 0xe7, 0xa0, 0x60, 0x60, 0x6a, 0x34, 0x2c, 0xe7, 0x50, 0x6f, 0x79, 0x32, 0xb6, 0x85, 0xb0, + 0xeb, 0xbe, 0xa7, 0x3e, 0x50, 0xe0, 0xb2, 0x00, 0xdd, 0xa1, 0x3e, 0xc1, 0xcd, 0x27, 0x38, 0x3d, + 0x1f, 0x66, 0x93, 0x9a, 0xc8, 0x49, 0x7e, 0x1b, 0x9e, 0xb2, 0x31, 0x25, 0x01, 0xd5, 0x8f, 0x1c, + 0xb7, 0xed, 0xe8, 0xfb, 0xb6, 0x6b, 0x1c, 0x25, 0xa7, 0x3c, 0x2f, 0x08, 0xde, 0x65, 0xe3, 0x75, + 0x36, 0xdc, 0x99, 0x7e, 0xdc, 0x3e, 0xb9, 0xb4, 0x7d, 0xd4, 0x2f, 0xf3, 0x30, 0xfd, 0x9e, 0x4b, + 0x49, 0x10, 0x8b, 0xa2, 0x2d, 0xc7, 0xb0, 0x5b, 0x26, 0xd1, 0x03, 0x8f, 0xc8, 0xad, 0x3f, 0xa9, + 0x4d, 0xcb, 0xce, 0x1d, 0xd6, 0x87, 0xd6, 0x60, 0x92, 0x9f, 0x10, 0x66, 0x94, 0xfc, 0x50, 0x27, + 0x6b, 0x02, 0x8b, 0x3f, 0xdd, 0x3e, 0x6c, 0xf4, 0x9c, 0x3e, 0x0c, 0xdd, 0x83, 0xb2, 0x38, 0x78, + 0x3a, 0x75, 0xb9, 0xee, 0x66, 0x65, 0x7c, 0x98, 0x63, 0x5b, 0x14, 0xdc, 0x1f, 0xb8, 0x6c, 0x8e, + 0xe6, 0x93, 0xd8, 0x00, 0x0f, 0x72, 0x30, 0xc7, 0x17, 0x63, 0xc3, 0xf5, 0x77, 0x5d, 0x6a, 0x39, + 0x87, 0xe1, 0xaa, 0xdc, 0x84, 0x4b, 0xc7, 0x2e, 0xc5, 0xfb, 0x36, 0xd1, 0x31, 0x4d, 0x2e, 0x7d, + 0x59, 0x0e, 0xac, 0x51, 0xb9, 0xe6, 0x5d, 0x96, 0xcd, 0x9f, 0xd7, 0xb2, 0x4f, 0xc0, 0x14, 0xbf, + 0xcf, 0x41, 0xe9, 0x43, 0x8b, 0x3a, 0xb1, 0xab, 0xe2, 0x23, 0x98, 0x71, 0x5c, 0x4a, 0x74, 0xc3, + 0x6d, 0x36, 0x2d, 0xda, 0x24, 0x0e, 0x65, 0x81, 0x32, 0x8b, 0xd9, 0x6b, 0x7d, 0xb4, 0x60, 0xa7, + 0x8a, 0xbc, 0x13, 0xb1, 0x69, 0x65, 0x86, 0xd3, 0x69, 0x07, 0xe8, 0x07, 0x30, 0x13, 0x8b, 0x9f, + 0x74, 0x1e, 0x66, 0xe5, 0xcf, 0x1e, 0x66, 0x95, 0x69, 0xb2, 0xe3, 0x49, 0x18, 0x90, 0x40, 0x39, + 0xb2, 0x9f, 0xf4, 0x23, 0x1a, 0x4c, 0xb7, 0x45, 0x97, 0x6e, 0x62, 0x8a, 0x87, 0xa9, 0x1f, 0x48, + 0xa8, 0x75, 0x4c, 0xb1, 0x56, 0x68, 0x77, 0x1a, 0xea, 0xdf, 0x14, 0x98, 0x97, 0x83, 0x6b, 0x8e, + 0x59, 0x6f, 0x59, 0xb6, 0x19, 0xae, 0x57, 0x2f, 0xa3, 0x2a, 0x17, 0x68, 0x54, 0x13, 0x10, 0x6e, + 0xd1, 0x86, 0xeb, 0x5b, 0x3f, 0xe2, 0x09, 0x9d, 0x98, 0x94, 0xb8, 0xa9, 0x5f, 0x1d, 0x44, 0xc2, + 0x5a, 0x9c, 0x9b, 0x4f, 0xed, 0x12, 0x4e, 0x77, 0xa9, 0x36, 0x2c, 0x74, 0xcd, 0x4f, 0xda, 0xf3, + 0xe2, 0xcb, 0x31, 0xea, 0x6f, 0xf3, 0x50, 0xe4, 0xae, 0x32, 0xda, 0xf5, 0x55, 0x98, 0x3c, 0xb0, + 0x6c, 0x4a, 0x7c, 0x22, 0x8a, 0x2b, 0x93, 0x5a, 0xd4, 0x46, 0x3f, 0x84, 0xc5, 0x98, 0xaf, 0x36, + 0xac, 0x03, 0xcb, 0xd0, 0x4d, 0xe2, 0xb8, 0x4d, 0xcb, 0x91, 0x59, 0xb3, 0x38, 0x1f, 0xfd, 0x32, + 0x93, 0x75, 0xc6, 0xa3, 0x3d, 0xd3, 0x71, 0xf1, 0x1c, 0x6a, 0x3d, 0x8e, 0x84, 0x56, 0xe1, 0xa9, + 0x50, 0x56, 0x27, 0x87, 0xd6, 0x79, 0x70, 0x10, 0xf0, 0xb3, 0x32, 0xa9, 0x2d, 0x48, 0x82, 0xf5, + 0x68, 0x9c, 0x87, 0x10, 0x01, 0x7a, 0x1d, 0x2a, 0x21, 0x6f, 0xcb, 0xd9, 0x77, 0x1d, 0x93, 0xdd, + 0xc6, 0x92, 0x75, 0x94, 0xb3, 0xce, 0xcb, 0xf1, 0xfb, 0xe1, 0xb0, 0xe4, 0xbc, 0x0e, 0xe5, 0x90, + 0xd3, 0xf6, 0x74, 0xe7, 0x80, 0x06, 0x95, 0x31, 0xce, 0x10, 0x5e, 0x52, 0x77, 0xbd, 0xf7, 0x0e, + 0x68, 0x80, 0x56, 0x60, 0x2e, 0xa4, 0xf3, 0x7c, 0xd7, 0x73, 0x03, 0x6c, 0x0b, 0xea, 0x71, 0x4e, + 0x7d, 0x59, 0x0e, 0x6e, 0xcb, 0x31, 0xce, 0xb3, 0x06, 0xcf, 0x86, 0x3c, 0xc7, 0xdc, 0xd9, 0xea, + 0x3e, 0x31, 0x88, 0xe5, 0xd1, 0x50, 0xb5, 0x09, 0xce, 0x5b, 0x95, 0x44, 0xa1, 0x43, 0xe6, 0x24, + 0x42, 0x3d, 0xf5, 0x2e, 0x94, 0xc2, 0xd5, 0x92, 0x7b, 0x62, 0x35, 0x19, 0x70, 0x5e, 0x1d, 0xe4, + 0x5a, 0x94, 0xe1, 0xa6, 0x5a, 0x81, 0xf9, 0x77, 0x1a, 0xd8, 0x72, 0xb6, 0xb1, 0x8f, 0x9b, 0x84, + 0x12, 0x3f, 0xdc, 0x04, 0x6a, 0x03, 0x16, 0xba, 0x46, 0xa4, 0xc0, 0x7b, 0x00, 0x5e, 0xd4, 0x9b, + 0x15, 0x31, 0xf2, 0x8a, 0x68, 0x24, 0x34, 0x0d, 0x15, 0x03, 0x50, 0xe7, 0x61, 0x76, 0xe3, 0xde, + 0x7a, 0xb7, 0x06, 0x26, 0xcc, 0xa5, 0xfa, 0xa5, 0xfc, 0x77, 0x7b, 0xc8, 0x7f, 0xf1, 0xd1, 0xf2, + 0x37, 0x9a, 0x66, 0x86, 0xf4, 0x9f, 0xe5, 0x60, 0x81, 0x5d, 0x80, 0xf5, 0xd3, 0x98, 0xb7, 0x96, + 0x07, 0xe1, 0x43, 0x28, 0xa7, 0xdc, 0xbf, 0x3c, 0xeb, 0xc3, 0x7a, 0xff, 0x52, 0xd2, 0xfb, 0xf7, + 0x2a, 0x81, 0xe6, 0x7b, 0x95, 0x40, 0x9f, 0x84, 0x17, 0x77, 0xa0, 0xd2, 0x6d, 0x8f, 0xc8, 0x9d, + 0x97, 0x78, 0x94, 0xc3, 0xa3, 0x02, 0x36, 0xa7, 0x6e, 0xeb, 0x27, 0x03, 0xfb, 0x9d, 0x90, 0x9a, + 0x41, 0x6a, 0xc4, 0x70, 0x7d, 0x53, 0x2b, 0x06, 0xf1, 0x4e, 0xbe, 0x00, 0x3b, 0x6d, 0xec, 0x65, + 0x2c, 0x40, 0xd0, 0xc6, 0xde, 0x05, 0x2c, 0x00, 0x83, 0xf9, 0x3f, 0x59, 0x00, 0x0d, 0x2a, 0xdd, + 0xf6, 0x88, 0x2a, 0xde, 0xa3, 0x6c, 0x26, 0xd2, 0xec, 0x6a, 0xa6, 0xd9, 0xdb, 0xd8, 0x93, 0xd6, + 0xe6, 0xf4, 0xea, 0xbf, 0x15, 0x98, 0x7f, 0xaf, 0x65, 0xdb, 0xd6, 0x81, 0x45, 0xfc, 0x64, 0x52, + 0xb5, 0x01, 0x53, 0x4e, 0x38, 0x22, 0xad, 0xbb, 0xd4, 0x67, 0x6a, 0x11, 0x92, 0xd6, 0x61, 0xfd, + 0x9f, 0x36, 0xe9, 0x32, 0x2c, 0x74, 0xcd, 0x5e, 0x5a, 0x74, 0x16, 0xc6, 0x44, 0xd2, 0x21, 0x6e, + 0x3a, 0xd1, 0x50, 0x77, 0xe1, 0x99, 0xd8, 0x85, 0xb9, 0xe5, 0x1c, 0xb8, 0xf5, 0xd3, 0x4d, 0x1c, + 0x44, 0xd9, 0xb2, 0x78, 0x79, 0xc8, 0x0d, 0xfb, 0xf2, 0xa0, 0x7e, 0xa1, 0xc0, 0x7c, 0x0a, 0x38, + 0x84, 0xbc, 0x0e, 0xd3, 0x01, 0xc5, 0x7e, 0x32, 0xd4, 0xde, 0x1c, 0xd1, 0x0a, 0xbc, 0x57, 0x04, + 0xda, 0x0f, 0x14, 0x05, 0xa9, 0x00, 0xc4, 0x31, 0x13, 0xe9, 0xd5, 0xa6, 0xa2, 0x4d, 0x11, 0xc7, + 0x8c, 0x68, 0xea, 0x65, 0x28, 0xea, 0x71, 0xb0, 0x7a, 0x11, 0x0a, 0x7a, 0x87, 0x4b, 0xfd, 0x57, + 0x0e, 0xca, 0x29, 0x35, 0xd0, 0xd3, 0x30, 0x9e, 0x92, 0x2c, 0xdb, 0x4c, 0xe8, 0x19, 0xe7, 0x9b, + 0x8e, 0x57, 0xf2, 0x17, 0xf0, 0x7c, 0xb4, 0x07, 0x05, 0x8f, 0xf8, 0x2c, 0xf8, 0xa0, 0xd6, 0x31, + 0x91, 0x39, 0xdc, 0xea, 0xb0, 0xe1, 0x5d, 0x07, 0x41, 0x8b, 0xc3, 0xa1, 0x3b, 0x30, 0xca, 0x8e, + 0x12, 0xbf, 0xf2, 0x87, 0x8f, 0x1a, 0x77, 0x2d, 0xd2, 0xd6, 0x38, 0x40, 0x7d, 0x0a, 0x26, 0x42, + 0x6b, 0x7f, 0x02, 0x0b, 0x5d, 0x6b, 0xde, 0x29, 0x74, 0xd1, 0x13, 0xdd, 0x72, 0x0e, 0x5c, 0x79, + 0xa4, 0x6f, 0x0c, 0xf0, 0xda, 0xc0, 0x11, 0xc6, 0xe9, 0x09, 0xfb, 0x55, 0x31, 0x3c, 0x9b, 0xb1, + 0x53, 0x2f, 0x4c, 0xc4, 0xa7, 0x50, 0x94, 0xf9, 0xba, 0x84, 0xbc, 0x0b, 0x05, 0x7e, 0x2f, 0xfa, + 0xdc, 0xc5, 0x9c, 0xe5, 0x0e, 0x00, 0x27, 0xfa, 0xaf, 0xfe, 0x8e, 0xf9, 0xa6, 0x54, 0x0a, 0xfa, + 0x38, 0x04, 0x5d, 0x70, 0x65, 0x5e, 0xfd, 0x4f, 0x1e, 0x2e, 0xf7, 0x10, 0xd9, 0x2b, 0x6a, 0x50, + 0x2e, 0x24, 0x6a, 0xf8, 0x16, 0x8c, 0xf2, 0x3b, 0x57, 0xe8, 0xfd, 0x7c, 0x3f, 0x27, 0xcd, 0x34, + 0xe2, 0x0c, 0x8f, 0x21, 0x3d, 0x4f, 0x5c, 0x1a, 0xa3, 0x67, 0xbf, 0x34, 0xae, 0x41, 0x49, 0x1c, + 0x12, 0xdd, 0xf0, 0x09, 0xa6, 0xc4, 0xe4, 0x07, 0x6f, 0x54, 0x2b, 0x8a, 0xde, 0x77, 0x44, 0x27, + 0xf3, 0x8d, 0x92, 0x4c, 0xf8, 0xea, 0xf1, 0xd0, 0x37, 0x8a, 0x5e, 0x5e, 0x21, 0x62, 0x6e, 0xaa, + 0x0a, 0x93, 0x9e, 0x1b, 0x58, 0xdc, 0xd7, 0x4c, 0x70, 0xa0, 0xa8, 0x8d, 0xde, 0x86, 0xf1, 0xc0, + 0x6d, 0xf9, 0x06, 0xa9, 0x4c, 0xf6, 0xd6, 0x37, 0x19, 0x31, 0x32, 0xf3, 0xed, 0x70, 0x7a, 0x4d, + 0xf2, 0x71, 0xaf, 0x1a, 0x57, 0x43, 0xfd, 0x4b, 0x1e, 0xa0, 0x73, 0xd5, 0xf6, 0x8a, 0x56, 0x94, + 0x0b, 0x89, 0x56, 0xde, 0x92, 0xb7, 0xbe, 0x58, 0xf8, 0x17, 0x52, 0x68, 0x26, 0x39, 0x49, 0xde, + 0xfc, 0xdb, 0x36, 0xb6, 0x1c, 0x4a, 0x4e, 0xa8, 0xb8, 0xfc, 0x13, 0x56, 0xc9, 0xa7, 0xac, 0x72, + 0x51, 0x0b, 0xb9, 0x0d, 0x05, 0xf1, 0xe6, 0x2b, 0x52, 0xe2, 0xb1, 0x9e, 0x8e, 0x3e, 0xa1, 0x69, + 0x1d, 0x53, 0xa3, 0xc1, 0xd4, 0x15, 0xef, 0x98, 0x3c, 0x19, 0x06, 0x37, 0xfa, 0x8f, 0x6e, 0x76, + 0xb6, 0x86, 0x8d, 0xad, 0x26, 0x31, 0xa3, 0x55, 0x0f, 0x37, 0x87, 0xe8, 0x66, 0xeb, 0xde, 0x59, + 0xdb, 0x89, 0x33, 0xae, 0xed, 0x25, 0x28, 0xeb, 0x49, 0x71, 0x2b, 0xff, 0xb8, 0x04, 0x97, 0x99, + 0x43, 0xdf, 0xf6, 0x5d, 0xea, 0x1a, 0xae, 0xbd, 0x43, 0xfc, 0x63, 0xcb, 0x20, 0xe8, 0x43, 0x18, + 0x17, 0x31, 0x04, 0xca, 0xac, 0x67, 0x27, 0x22, 0xac, 0xea, 0xf5, 0x7e, 0x64, 0xd2, 0xdb, 0x1d, + 0xc1, 0x74, 0xbc, 0x18, 0x8b, 0x5e, 0x7c, 0x34, 0x5f, 0xa2, 0x78, 0x5c, 0xfd, 0xe6, 0x60, 0xc4, + 0x42, 0xd4, 0x2d, 0x05, 0xed, 0xc2, 0x18, 0x77, 0xba, 0xe8, 0x6a, 0x16, 0x63, 0xbc, 0x46, 0x5b, + 0xbd, 0xd6, 0x87, 0x2a, 0xc2, 0xfd, 0x0c, 0x4a, 0x49, 0x67, 0x8e, 0x5e, 0x7a, 0x24, 0x6b, 0xba, + 0xee, 0x58, 0xad, 0x0d, 0x4a, 0x1e, 0x89, 0xfc, 0x18, 0x26, 0x64, 0xbd, 0x04, 0x65, 0x9a, 0x3a, + 0x59, 0xd8, 0xab, 0xde, 0xe8, 0x4b, 0x27, 0xd7, 0xc4, 0x8f, 0x6a, 0x5a, 0x61, 0x2d, 0x06, 0xd5, + 0xfa, 0xf0, 0xa6, 0x8a, 0x52, 0xd5, 0xe5, 0x81, 0xe9, 0xa5, 0xcc, 0x8f, 0x60, 0x5c, 0xa4, 0xf8, + 0xd9, 0x1b, 0x2c, 0x51, 0xb0, 0xc9, 0xde, 0x60, 0xc9, 0x4a, 0xc1, 0x2d, 0x85, 0x4d, 0x27, 0x95, + 0x8a, 0x67, 0x4f, 0xa7, 0x77, 0x61, 0x20, 0x7b, 0x3a, 0x59, 0xe5, 0x02, 0x1b, 0x8a, 0x89, 0x3c, + 0x1e, 0x65, 0x6e, 0xd5, 0x5e, 0x65, 0x80, 0xea, 0x4b, 0x03, 0x52, 0x4b, 0x69, 0x2e, 0x94, 0x92, + 0xcf, 0xbf, 0xd9, 0xfb, 0xaf, 0xe7, 0x8b, 0x74, 0xf6, 0xfe, 0xcb, 0x78, 0x55, 0x76, 0xa1, 0x94, + 0x7c, 0xb7, 0xcd, 0x16, 0xd8, 0xf3, 0xed, 0x38, 0x5b, 0x60, 0xc6, 0x73, 0x70, 0x0b, 0x66, 0xd2, + 0x0f, 0xa7, 0x28, 0x73, 0x51, 0x32, 0xde, 0x73, 0xab, 0xb7, 0x06, 0x67, 0x90, 0x62, 0xdb, 0x30, + 0x93, 0x7e, 0xf3, 0xcc, 0x16, 0x9b, 0xf1, 0xf6, 0x9a, 0x2d, 0x36, 0xeb, 0x39, 0xf5, 0x96, 0xc2, + 0xe6, 0x9b, 0x2e, 0x48, 0x64, 0x0b, 0xce, 0x28, 0xe5, 0x64, 0x0b, 0xce, 0xac, 0x75, 0xb4, 0x60, + 0x26, 0x9d, 0x86, 0x67, 0x8b, 0xcd, 0x28, 0x60, 0x64, 0x8b, 0xcd, 0xcc, 0xf0, 0x7d, 0x28, 0xa7, + 0x52, 0xd5, 0xec, 0x13, 0xda, 0x3b, 0xa3, 0xcf, 0x3e, 0xa1, 0x59, 0x39, 0xf0, 0x17, 0x0a, 0xcc, + 0xf5, 0x4c, 0x22, 0xd0, 0xed, 0x01, 0x73, 0x85, 0x44, 0x76, 0x5c, 0x7d, 0x75, 0x48, 0x2e, 0xa9, + 0x06, 0xed, 0x4e, 0x4a, 0x6b, 0x83, 0xe6, 0x2a, 0xfd, 0xa6, 0x9e, 0x91, 0x80, 0xdd, 0x52, 0xd0, + 0x8f, 0x01, 0x75, 0x7f, 0x01, 0x83, 0x5e, 0x1e, 0xfa, 0xab, 0xaf, 0xea, 0xca, 0x30, 0x2c, 0x72, + 0xca, 0x9f, 0x2b, 0x30, 0xdb, 0xeb, 0x13, 0x47, 0xf4, 0x4a, 0xe6, 0x41, 0xc9, 0xfe, 0x58, 0xb3, + 0x7a, 0x7b, 0x38, 0x26, 0xa1, 0xc3, 0x8a, 0xd7, 0xf9, 0x18, 0x20, 0x0c, 0x71, 0x3e, 0x85, 0xc9, + 0xb0, 0x0b, 0xdd, 0xe8, 0xf7, 0x68, 0x1f, 0x4a, 0x5f, 0xea, 0x4f, 0x28, 0x24, 0xd6, 0xbf, 0xcc, + 0xfd, 0xf1, 0xe1, 0xa2, 0xf2, 0xd5, 0xc3, 0x45, 0xe5, 0xef, 0x0f, 0x17, 0x95, 0x9f, 0x7f, 0xbd, + 0x38, 0xf2, 0xd5, 0xd7, 0x8b, 0x23, 0x7f, 0xfe, 0x7a, 0x71, 0x04, 0xaa, 0x86, 0xdb, 0xcc, 0xc0, + 0xa9, 0x4f, 0x45, 0xd1, 0xd8, 0xb6, 0xf2, 0xf1, 0xfb, 0x87, 0x16, 0x6d, 0xb4, 0xf6, 0x6b, 0x86, + 0xdb, 0x5c, 0x36, 0xdc, 0xa0, 0xe9, 0x06, 0xcb, 0x3e, 0xb1, 0xf1, 0x29, 0xf1, 0x97, 0x8f, 0x57, + 0xa2, 0xbf, 0x3c, 0xf0, 0x0b, 0x96, 0x7b, 0x7f, 0xf7, 0xfb, 0x06, 0x6b, 0x85, 0x8d, 0x5f, 0xe7, + 0xf2, 0xdb, 0xbb, 0xdf, 0xff, 0x4d, 0x6e, 0x7e, 0x3b, 0x14, 0xce, 0xa4, 0xd5, 0x76, 0xe5, 0xf0, + 0x9f, 0x3a, 0x03, 0x7b, 0x6c, 0x60, 0x2f, 0x1c, 0x78, 0x98, 0x53, 0x7b, 0x0f, 0xec, 0xdd, 0xd9, + 0xae, 0xdf, 0x23, 0x14, 0xb3, 0x78, 0xf8, 0x9f, 0xb9, 0x4a, 0x48, 0xb4, 0xba, 0xca, 0xa8, 0x56, + 0x57, 0x43, 0xb2, 0xfd, 0x71, 0xfe, 0x21, 0xee, 0x2b, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x30, + 0x99, 0x71, 0xd0, 0x9d, 0x2c, 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 + +// ViewProtocolServiceClient is the client API for ViewProtocolService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ViewProtocolServiceClient interface { + // Get current status of chain sync + Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) + // Stream sync status updates until the view service has caught up with the core.chain.v1alpha1. + StatusStream(ctx context.Context, in *StatusStreamRequest, opts ...grpc.CallOption) (ViewProtocolService_StatusStreamClient, error) + // Queries for notes that have been accepted by the core.chain.v1alpha1. + Notes(ctx context.Context, in *NotesRequest, opts ...grpc.CallOption) (ViewProtocolService_NotesClient, error) + NotesForVoting(ctx context.Context, in *NotesForVotingRequest, opts ...grpc.CallOption) (ViewProtocolService_NotesForVotingClient, error) + // Returns authentication paths for the given note commitments. + // + // This method takes a batch of input commitments, rather than just one, so + // that the client can get a consistent set of authentication paths to a + // common root. (Otherwise, if a client made multiple requests, the wallet + // service could have advanced the state commitment tree state between queries). + Witness(ctx context.Context, in *WitnessRequest, opts ...grpc.CallOption) (*WitnessResponse, error) + WitnessAndBuild(ctx context.Context, in *WitnessAndBuildRequest, opts ...grpc.CallOption) (*WitnessAndBuildResponse, error) + // Queries for assets. + Assets(ctx context.Context, in *AssetsRequest, opts ...grpc.CallOption) (ViewProtocolService_AssetsClient, error) + // Query for the current chain parameters. + ChainParameters(ctx context.Context, in *ChainParametersRequest, opts ...grpc.CallOption) (*ChainParametersResponse, error) + // Query for the current FMD parameters. + FMDParameters(ctx context.Context, in *FMDParametersRequest, opts ...grpc.CallOption) (*FMDParametersResponse, error) + // Query for an address given an address index + AddressByIndex(ctx context.Context, in *AddressByIndexRequest, opts ...grpc.CallOption) (*AddressByIndexResponse, error) + // Query for an address given an address index + IndexByAddress(ctx context.Context, in *IndexByAddressRequest, opts ...grpc.CallOption) (*IndexByAddressResponse, error) + // Query for an ephemeral address + EphemeralAddress(ctx context.Context, in *EphemeralAddressRequest, opts ...grpc.CallOption) (*EphemeralAddressResponse, error) + // Query for balance of a given address + BalanceByAddress(ctx context.Context, in *BalanceByAddressRequest, opts ...grpc.CallOption) (ViewProtocolService_BalanceByAddressClient, error) + // Query for a note by its note commitment, optionally waiting until the note is detected. + NoteByCommitment(ctx context.Context, in *NoteByCommitmentRequest, opts ...grpc.CallOption) (*NoteByCommitmentResponse, error) + // Query for a swap by its swap commitment, optionally waiting until the swap is detected. + SwapByCommitment(ctx context.Context, in *SwapByCommitmentRequest, opts ...grpc.CallOption) (*SwapByCommitmentResponse, error) + // Query for whether a nullifier has been spent, optionally waiting until it is spent. + NullifierStatus(ctx context.Context, in *NullifierStatusRequest, opts ...grpc.CallOption) (*NullifierStatusResponse, error) + // Query for a given transaction by its hash. + TransactionInfoByHash(ctx context.Context, in *TransactionInfoByHashRequest, opts ...grpc.CallOption) (*TransactionInfoByHashResponse, error) + // Query for the full transactions in the given range of blocks. + TransactionInfo(ctx context.Context, in *TransactionInfoRequest, opts ...grpc.CallOption) (ViewProtocolService_TransactionInfoClient, error) + // Query for a transaction plan + TransactionPlanner(ctx context.Context, in *TransactionPlannerRequest, opts ...grpc.CallOption) (*TransactionPlannerResponse, error) + // Broadcast a transaction to the network, optionally waiting for full confirmation. + BroadcastTransaction(ctx context.Context, in *BroadcastTransactionRequest, opts ...grpc.CallOption) (*BroadcastTransactionResponse, error) +} + +type viewProtocolServiceClient struct { + cc grpc1.ClientConn +} + +func NewViewProtocolServiceClient(cc grpc1.ClientConn) ViewProtocolServiceClient { + return &viewProtocolServiceClient{cc} +} + +func (c *viewProtocolServiceClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { + out := new(StatusResponse) + err := c.cc.Invoke(ctx, "/penumbra.view.v1alpha1.ViewProtocolService/Status", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *viewProtocolServiceClient) StatusStream(ctx context.Context, in *StatusStreamRequest, opts ...grpc.CallOption) (ViewProtocolService_StatusStreamClient, error) { + stream, err := c.cc.NewStream(ctx, &_ViewProtocolService_serviceDesc.Streams[0], "/penumbra.view.v1alpha1.ViewProtocolService/StatusStream", opts...) + if err != nil { + return nil, err + } + x := &viewProtocolServiceStatusStreamClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type ViewProtocolService_StatusStreamClient interface { + Recv() (*StatusStreamResponse, error) + grpc.ClientStream +} + +type viewProtocolServiceStatusStreamClient struct { + grpc.ClientStream +} + +func (x *viewProtocolServiceStatusStreamClient) Recv() (*StatusStreamResponse, error) { + m := new(StatusStreamResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *viewProtocolServiceClient) Notes(ctx context.Context, in *NotesRequest, opts ...grpc.CallOption) (ViewProtocolService_NotesClient, error) { + stream, err := c.cc.NewStream(ctx, &_ViewProtocolService_serviceDesc.Streams[1], "/penumbra.view.v1alpha1.ViewProtocolService/Notes", opts...) + if err != nil { + return nil, err + } + x := &viewProtocolServiceNotesClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type ViewProtocolService_NotesClient interface { + Recv() (*NotesResponse, error) + grpc.ClientStream +} + +type viewProtocolServiceNotesClient struct { + grpc.ClientStream +} + +func (x *viewProtocolServiceNotesClient) Recv() (*NotesResponse, error) { + m := new(NotesResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *viewProtocolServiceClient) NotesForVoting(ctx context.Context, in *NotesForVotingRequest, opts ...grpc.CallOption) (ViewProtocolService_NotesForVotingClient, error) { + stream, err := c.cc.NewStream(ctx, &_ViewProtocolService_serviceDesc.Streams[2], "/penumbra.view.v1alpha1.ViewProtocolService/NotesForVoting", opts...) + if err != nil { + return nil, err + } + x := &viewProtocolServiceNotesForVotingClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type ViewProtocolService_NotesForVotingClient interface { + Recv() (*NotesForVotingResponse, error) + grpc.ClientStream +} + +type viewProtocolServiceNotesForVotingClient struct { + grpc.ClientStream +} + +func (x *viewProtocolServiceNotesForVotingClient) Recv() (*NotesForVotingResponse, error) { + m := new(NotesForVotingResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *viewProtocolServiceClient) Witness(ctx context.Context, in *WitnessRequest, opts ...grpc.CallOption) (*WitnessResponse, error) { + out := new(WitnessResponse) + err := c.cc.Invoke(ctx, "/penumbra.view.v1alpha1.ViewProtocolService/Witness", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *viewProtocolServiceClient) WitnessAndBuild(ctx context.Context, in *WitnessAndBuildRequest, opts ...grpc.CallOption) (*WitnessAndBuildResponse, error) { + out := new(WitnessAndBuildResponse) + err := c.cc.Invoke(ctx, "/penumbra.view.v1alpha1.ViewProtocolService/WitnessAndBuild", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *viewProtocolServiceClient) Assets(ctx context.Context, in *AssetsRequest, opts ...grpc.CallOption) (ViewProtocolService_AssetsClient, error) { + stream, err := c.cc.NewStream(ctx, &_ViewProtocolService_serviceDesc.Streams[3], "/penumbra.view.v1alpha1.ViewProtocolService/Assets", opts...) + if err != nil { + return nil, err + } + x := &viewProtocolServiceAssetsClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type ViewProtocolService_AssetsClient interface { + Recv() (*AssetsResponse, error) + grpc.ClientStream +} + +type viewProtocolServiceAssetsClient struct { + grpc.ClientStream +} + +func (x *viewProtocolServiceAssetsClient) Recv() (*AssetsResponse, error) { + m := new(AssetsResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *viewProtocolServiceClient) ChainParameters(ctx context.Context, in *ChainParametersRequest, opts ...grpc.CallOption) (*ChainParametersResponse, error) { + out := new(ChainParametersResponse) + err := c.cc.Invoke(ctx, "/penumbra.view.v1alpha1.ViewProtocolService/ChainParameters", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *viewProtocolServiceClient) FMDParameters(ctx context.Context, in *FMDParametersRequest, opts ...grpc.CallOption) (*FMDParametersResponse, error) { + out := new(FMDParametersResponse) + err := c.cc.Invoke(ctx, "/penumbra.view.v1alpha1.ViewProtocolService/FMDParameters", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *viewProtocolServiceClient) AddressByIndex(ctx context.Context, in *AddressByIndexRequest, opts ...grpc.CallOption) (*AddressByIndexResponse, error) { + out := new(AddressByIndexResponse) + err := c.cc.Invoke(ctx, "/penumbra.view.v1alpha1.ViewProtocolService/AddressByIndex", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *viewProtocolServiceClient) IndexByAddress(ctx context.Context, in *IndexByAddressRequest, opts ...grpc.CallOption) (*IndexByAddressResponse, error) { + out := new(IndexByAddressResponse) + err := c.cc.Invoke(ctx, "/penumbra.view.v1alpha1.ViewProtocolService/IndexByAddress", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *viewProtocolServiceClient) EphemeralAddress(ctx context.Context, in *EphemeralAddressRequest, opts ...grpc.CallOption) (*EphemeralAddressResponse, error) { + out := new(EphemeralAddressResponse) + err := c.cc.Invoke(ctx, "/penumbra.view.v1alpha1.ViewProtocolService/EphemeralAddress", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *viewProtocolServiceClient) BalanceByAddress(ctx context.Context, in *BalanceByAddressRequest, opts ...grpc.CallOption) (ViewProtocolService_BalanceByAddressClient, error) { + stream, err := c.cc.NewStream(ctx, &_ViewProtocolService_serviceDesc.Streams[4], "/penumbra.view.v1alpha1.ViewProtocolService/BalanceByAddress", opts...) + if err != nil { + return nil, err + } + x := &viewProtocolServiceBalanceByAddressClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type ViewProtocolService_BalanceByAddressClient interface { + Recv() (*BalanceByAddressResponse, error) + grpc.ClientStream +} + +type viewProtocolServiceBalanceByAddressClient struct { + grpc.ClientStream +} + +func (x *viewProtocolServiceBalanceByAddressClient) Recv() (*BalanceByAddressResponse, error) { + m := new(BalanceByAddressResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *viewProtocolServiceClient) NoteByCommitment(ctx context.Context, in *NoteByCommitmentRequest, opts ...grpc.CallOption) (*NoteByCommitmentResponse, error) { + out := new(NoteByCommitmentResponse) + err := c.cc.Invoke(ctx, "/penumbra.view.v1alpha1.ViewProtocolService/NoteByCommitment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *viewProtocolServiceClient) SwapByCommitment(ctx context.Context, in *SwapByCommitmentRequest, opts ...grpc.CallOption) (*SwapByCommitmentResponse, error) { + out := new(SwapByCommitmentResponse) + err := c.cc.Invoke(ctx, "/penumbra.view.v1alpha1.ViewProtocolService/SwapByCommitment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *viewProtocolServiceClient) NullifierStatus(ctx context.Context, in *NullifierStatusRequest, opts ...grpc.CallOption) (*NullifierStatusResponse, error) { + out := new(NullifierStatusResponse) + err := c.cc.Invoke(ctx, "/penumbra.view.v1alpha1.ViewProtocolService/NullifierStatus", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *viewProtocolServiceClient) TransactionInfoByHash(ctx context.Context, in *TransactionInfoByHashRequest, opts ...grpc.CallOption) (*TransactionInfoByHashResponse, error) { + out := new(TransactionInfoByHashResponse) + err := c.cc.Invoke(ctx, "/penumbra.view.v1alpha1.ViewProtocolService/TransactionInfoByHash", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *viewProtocolServiceClient) TransactionInfo(ctx context.Context, in *TransactionInfoRequest, opts ...grpc.CallOption) (ViewProtocolService_TransactionInfoClient, error) { + stream, err := c.cc.NewStream(ctx, &_ViewProtocolService_serviceDesc.Streams[5], "/penumbra.view.v1alpha1.ViewProtocolService/TransactionInfo", opts...) + if err != nil { + return nil, err + } + x := &viewProtocolServiceTransactionInfoClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type ViewProtocolService_TransactionInfoClient interface { + Recv() (*TransactionInfoResponse, error) + grpc.ClientStream +} + +type viewProtocolServiceTransactionInfoClient struct { + grpc.ClientStream +} + +func (x *viewProtocolServiceTransactionInfoClient) Recv() (*TransactionInfoResponse, error) { + m := new(TransactionInfoResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *viewProtocolServiceClient) TransactionPlanner(ctx context.Context, in *TransactionPlannerRequest, opts ...grpc.CallOption) (*TransactionPlannerResponse, error) { + out := new(TransactionPlannerResponse) + err := c.cc.Invoke(ctx, "/penumbra.view.v1alpha1.ViewProtocolService/TransactionPlanner", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *viewProtocolServiceClient) BroadcastTransaction(ctx context.Context, in *BroadcastTransactionRequest, opts ...grpc.CallOption) (*BroadcastTransactionResponse, error) { + out := new(BroadcastTransactionResponse) + err := c.cc.Invoke(ctx, "/penumbra.view.v1alpha1.ViewProtocolService/BroadcastTransaction", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ViewProtocolServiceServer is the server API for ViewProtocolService service. +type ViewProtocolServiceServer interface { + // Get current status of chain sync + Status(context.Context, *StatusRequest) (*StatusResponse, error) + // Stream sync status updates until the view service has caught up with the core.chain.v1alpha1. + StatusStream(*StatusStreamRequest, ViewProtocolService_StatusStreamServer) error + // Queries for notes that have been accepted by the core.chain.v1alpha1. + Notes(*NotesRequest, ViewProtocolService_NotesServer) error + NotesForVoting(*NotesForVotingRequest, ViewProtocolService_NotesForVotingServer) error + // Returns authentication paths for the given note commitments. + // + // This method takes a batch of input commitments, rather than just one, so + // that the client can get a consistent set of authentication paths to a + // common root. (Otherwise, if a client made multiple requests, the wallet + // service could have advanced the state commitment tree state between queries). + Witness(context.Context, *WitnessRequest) (*WitnessResponse, error) + WitnessAndBuild(context.Context, *WitnessAndBuildRequest) (*WitnessAndBuildResponse, error) + // Queries for assets. + Assets(*AssetsRequest, ViewProtocolService_AssetsServer) error + // Query for the current chain parameters. + ChainParameters(context.Context, *ChainParametersRequest) (*ChainParametersResponse, error) + // Query for the current FMD parameters. + FMDParameters(context.Context, *FMDParametersRequest) (*FMDParametersResponse, error) + // Query for an address given an address index + AddressByIndex(context.Context, *AddressByIndexRequest) (*AddressByIndexResponse, error) + // Query for an address given an address index + IndexByAddress(context.Context, *IndexByAddressRequest) (*IndexByAddressResponse, error) + // Query for an ephemeral address + EphemeralAddress(context.Context, *EphemeralAddressRequest) (*EphemeralAddressResponse, error) + // Query for balance of a given address + BalanceByAddress(*BalanceByAddressRequest, ViewProtocolService_BalanceByAddressServer) error + // Query for a note by its note commitment, optionally waiting until the note is detected. + NoteByCommitment(context.Context, *NoteByCommitmentRequest) (*NoteByCommitmentResponse, error) + // Query for a swap by its swap commitment, optionally waiting until the swap is detected. + SwapByCommitment(context.Context, *SwapByCommitmentRequest) (*SwapByCommitmentResponse, error) + // Query for whether a nullifier has been spent, optionally waiting until it is spent. + NullifierStatus(context.Context, *NullifierStatusRequest) (*NullifierStatusResponse, error) + // Query for a given transaction by its hash. + TransactionInfoByHash(context.Context, *TransactionInfoByHashRequest) (*TransactionInfoByHashResponse, error) + // Query for the full transactions in the given range of blocks. + TransactionInfo(*TransactionInfoRequest, ViewProtocolService_TransactionInfoServer) error + // Query for a transaction plan + TransactionPlanner(context.Context, *TransactionPlannerRequest) (*TransactionPlannerResponse, error) + // Broadcast a transaction to the network, optionally waiting for full confirmation. + BroadcastTransaction(context.Context, *BroadcastTransactionRequest) (*BroadcastTransactionResponse, error) +} + +// UnimplementedViewProtocolServiceServer can be embedded to have forward compatible implementations. +type UnimplementedViewProtocolServiceServer struct { +} + +func (*UnimplementedViewProtocolServiceServer) Status(ctx context.Context, req *StatusRequest) (*StatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") +} +func (*UnimplementedViewProtocolServiceServer) StatusStream(req *StatusStreamRequest, srv ViewProtocolService_StatusStreamServer) error { + return status.Errorf(codes.Unimplemented, "method StatusStream not implemented") +} +func (*UnimplementedViewProtocolServiceServer) Notes(req *NotesRequest, srv ViewProtocolService_NotesServer) error { + return status.Errorf(codes.Unimplemented, "method Notes not implemented") +} +func (*UnimplementedViewProtocolServiceServer) NotesForVoting(req *NotesForVotingRequest, srv ViewProtocolService_NotesForVotingServer) error { + return status.Errorf(codes.Unimplemented, "method NotesForVoting not implemented") +} +func (*UnimplementedViewProtocolServiceServer) Witness(ctx context.Context, req *WitnessRequest) (*WitnessResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Witness not implemented") +} +func (*UnimplementedViewProtocolServiceServer) WitnessAndBuild(ctx context.Context, req *WitnessAndBuildRequest) (*WitnessAndBuildResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WitnessAndBuild not implemented") +} +func (*UnimplementedViewProtocolServiceServer) Assets(req *AssetsRequest, srv ViewProtocolService_AssetsServer) error { + return status.Errorf(codes.Unimplemented, "method Assets not implemented") +} +func (*UnimplementedViewProtocolServiceServer) ChainParameters(ctx context.Context, req *ChainParametersRequest) (*ChainParametersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChainParameters not implemented") +} +func (*UnimplementedViewProtocolServiceServer) FMDParameters(ctx context.Context, req *FMDParametersRequest) (*FMDParametersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FMDParameters not implemented") +} +func (*UnimplementedViewProtocolServiceServer) AddressByIndex(ctx context.Context, req *AddressByIndexRequest) (*AddressByIndexResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddressByIndex not implemented") +} +func (*UnimplementedViewProtocolServiceServer) IndexByAddress(ctx context.Context, req *IndexByAddressRequest) (*IndexByAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IndexByAddress not implemented") +} +func (*UnimplementedViewProtocolServiceServer) EphemeralAddress(ctx context.Context, req *EphemeralAddressRequest) (*EphemeralAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EphemeralAddress not implemented") +} +func (*UnimplementedViewProtocolServiceServer) BalanceByAddress(req *BalanceByAddressRequest, srv ViewProtocolService_BalanceByAddressServer) error { + return status.Errorf(codes.Unimplemented, "method BalanceByAddress not implemented") +} +func (*UnimplementedViewProtocolServiceServer) NoteByCommitment(ctx context.Context, req *NoteByCommitmentRequest) (*NoteByCommitmentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NoteByCommitment not implemented") +} +func (*UnimplementedViewProtocolServiceServer) SwapByCommitment(ctx context.Context, req *SwapByCommitmentRequest) (*SwapByCommitmentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SwapByCommitment not implemented") +} +func (*UnimplementedViewProtocolServiceServer) NullifierStatus(ctx context.Context, req *NullifierStatusRequest) (*NullifierStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NullifierStatus not implemented") +} +func (*UnimplementedViewProtocolServiceServer) TransactionInfoByHash(ctx context.Context, req *TransactionInfoByHashRequest) (*TransactionInfoByHashResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TransactionInfoByHash not implemented") +} +func (*UnimplementedViewProtocolServiceServer) TransactionInfo(req *TransactionInfoRequest, srv ViewProtocolService_TransactionInfoServer) error { + return status.Errorf(codes.Unimplemented, "method TransactionInfo not implemented") +} +func (*UnimplementedViewProtocolServiceServer) TransactionPlanner(ctx context.Context, req *TransactionPlannerRequest) (*TransactionPlannerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TransactionPlanner not implemented") +} +func (*UnimplementedViewProtocolServiceServer) BroadcastTransaction(ctx context.Context, req *BroadcastTransactionRequest) (*BroadcastTransactionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BroadcastTransaction not implemented") +} + +func RegisterViewProtocolServiceServer(s grpc1.Server, srv ViewProtocolServiceServer) { + s.RegisterService(&_ViewProtocolService_serviceDesc, srv) +} + +func _ViewProtocolService_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ViewProtocolServiceServer).Status(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/penumbra.view.v1alpha1.ViewProtocolService/Status", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ViewProtocolServiceServer).Status(ctx, req.(*StatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ViewProtocolService_StatusStream_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(StatusStreamRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ViewProtocolServiceServer).StatusStream(m, &viewProtocolServiceStatusStreamServer{stream}) +} + +type ViewProtocolService_StatusStreamServer interface { + Send(*StatusStreamResponse) error + grpc.ServerStream +} + +type viewProtocolServiceStatusStreamServer struct { + grpc.ServerStream +} + +func (x *viewProtocolServiceStatusStreamServer) Send(m *StatusStreamResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _ViewProtocolService_Notes_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(NotesRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ViewProtocolServiceServer).Notes(m, &viewProtocolServiceNotesServer{stream}) +} + +type ViewProtocolService_NotesServer interface { + Send(*NotesResponse) error + grpc.ServerStream +} + +type viewProtocolServiceNotesServer struct { + grpc.ServerStream +} + +func (x *viewProtocolServiceNotesServer) Send(m *NotesResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _ViewProtocolService_NotesForVoting_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(NotesForVotingRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ViewProtocolServiceServer).NotesForVoting(m, &viewProtocolServiceNotesForVotingServer{stream}) +} + +type ViewProtocolService_NotesForVotingServer interface { + Send(*NotesForVotingResponse) error + grpc.ServerStream +} + +type viewProtocolServiceNotesForVotingServer struct { + grpc.ServerStream +} + +func (x *viewProtocolServiceNotesForVotingServer) Send(m *NotesForVotingResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _ViewProtocolService_Witness_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WitnessRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ViewProtocolServiceServer).Witness(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/penumbra.view.v1alpha1.ViewProtocolService/Witness", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ViewProtocolServiceServer).Witness(ctx, req.(*WitnessRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ViewProtocolService_WitnessAndBuild_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WitnessAndBuildRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ViewProtocolServiceServer).WitnessAndBuild(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/penumbra.view.v1alpha1.ViewProtocolService/WitnessAndBuild", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ViewProtocolServiceServer).WitnessAndBuild(ctx, req.(*WitnessAndBuildRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ViewProtocolService_Assets_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(AssetsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ViewProtocolServiceServer).Assets(m, &viewProtocolServiceAssetsServer{stream}) +} + +type ViewProtocolService_AssetsServer interface { + Send(*AssetsResponse) error + grpc.ServerStream +} + +type viewProtocolServiceAssetsServer struct { + grpc.ServerStream +} + +func (x *viewProtocolServiceAssetsServer) Send(m *AssetsResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _ViewProtocolService_ChainParameters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ChainParametersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ViewProtocolServiceServer).ChainParameters(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/penumbra.view.v1alpha1.ViewProtocolService/ChainParameters", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ViewProtocolServiceServer).ChainParameters(ctx, req.(*ChainParametersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ViewProtocolService_FMDParameters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FMDParametersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ViewProtocolServiceServer).FMDParameters(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/penumbra.view.v1alpha1.ViewProtocolService/FMDParameters", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ViewProtocolServiceServer).FMDParameters(ctx, req.(*FMDParametersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ViewProtocolService_AddressByIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddressByIndexRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ViewProtocolServiceServer).AddressByIndex(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/penumbra.view.v1alpha1.ViewProtocolService/AddressByIndex", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ViewProtocolServiceServer).AddressByIndex(ctx, req.(*AddressByIndexRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ViewProtocolService_IndexByAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IndexByAddressRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ViewProtocolServiceServer).IndexByAddress(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/penumbra.view.v1alpha1.ViewProtocolService/IndexByAddress", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ViewProtocolServiceServer).IndexByAddress(ctx, req.(*IndexByAddressRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ViewProtocolService_EphemeralAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EphemeralAddressRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ViewProtocolServiceServer).EphemeralAddress(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/penumbra.view.v1alpha1.ViewProtocolService/EphemeralAddress", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ViewProtocolServiceServer).EphemeralAddress(ctx, req.(*EphemeralAddressRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ViewProtocolService_BalanceByAddress_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(BalanceByAddressRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ViewProtocolServiceServer).BalanceByAddress(m, &viewProtocolServiceBalanceByAddressServer{stream}) +} + +type ViewProtocolService_BalanceByAddressServer interface { + Send(*BalanceByAddressResponse) error + grpc.ServerStream +} + +type viewProtocolServiceBalanceByAddressServer struct { + grpc.ServerStream +} + +func (x *viewProtocolServiceBalanceByAddressServer) Send(m *BalanceByAddressResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _ViewProtocolService_NoteByCommitment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NoteByCommitmentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ViewProtocolServiceServer).NoteByCommitment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/penumbra.view.v1alpha1.ViewProtocolService/NoteByCommitment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ViewProtocolServiceServer).NoteByCommitment(ctx, req.(*NoteByCommitmentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ViewProtocolService_SwapByCommitment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SwapByCommitmentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ViewProtocolServiceServer).SwapByCommitment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/penumbra.view.v1alpha1.ViewProtocolService/SwapByCommitment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ViewProtocolServiceServer).SwapByCommitment(ctx, req.(*SwapByCommitmentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ViewProtocolService_NullifierStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NullifierStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ViewProtocolServiceServer).NullifierStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/penumbra.view.v1alpha1.ViewProtocolService/NullifierStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ViewProtocolServiceServer).NullifierStatus(ctx, req.(*NullifierStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ViewProtocolService_TransactionInfoByHash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TransactionInfoByHashRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ViewProtocolServiceServer).TransactionInfoByHash(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/penumbra.view.v1alpha1.ViewProtocolService/TransactionInfoByHash", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ViewProtocolServiceServer).TransactionInfoByHash(ctx, req.(*TransactionInfoByHashRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ViewProtocolService_TransactionInfo_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(TransactionInfoRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ViewProtocolServiceServer).TransactionInfo(m, &viewProtocolServiceTransactionInfoServer{stream}) +} + +type ViewProtocolService_TransactionInfoServer interface { + Send(*TransactionInfoResponse) error + grpc.ServerStream +} + +type viewProtocolServiceTransactionInfoServer struct { + grpc.ServerStream +} + +func (x *viewProtocolServiceTransactionInfoServer) Send(m *TransactionInfoResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _ViewProtocolService_TransactionPlanner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TransactionPlannerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ViewProtocolServiceServer).TransactionPlanner(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/penumbra.view.v1alpha1.ViewProtocolService/TransactionPlanner", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ViewProtocolServiceServer).TransactionPlanner(ctx, req.(*TransactionPlannerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ViewProtocolService_BroadcastTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BroadcastTransactionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ViewProtocolServiceServer).BroadcastTransaction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/penumbra.view.v1alpha1.ViewProtocolService/BroadcastTransaction", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ViewProtocolServiceServer).BroadcastTransaction(ctx, req.(*BroadcastTransactionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ViewProtocolService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "penumbra.view.v1alpha1.ViewProtocolService", + HandlerType: (*ViewProtocolServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Status", + Handler: _ViewProtocolService_Status_Handler, + }, + { + MethodName: "Witness", + Handler: _ViewProtocolService_Witness_Handler, + }, + { + MethodName: "WitnessAndBuild", + Handler: _ViewProtocolService_WitnessAndBuild_Handler, + }, + { + MethodName: "ChainParameters", + Handler: _ViewProtocolService_ChainParameters_Handler, + }, + { + MethodName: "FMDParameters", + Handler: _ViewProtocolService_FMDParameters_Handler, + }, + { + MethodName: "AddressByIndex", + Handler: _ViewProtocolService_AddressByIndex_Handler, + }, + { + MethodName: "IndexByAddress", + Handler: _ViewProtocolService_IndexByAddress_Handler, + }, + { + MethodName: "EphemeralAddress", + Handler: _ViewProtocolService_EphemeralAddress_Handler, + }, + { + MethodName: "NoteByCommitment", + Handler: _ViewProtocolService_NoteByCommitment_Handler, + }, + { + MethodName: "SwapByCommitment", + Handler: _ViewProtocolService_SwapByCommitment_Handler, + }, + { + MethodName: "NullifierStatus", + Handler: _ViewProtocolService_NullifierStatus_Handler, + }, + { + MethodName: "TransactionInfoByHash", + Handler: _ViewProtocolService_TransactionInfoByHash_Handler, + }, + { + MethodName: "TransactionPlanner", + Handler: _ViewProtocolService_TransactionPlanner_Handler, + }, + { + MethodName: "BroadcastTransaction", + Handler: _ViewProtocolService_BroadcastTransaction_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "StatusStream", + Handler: _ViewProtocolService_StatusStream_Handler, + ServerStreams: true, + }, + { + StreamName: "Notes", + Handler: _ViewProtocolService_Notes_Handler, + ServerStreams: true, + }, + { + StreamName: "NotesForVoting", + Handler: _ViewProtocolService_NotesForVoting_Handler, + ServerStreams: true, + }, + { + StreamName: "Assets", + Handler: _ViewProtocolService_Assets_Handler, + ServerStreams: true, + }, + { + StreamName: "BalanceByAddress", + Handler: _ViewProtocolService_BalanceByAddress_Handler, + ServerStreams: true, + }, + { + StreamName: "TransactionInfo", + Handler: _ViewProtocolService_TransactionInfo_Handler, + ServerStreams: true, + }, + }, + Metadata: "penumbra/view/v1alpha1/view.proto", +} + +// ViewAuthServiceClient is the client API for ViewAuthService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ViewAuthServiceClient interface { + ViewAuth(ctx context.Context, in *ViewAuthRequest, opts ...grpc.CallOption) (*ViewAuthResponse, error) +} + +type viewAuthServiceClient struct { + cc grpc1.ClientConn +} + +func NewViewAuthServiceClient(cc grpc1.ClientConn) ViewAuthServiceClient { + return &viewAuthServiceClient{cc} +} + +func (c *viewAuthServiceClient) ViewAuth(ctx context.Context, in *ViewAuthRequest, opts ...grpc.CallOption) (*ViewAuthResponse, error) { + out := new(ViewAuthResponse) + err := c.cc.Invoke(ctx, "/penumbra.view.v1alpha1.ViewAuthService/ViewAuth", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ViewAuthServiceServer is the server API for ViewAuthService service. +type ViewAuthServiceServer interface { + ViewAuth(context.Context, *ViewAuthRequest) (*ViewAuthResponse, error) +} + +// UnimplementedViewAuthServiceServer can be embedded to have forward compatible implementations. +type UnimplementedViewAuthServiceServer struct { +} + +func (*UnimplementedViewAuthServiceServer) ViewAuth(ctx context.Context, req *ViewAuthRequest) (*ViewAuthResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ViewAuth not implemented") +} + +func RegisterViewAuthServiceServer(s grpc1.Server, srv ViewAuthServiceServer) { + s.RegisterService(&_ViewAuthService_serviceDesc, srv) +} + +func _ViewAuthService_ViewAuth_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ViewAuthRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ViewAuthServiceServer).ViewAuth(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/penumbra.view.v1alpha1.ViewAuthService/ViewAuth", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ViewAuthServiceServer).ViewAuth(ctx, req.(*ViewAuthRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ViewAuthService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "penumbra.view.v1alpha1.ViewAuthService", + HandlerType: (*ViewAuthServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ViewAuth", + Handler: _ViewAuthService_ViewAuth_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "penumbra/view/v1alpha1/view.proto", +} + +func (m *BroadcastTransactionRequest) 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 *BroadcastTransactionRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BroadcastTransactionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AwaitDetection { + i-- + if m.AwaitDetection { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.Transaction != nil { + { + size, err := m.Transaction.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BroadcastTransactionResponse) 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 *BroadcastTransactionResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BroadcastTransactionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.DetectionHeight != 0 { + i = encodeVarintView(dAtA, i, uint64(m.DetectionHeight)) + i-- + dAtA[i] = 0x10 + } + if m.Id != nil { + { + size, err := m.Id.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TransactionPlannerRequest) 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 *TransactionPlannerRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TransactionPlannerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.IbcActions) > 0 { + for iNdEx := len(m.IbcActions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.IbcActions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3 + i-- + dAtA[i] = 0xe2 + } + } + if len(m.Undelegations) > 0 { + for iNdEx := len(m.Undelegations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Undelegations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3 + i-- + dAtA[i] = 0x92 + } + } + if len(m.Delegations) > 0 { + for iNdEx := len(m.Delegations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Delegations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xc2 + } + } + if len(m.Swaps) > 0 { + for iNdEx := len(m.Swaps) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Swaps[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xf2 + } + } + if len(m.Outputs) > 0 { + for iNdEx := len(m.Outputs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Outputs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + } + if m.XAccountGroupId != nil { + { + size := m.XAccountGroupId.Size() + i -= size + if _, err := m.XAccountGroupId.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.Memo) > 0 { + i -= len(m.Memo) + copy(dAtA[i:], m.Memo) + i = encodeVarintView(dAtA, i, uint64(len(m.Memo))) + i-- + dAtA[i] = 0x1a + } + if m.Fee != nil { + { + size, err := m.Fee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.ExpiryHeight != 0 { + i = encodeVarintView(dAtA, i, uint64(m.ExpiryHeight)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *TransactionPlannerRequest_AccountGroupId) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TransactionPlannerRequest_AccountGroupId) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.AccountGroupId != nil { + { + size, err := m.AccountGroupId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + return len(dAtA) - i, nil +} +func (m *TransactionPlannerRequest_Output) 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 *TransactionPlannerRequest_Output) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TransactionPlannerRequest_Output) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Address != nil { + { + size, err := m.Address.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Value != nil { + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TransactionPlannerRequest_Swap) 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 *TransactionPlannerRequest_Swap) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TransactionPlannerRequest_Swap) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Fee != nil { + { + size, err := m.Fee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.TargetAsset != nil { + { + size, err := m.TargetAsset.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Value != nil { + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TransactionPlannerRequest_Delegate) 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 *TransactionPlannerRequest_Delegate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TransactionPlannerRequest_Delegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.IdentityKey != nil { + { + size, err := m.IdentityKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Amount != nil { + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TransactionPlannerRequest_Undelegate) 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 *TransactionPlannerRequest_Undelegate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TransactionPlannerRequest_Undelegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Value != nil { + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TransactionPlannerResponse) 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 *TransactionPlannerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TransactionPlannerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Plan != nil { + { + size, err := m.Plan.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AddressByIndexRequest) 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 *AddressByIndexRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddressByIndexRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AddressIndex != nil { + { + size, err := m.AddressIndex.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AddressByIndexResponse) 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 *AddressByIndexResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddressByIndexResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Address != nil { + { + size, err := m.Address.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *IndexByAddressRequest) 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 *IndexByAddressRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IndexByAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Address != nil { + { + size, err := m.Address.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *IndexByAddressResponse) 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 *IndexByAddressResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IndexByAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XAddressIndex != nil { + { + size := m.XAddressIndex.Size() + i -= size + if _, err := m.XAddressIndex.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *IndexByAddressResponse_AddressIndex) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IndexByAddressResponse_AddressIndex) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.AddressIndex != nil { + { + size, err := m.AddressIndex.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *EphemeralAddressRequest) 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 *EphemeralAddressRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EphemeralAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AddressIndex != nil { + { + size, err := m.AddressIndex.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EphemeralAddressResponse) 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 *EphemeralAddressResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EphemeralAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Address != nil { + { + size, err := m.Address.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BalanceByAddressRequest) 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 *BalanceByAddressRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BalanceByAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Address != nil { + { + size, err := m.Address.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BalanceByAddressResponse) 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 *BalanceByAddressResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BalanceByAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Amount != nil { + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Asset != nil { + { + size, err := m.Asset.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ViewAuthToken) 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 *ViewAuthToken) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ViewAuthToken) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Inner) > 0 { + i -= len(m.Inner) + copy(dAtA[i:], m.Inner) + i = encodeVarintView(dAtA, i, uint64(len(m.Inner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ViewAuthRequest) 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 *ViewAuthRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ViewAuthRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Fvk != nil { + { + size, err := m.Fvk.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ViewAuthResponse) 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 *ViewAuthResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ViewAuthResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Token != nil { + { + size, err := m.Token.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *StatusRequest) 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 *StatusRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XAccountGroupId != nil { + { + size := m.XAccountGroupId.Size() + i -= size + if _, err := m.XAccountGroupId.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *StatusRequest_AccountGroupId) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatusRequest_AccountGroupId) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.AccountGroupId != nil { + { + size, err := m.AccountGroupId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + return len(dAtA) - i, nil +} +func (m *StatusResponse) 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 *StatusResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CatchingUp { + i-- + if m.CatchingUp { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.SyncHeight != 0 { + i = encodeVarintView(dAtA, i, uint64(m.SyncHeight)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *StatusStreamRequest) 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 *StatusStreamRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatusStreamRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XAccountGroupId != nil { + { + size := m.XAccountGroupId.Size() + i -= size + if _, err := m.XAccountGroupId.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *StatusStreamRequest_AccountGroupId) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatusStreamRequest_AccountGroupId) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.AccountGroupId != nil { + { + size, err := m.AccountGroupId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + return len(dAtA) - i, nil +} +func (m *StatusStreamResponse) 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 *StatusStreamResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatusStreamResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SyncHeight != 0 { + i = encodeVarintView(dAtA, i, uint64(m.SyncHeight)) + i-- + dAtA[i] = 0x10 + } + if m.LatestKnownBlockHeight != 0 { + i = encodeVarintView(dAtA, i, uint64(m.LatestKnownBlockHeight)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *NotesRequest) 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 *NotesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NotesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XAccountGroupId != nil { + { + size := m.XAccountGroupId.Size() + i -= size + if _, err := m.XAccountGroupId.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.AmountToSpend != nil { + { + size, err := m.AmountToSpend.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.AddressIndex != nil { + { + size, err := m.AddressIndex.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.AssetId != nil { + { + size, err := m.AssetId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.IncludeSpent { + i-- + if m.IncludeSpent { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + return len(dAtA) - i, nil +} + +func (m *NotesRequest_AccountGroupId) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NotesRequest_AccountGroupId) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.AccountGroupId != nil { + { + size, err := m.AccountGroupId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + return len(dAtA) - i, nil +} +func (m *NotesForVotingRequest) 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 *NotesForVotingRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NotesForVotingRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XAccountGroupId != nil { + { + size := m.XAccountGroupId.Size() + i -= size + if _, err := m.XAccountGroupId.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.AddressIndex != nil { + { + size, err := m.AddressIndex.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.VotableAtHeight != 0 { + i = encodeVarintView(dAtA, i, uint64(m.VotableAtHeight)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *NotesForVotingRequest_AccountGroupId) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NotesForVotingRequest_AccountGroupId) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.AccountGroupId != nil { + { + size, err := m.AccountGroupId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + return len(dAtA) - i, nil +} +func (m *WitnessRequest) 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 *WitnessRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WitnessRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XAccountGroupId != nil { + { + size := m.XAccountGroupId.Size() + i -= size + if _, err := m.XAccountGroupId.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.TransactionPlan != nil { + { + size, err := m.TransactionPlan.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.NoteCommitments) > 0 { + for iNdEx := len(m.NoteCommitments) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.NoteCommitments[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + return len(dAtA) - i, nil +} + +func (m *WitnessRequest_AccountGroupId) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WitnessRequest_AccountGroupId) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.AccountGroupId != nil { + { + size, err := m.AccountGroupId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + return len(dAtA) - i, nil +} +func (m *WitnessResponse) 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 *WitnessResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WitnessResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.WitnessData != nil { + { + size, err := m.WitnessData.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *WitnessAndBuildRequest) 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 *WitnessAndBuildRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WitnessAndBuildRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AuthorizationData != nil { + { + size, err := m.AuthorizationData.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.TransactionPlan != nil { + { + size, err := m.TransactionPlan.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *WitnessAndBuildResponse) 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 *WitnessAndBuildResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WitnessAndBuildResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Transaction != nil { + { + size, err := m.Transaction.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AssetsRequest) 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 *AssetsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AssetsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.IncludeVotingReceiptTokens { + i-- + if m.IncludeVotingReceiptTokens { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if m.IncludeProposalNfts { + i-- + if m.IncludeProposalNfts { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.IncludeLpNfts { + i-- + if m.IncludeLpNfts { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.IncludeUnbondingTokens { + i-- + if m.IncludeUnbondingTokens { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.IncludeDelegationTokens { + i-- + if m.IncludeDelegationTokens { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(m.IncludeSpecificDenominations) > 0 { + for iNdEx := len(m.IncludeSpecificDenominations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.IncludeSpecificDenominations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Filtered { + i-- + if m.Filtered { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *AssetsResponse) 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 *AssetsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AssetsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Asset != nil { + { + size, err := m.Asset.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ChainParametersRequest) 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 *ChainParametersRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ChainParametersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *ChainParametersResponse) 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 *ChainParametersResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ChainParametersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Parameters != nil { + { + size, err := m.Parameters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *FMDParametersRequest) 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 *FMDParametersRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FMDParametersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *FMDParametersResponse) 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 *FMDParametersResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FMDParametersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Parameters != nil { + { + size, err := m.Parameters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NoteByCommitmentRequest) 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 *NoteByCommitmentRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NoteByCommitmentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XAccountGroupId != nil { + { + size := m.XAccountGroupId.Size() + i -= size + if _, err := m.XAccountGroupId.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.AwaitDetection { + i-- + if m.AwaitDetection { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.NoteCommitment != nil { + { + size, err := m.NoteCommitment.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} + +func (m *NoteByCommitmentRequest_AccountGroupId) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NoteByCommitmentRequest_AccountGroupId) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.AccountGroupId != nil { + { + size, err := m.AccountGroupId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + return len(dAtA) - i, nil +} +func (m *NoteByCommitmentResponse) 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 *NoteByCommitmentResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NoteByCommitmentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SpendableNote != nil { + { + size, err := m.SpendableNote.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SwapByCommitmentRequest) 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 *SwapByCommitmentRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SwapByCommitmentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XAccountGroupId != nil { + { + size := m.XAccountGroupId.Size() + i -= size + if _, err := m.XAccountGroupId.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.AwaitDetection { + i-- + if m.AwaitDetection { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.SwapCommitment != nil { + { + size, err := m.SwapCommitment.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} + +func (m *SwapByCommitmentRequest_AccountGroupId) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SwapByCommitmentRequest_AccountGroupId) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.AccountGroupId != nil { + { + size, err := m.AccountGroupId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + return len(dAtA) - i, nil +} +func (m *SwapByCommitmentResponse) 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 *SwapByCommitmentResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SwapByCommitmentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Swap != nil { + { + size, err := m.Swap.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NullifierStatusRequest) 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 *NullifierStatusRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NullifierStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XAccountGroupId != nil { + { + size := m.XAccountGroupId.Size() + i -= size + if _, err := m.XAccountGroupId.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.AwaitDetection { + i-- + if m.AwaitDetection { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.Nullifier != nil { + { + size, err := m.Nullifier.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} + +func (m *NullifierStatusRequest_AccountGroupId) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NullifierStatusRequest_AccountGroupId) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.AccountGroupId != nil { + { + size, err := m.AccountGroupId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + return len(dAtA) - i, nil +} +func (m *NullifierStatusResponse) 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 *NullifierStatusResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NullifierStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Spent { + i-- + if m.Spent { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *TransactionInfoByHashRequest) 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 *TransactionInfoByHashRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TransactionInfoByHashRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != nil { + { + size, err := m.Id.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} + +func (m *TransactionInfoRequest) 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 *TransactionInfoRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TransactionInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XEndHeight != nil { + { + size := m.XEndHeight.Size() + i -= size + if _, err := m.XEndHeight.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.XStartHeight != nil { + { + size := m.XStartHeight.Size() + i -= size + if _, err := m.XStartHeight.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *TransactionInfoRequest_StartHeight) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TransactionInfoRequest_StartHeight) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintView(dAtA, i, uint64(m.StartHeight)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} +func (m *TransactionInfoRequest_EndHeight) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TransactionInfoRequest_EndHeight) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintView(dAtA, i, uint64(m.EndHeight)) + i-- + dAtA[i] = 0x10 + return len(dAtA) - i, nil +} +func (m *TransactionInfo) 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 *TransactionInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TransactionInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.View != nil { + { + size, err := m.View.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Perspective != nil { + { + size, err := m.Perspective.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Transaction != nil { + { + size, err := m.Transaction.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Id != nil { + { + size, err := m.Id.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.XHeight != nil { + { + size := m.XHeight.Size() + i -= size + if _, err := m.XHeight.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *TransactionInfo_Height) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TransactionInfo_Height) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintView(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} +func (m *TransactionInfoResponse) 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 *TransactionInfoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TransactionInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TxInfo != nil { + { + size, err := m.TxInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TransactionInfoByHashResponse) 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 *TransactionInfoByHashResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TransactionInfoByHashResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TxInfo != nil { + { + size, err := m.TxInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NotesResponse) 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 *NotesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NotesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NoteRecord != nil { + { + size, err := m.NoteRecord.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NotesForVotingResponse) 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 *NotesForVotingResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NotesForVotingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.IdentityKey != nil { + { + size, err := m.IdentityKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.NoteRecord != nil { + { + size, err := m.NoteRecord.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SpendableNoteRecord) 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 *SpendableNoteRecord) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpendableNoteRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Source != nil { + { + size, err := m.Source.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.Position != 0 { + i = encodeVarintView(dAtA, i, uint64(m.Position)) + i-- + dAtA[i] = 0x38 + } + if m.XHeightSpent != nil { + { + size := m.XHeightSpent.Size() + i -= size + if _, err := m.XHeightSpent.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.HeightCreated != 0 { + i = encodeVarintView(dAtA, i, uint64(m.HeightCreated)) + i-- + dAtA[i] = 0x28 + } + if m.Nullifier != nil { + { + size, err := m.Nullifier.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.AddressIndex != nil { + { + size, err := m.AddressIndex.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Note != nil { + { + size, err := m.Note.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.NoteCommitment != nil { + { + size, err := m.NoteCommitment.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SpendableNoteRecord_HeightSpent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpendableNoteRecord_HeightSpent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintView(dAtA, i, uint64(m.HeightSpent)) + i-- + dAtA[i] = 0x30 + return len(dAtA) - i, nil +} +func (m *SwapRecord) 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 *SwapRecord) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SwapRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Source != nil { + { + size, err := m.Source.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.XHeightClaimed != nil { + { + size := m.XHeightClaimed.Size() + i -= size + if _, err := m.XHeightClaimed.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.OutputData != nil { + { + size, err := m.OutputData.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Nullifier != nil { + { + size, err := m.Nullifier.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Position != 0 { + i = encodeVarintView(dAtA, i, uint64(m.Position)) + i-- + dAtA[i] = 0x18 + } + if m.Swap != nil { + { + size, err := m.Swap.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.SwapCommitment != nil { + { + size, err := m.SwapCommitment.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintView(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SwapRecord_HeightClaimed) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SwapRecord_HeightClaimed) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintView(dAtA, i, uint64(m.HeightClaimed)) + i-- + dAtA[i] = 0x30 + return len(dAtA) - i, nil +} +func encodeVarintView(dAtA []byte, offset int, v uint64) int { + offset -= sovView(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *BroadcastTransactionRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Transaction != nil { + l = m.Transaction.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.AwaitDetection { + n += 2 + } + return n +} + +func (m *BroadcastTransactionResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != nil { + l = m.Id.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.DetectionHeight != 0 { + n += 1 + sovView(uint64(m.DetectionHeight)) + } + return n +} + +func (m *TransactionPlannerRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ExpiryHeight != 0 { + n += 1 + sovView(uint64(m.ExpiryHeight)) + } + if m.Fee != nil { + l = m.Fee.Size() + n += 1 + l + sovView(uint64(l)) + } + l = len(m.Memo) + if l > 0 { + n += 1 + l + sovView(uint64(l)) + } + if m.XAccountGroupId != nil { + n += m.XAccountGroupId.Size() + } + if len(m.Outputs) > 0 { + for _, e := range m.Outputs { + l = e.Size() + n += 2 + l + sovView(uint64(l)) + } + } + if len(m.Swaps) > 0 { + for _, e := range m.Swaps { + l = e.Size() + n += 2 + l + sovView(uint64(l)) + } + } + if len(m.Delegations) > 0 { + for _, e := range m.Delegations { + l = e.Size() + n += 2 + l + sovView(uint64(l)) + } + } + if len(m.Undelegations) > 0 { + for _, e := range m.Undelegations { + l = e.Size() + n += 2 + l + sovView(uint64(l)) + } + } + if len(m.IbcActions) > 0 { + for _, e := range m.IbcActions { + l = e.Size() + n += 2 + l + sovView(uint64(l)) + } + } + return n +} + +func (m *TransactionPlannerRequest_AccountGroupId) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AccountGroupId != nil { + l = m.AccountGroupId.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} +func (m *TransactionPlannerRequest_Output) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != nil { + l = m.Value.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.Address != nil { + l = m.Address.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *TransactionPlannerRequest_Swap) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != nil { + l = m.Value.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.TargetAsset != nil { + l = m.TargetAsset.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.Fee != nil { + l = m.Fee.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *TransactionPlannerRequest_Delegate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Amount != nil { + l = m.Amount.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.IdentityKey != nil { + l = m.IdentityKey.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *TransactionPlannerRequest_Undelegate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != nil { + l = m.Value.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *TransactionPlannerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Plan != nil { + l = m.Plan.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *AddressByIndexRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AddressIndex != nil { + l = m.AddressIndex.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *AddressByIndexResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Address != nil { + l = m.Address.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *IndexByAddressRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Address != nil { + l = m.Address.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *IndexByAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XAddressIndex != nil { + n += m.XAddressIndex.Size() + } + return n +} + +func (m *IndexByAddressResponse_AddressIndex) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AddressIndex != nil { + l = m.AddressIndex.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} +func (m *EphemeralAddressRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AddressIndex != nil { + l = m.AddressIndex.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *EphemeralAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Address != nil { + l = m.Address.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *BalanceByAddressRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Address != nil { + l = m.Address.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *BalanceByAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Asset != nil { + l = m.Asset.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.Amount != nil { + l = m.Amount.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *ViewAuthToken) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Inner) + if l > 0 { + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *ViewAuthRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Fvk != nil { + l = m.Fvk.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *ViewAuthResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Token != nil { + l = m.Token.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *StatusRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XAccountGroupId != nil { + n += m.XAccountGroupId.Size() + } + return n +} + +func (m *StatusRequest_AccountGroupId) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AccountGroupId != nil { + l = m.AccountGroupId.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} +func (m *StatusResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SyncHeight != 0 { + n += 1 + sovView(uint64(m.SyncHeight)) + } + if m.CatchingUp { + n += 2 + } + return n +} + +func (m *StatusStreamRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XAccountGroupId != nil { + n += m.XAccountGroupId.Size() + } + return n +} + +func (m *StatusStreamRequest_AccountGroupId) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AccountGroupId != nil { + l = m.AccountGroupId.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} +func (m *StatusStreamResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.LatestKnownBlockHeight != 0 { + n += 1 + sovView(uint64(m.LatestKnownBlockHeight)) + } + if m.SyncHeight != 0 { + n += 1 + sovView(uint64(m.SyncHeight)) + } + return n +} + +func (m *NotesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.IncludeSpent { + n += 2 + } + if m.AssetId != nil { + l = m.AssetId.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.AddressIndex != nil { + l = m.AddressIndex.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.AmountToSpend != nil { + l = m.AmountToSpend.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.XAccountGroupId != nil { + n += m.XAccountGroupId.Size() + } + return n +} + +func (m *NotesRequest_AccountGroupId) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AccountGroupId != nil { + l = m.AccountGroupId.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} +func (m *NotesForVotingRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.VotableAtHeight != 0 { + n += 1 + sovView(uint64(m.VotableAtHeight)) + } + if m.AddressIndex != nil { + l = m.AddressIndex.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.XAccountGroupId != nil { + n += m.XAccountGroupId.Size() + } + return n +} + +func (m *NotesForVotingRequest_AccountGroupId) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AccountGroupId != nil { + l = m.AccountGroupId.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} +func (m *WitnessRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.NoteCommitments) > 0 { + for _, e := range m.NoteCommitments { + l = e.Size() + n += 1 + l + sovView(uint64(l)) + } + } + if m.TransactionPlan != nil { + l = m.TransactionPlan.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.XAccountGroupId != nil { + n += m.XAccountGroupId.Size() + } + return n +} + +func (m *WitnessRequest_AccountGroupId) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AccountGroupId != nil { + l = m.AccountGroupId.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} +func (m *WitnessResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.WitnessData != nil { + l = m.WitnessData.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *WitnessAndBuildRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TransactionPlan != nil { + l = m.TransactionPlan.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.AuthorizationData != nil { + l = m.AuthorizationData.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *WitnessAndBuildResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Transaction != nil { + l = m.Transaction.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *AssetsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Filtered { + n += 2 + } + if len(m.IncludeSpecificDenominations) > 0 { + for _, e := range m.IncludeSpecificDenominations { + l = e.Size() + n += 1 + l + sovView(uint64(l)) + } + } + if m.IncludeDelegationTokens { + n += 2 + } + if m.IncludeUnbondingTokens { + n += 2 + } + if m.IncludeLpNfts { + n += 2 + } + if m.IncludeProposalNfts { + n += 2 + } + if m.IncludeVotingReceiptTokens { + n += 2 + } + return n +} + +func (m *AssetsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Asset != nil { + l = m.Asset.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *ChainParametersRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *ChainParametersResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Parameters != nil { + l = m.Parameters.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *FMDParametersRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *FMDParametersResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Parameters != nil { + l = m.Parameters.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *NoteByCommitmentRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NoteCommitment != nil { + l = m.NoteCommitment.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.AwaitDetection { + n += 2 + } + if m.XAccountGroupId != nil { + n += m.XAccountGroupId.Size() + } + return n +} + +func (m *NoteByCommitmentRequest_AccountGroupId) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AccountGroupId != nil { + l = m.AccountGroupId.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} +func (m *NoteByCommitmentResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SpendableNote != nil { + l = m.SpendableNote.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *SwapByCommitmentRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SwapCommitment != nil { + l = m.SwapCommitment.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.AwaitDetection { + n += 2 + } + if m.XAccountGroupId != nil { + n += m.XAccountGroupId.Size() + } + return n +} + +func (m *SwapByCommitmentRequest_AccountGroupId) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AccountGroupId != nil { + l = m.AccountGroupId.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} +func (m *SwapByCommitmentResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Swap != nil { + l = m.Swap.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *NullifierStatusRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Nullifier != nil { + l = m.Nullifier.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.AwaitDetection { + n += 2 + } + if m.XAccountGroupId != nil { + n += m.XAccountGroupId.Size() + } + return n +} + +func (m *NullifierStatusRequest_AccountGroupId) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AccountGroupId != nil { + l = m.AccountGroupId.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} +func (m *NullifierStatusResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Spent { + n += 2 + } + return n +} + +func (m *TransactionInfoByHashRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != nil { + l = m.Id.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *TransactionInfoRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XStartHeight != nil { + n += m.XStartHeight.Size() + } + if m.XEndHeight != nil { + n += m.XEndHeight.Size() + } + return n +} + +func (m *TransactionInfoRequest_StartHeight) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovView(uint64(m.StartHeight)) + return n +} +func (m *TransactionInfoRequest_EndHeight) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovView(uint64(m.EndHeight)) + return n +} +func (m *TransactionInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XHeight != nil { + n += m.XHeight.Size() + } + if m.Id != nil { + l = m.Id.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.Transaction != nil { + l = m.Transaction.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.Perspective != nil { + l = m.Perspective.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.View != nil { + l = m.View.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *TransactionInfo_Height) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovView(uint64(m.Height)) + return n +} +func (m *TransactionInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TxInfo != nil { + l = m.TxInfo.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *TransactionInfoByHashResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TxInfo != nil { + l = m.TxInfo.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *NotesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NoteRecord != nil { + l = m.NoteRecord.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *NotesForVotingResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NoteRecord != nil { + l = m.NoteRecord.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.IdentityKey != nil { + l = m.IdentityKey.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *SpendableNoteRecord) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NoteCommitment != nil { + l = m.NoteCommitment.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.Note != nil { + l = m.Note.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.AddressIndex != nil { + l = m.AddressIndex.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.Nullifier != nil { + l = m.Nullifier.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.HeightCreated != 0 { + n += 1 + sovView(uint64(m.HeightCreated)) + } + if m.XHeightSpent != nil { + n += m.XHeightSpent.Size() + } + if m.Position != 0 { + n += 1 + sovView(uint64(m.Position)) + } + if m.Source != nil { + l = m.Source.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *SpendableNoteRecord_HeightSpent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovView(uint64(m.HeightSpent)) + return n +} +func (m *SwapRecord) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SwapCommitment != nil { + l = m.SwapCommitment.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.Swap != nil { + l = m.Swap.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.Position != 0 { + n += 1 + sovView(uint64(m.Position)) + } + if m.Nullifier != nil { + l = m.Nullifier.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.OutputData != nil { + l = m.OutputData.Size() + n += 1 + l + sovView(uint64(l)) + } + if m.XHeightClaimed != nil { + n += m.XHeightClaimed.Size() + } + if m.Source != nil { + l = m.Source.Size() + n += 1 + l + sovView(uint64(l)) + } + return n +} + +func (m *SwapRecord_HeightClaimed) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovView(uint64(m.HeightClaimed)) + return n +} + +func sovView(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozView(x uint64) (n int) { + return sovView(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *BroadcastTransactionRequest) 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 ErrIntOverflowView + } + 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: BroadcastTransactionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BroadcastTransactionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Transaction", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Transaction == nil { + m.Transaction = &v1alpha1.Transaction{} + } + if err := m.Transaction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AwaitDetection", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AwaitDetection = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BroadcastTransactionResponse) 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 ErrIntOverflowView + } + 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: BroadcastTransactionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BroadcastTransactionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Id == nil { + m.Id = &v1alpha1.Id{} + } + if err := m.Id.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DetectionHeight", wireType) + } + m.DetectionHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DetectionHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TransactionPlannerRequest) 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 ErrIntOverflowView + } + 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: TransactionPlannerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TransactionPlannerRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpiryHeight", wireType) + } + m.ExpiryHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExpiryHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Fee == nil { + m.Fee = &v1alpha11.Fee{} + } + if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Memo", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + 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 ErrInvalidLengthView + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Memo = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccountGroupId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.AccountGroupId{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.XAccountGroupId = &TransactionPlannerRequest_AccountGroupId{v} + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Outputs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Outputs = append(m.Outputs, &TransactionPlannerRequest_Output{}) + if err := m.Outputs[len(m.Outputs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 30: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Swaps", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Swaps = append(m.Swaps, &TransactionPlannerRequest_Swap{}) + if err := m.Swaps[len(m.Swaps)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 40: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Delegations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Delegations = append(m.Delegations, &TransactionPlannerRequest_Delegate{}) + if err := m.Delegations[len(m.Delegations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 50: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Undelegations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Undelegations = append(m.Undelegations, &TransactionPlannerRequest_Undelegate{}) + if err := m.Undelegations[len(m.Undelegations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 60: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IbcActions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IbcActions = append(m.IbcActions, &v1alpha12.IbcAction{}) + if err := m.IbcActions[len(m.IbcActions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TransactionPlannerRequest_Output) 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 ErrIntOverflowView + } + 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: Output: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Output: 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 msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Value == nil { + m.Value = &v1alpha11.Value{} + } + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Address == nil { + m.Address = &v1alpha11.Address{} + } + if err := m.Address.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TransactionPlannerRequest_Swap) 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 ErrIntOverflowView + } + 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: Swap: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Swap: 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 msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Value == nil { + m.Value = &v1alpha11.Value{} + } + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TargetAsset", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TargetAsset == nil { + m.TargetAsset = &v1alpha11.AssetId{} + } + if err := m.TargetAsset.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Fee == nil { + m.Fee = &v1alpha11.Fee{} + } + if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TransactionPlannerRequest_Delegate) 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 ErrIntOverflowView + } + 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: Delegate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Delegate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Amount == nil { + m.Amount = &v1alpha11.Amount{} + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IdentityKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.IdentityKey == nil { + m.IdentityKey = &v1alpha11.IdentityKey{} + } + if err := m.IdentityKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TransactionPlannerRequest_Undelegate) 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 ErrIntOverflowView + } + 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: Undelegate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Undelegate: 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 msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Value == nil { + m.Value = &v1alpha11.Value{} + } + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TransactionPlannerResponse) 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 ErrIntOverflowView + } + 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: TransactionPlannerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TransactionPlannerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Plan", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Plan == nil { + m.Plan = &v1alpha1.TransactionPlan{} + } + if err := m.Plan.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AddressByIndexRequest) 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 ErrIntOverflowView + } + 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: AddressByIndexRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddressByIndexRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AddressIndex", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AddressIndex == nil { + m.AddressIndex = &v1alpha11.AddressIndex{} + } + if err := m.AddressIndex.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AddressByIndexResponse) 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 ErrIntOverflowView + } + 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: AddressByIndexResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddressByIndexResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Address == nil { + m.Address = &v1alpha11.Address{} + } + if err := m.Address.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *IndexByAddressRequest) 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 ErrIntOverflowView + } + 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: IndexByAddressRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IndexByAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Address == nil { + m.Address = &v1alpha11.Address{} + } + if err := m.Address.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *IndexByAddressResponse) 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 ErrIntOverflowView + } + 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: IndexByAddressResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IndexByAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AddressIndex", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.AddressIndex{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.XAddressIndex = &IndexByAddressResponse_AddressIndex{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EphemeralAddressRequest) 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 ErrIntOverflowView + } + 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: EphemeralAddressRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EphemeralAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AddressIndex", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AddressIndex == nil { + m.AddressIndex = &v1alpha11.AddressIndex{} + } + if err := m.AddressIndex.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EphemeralAddressResponse) 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 ErrIntOverflowView + } + 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: EphemeralAddressResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EphemeralAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Address == nil { + m.Address = &v1alpha11.Address{} + } + if err := m.Address.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BalanceByAddressRequest) 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 ErrIntOverflowView + } + 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: BalanceByAddressRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BalanceByAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Address == nil { + m.Address = &v1alpha11.Address{} + } + if err := m.Address.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BalanceByAddressResponse) 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 ErrIntOverflowView + } + 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: BalanceByAddressResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BalanceByAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Asset", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Asset == nil { + m.Asset = &v1alpha11.AssetId{} + } + if err := m.Asset.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Amount == nil { + m.Amount = &v1alpha11.Amount{} + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ViewAuthToken) 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 ErrIntOverflowView + } + 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: ViewAuthToken: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ViewAuthToken: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inner = append(m.Inner[:0], dAtA[iNdEx:postIndex]...) + if m.Inner == nil { + m.Inner = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ViewAuthRequest) 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 ErrIntOverflowView + } + 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: ViewAuthRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ViewAuthRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fvk", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Fvk == nil { + m.Fvk = &v1alpha11.FullViewingKey{} + } + if err := m.Fvk.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ViewAuthResponse) 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 ErrIntOverflowView + } + 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: ViewAuthResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ViewAuthResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Token == nil { + m.Token = &ViewAuthToken{} + } + if err := m.Token.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StatusRequest) 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 ErrIntOverflowView + } + 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: StatusRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccountGroupId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.AccountGroupId{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.XAccountGroupId = &StatusRequest_AccountGroupId{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StatusResponse) 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 ErrIntOverflowView + } + 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: StatusResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SyncHeight", wireType) + } + m.SyncHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SyncHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CatchingUp", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.CatchingUp = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StatusStreamRequest) 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 ErrIntOverflowView + } + 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: StatusStreamRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StatusStreamRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccountGroupId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.AccountGroupId{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.XAccountGroupId = &StatusStreamRequest_AccountGroupId{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StatusStreamResponse) 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 ErrIntOverflowView + } + 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: StatusStreamResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StatusStreamResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LatestKnownBlockHeight", wireType) + } + m.LatestKnownBlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LatestKnownBlockHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SyncHeight", wireType) + } + m.SyncHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SyncHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NotesRequest) 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 ErrIntOverflowView + } + 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: NotesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NotesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IncludeSpent", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IncludeSpent = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AssetId == nil { + m.AssetId = &v1alpha11.AssetId{} + } + if err := m.AssetId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AddressIndex", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AddressIndex == nil { + m.AddressIndex = &v1alpha11.AddressIndex{} + } + if err := m.AddressIndex.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AmountToSpend", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AmountToSpend == nil { + m.AmountToSpend = &v1alpha11.Amount{} + } + if err := m.AmountToSpend.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccountGroupId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.AccountGroupId{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.XAccountGroupId = &NotesRequest_AccountGroupId{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NotesForVotingRequest) 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 ErrIntOverflowView + } + 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: NotesForVotingRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NotesForVotingRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field VotableAtHeight", wireType) + } + m.VotableAtHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.VotableAtHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AddressIndex", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AddressIndex == nil { + m.AddressIndex = &v1alpha11.AddressIndex{} + } + if err := m.AddressIndex.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccountGroupId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.AccountGroupId{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.XAccountGroupId = &NotesForVotingRequest_AccountGroupId{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WitnessRequest) 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 ErrIntOverflowView + } + 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: WitnessRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WitnessRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NoteCommitments", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NoteCommitments = append(m.NoteCommitments, &v1alpha11.StateCommitment{}) + if err := m.NoteCommitments[len(m.NoteCommitments)-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 TransactionPlan", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TransactionPlan == nil { + m.TransactionPlan = &v1alpha1.TransactionPlan{} + } + if err := m.TransactionPlan.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccountGroupId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.AccountGroupId{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.XAccountGroupId = &WitnessRequest_AccountGroupId{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WitnessResponse) 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 ErrIntOverflowView + } + 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: WitnessResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WitnessResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WitnessData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.WitnessData == nil { + m.WitnessData = &v1alpha1.WitnessData{} + } + if err := m.WitnessData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WitnessAndBuildRequest) 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 ErrIntOverflowView + } + 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: WitnessAndBuildRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WitnessAndBuildRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TransactionPlan", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TransactionPlan == nil { + m.TransactionPlan = &v1alpha1.TransactionPlan{} + } + if err := m.TransactionPlan.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthorizationData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuthorizationData == nil { + m.AuthorizationData = &v1alpha1.AuthorizationData{} + } + if err := m.AuthorizationData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WitnessAndBuildResponse) 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 ErrIntOverflowView + } + 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: WitnessAndBuildResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WitnessAndBuildResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Transaction", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Transaction == nil { + m.Transaction = &v1alpha1.Transaction{} + } + if err := m.Transaction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AssetsRequest) 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 ErrIntOverflowView + } + 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: AssetsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AssetsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Filtered", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Filtered = bool(v != 0) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IncludeSpecificDenominations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IncludeSpecificDenominations = append(m.IncludeSpecificDenominations, &v1alpha11.Denom{}) + if err := m.IncludeSpecificDenominations[len(m.IncludeSpecificDenominations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IncludeDelegationTokens", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IncludeDelegationTokens = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IncludeUnbondingTokens", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IncludeUnbondingTokens = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IncludeLpNfts", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IncludeLpNfts = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IncludeProposalNfts", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IncludeProposalNfts = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IncludeVotingReceiptTokens", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IncludeVotingReceiptTokens = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AssetsResponse) 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 ErrIntOverflowView + } + 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: AssetsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AssetsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Asset", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Asset == nil { + m.Asset = &v1alpha11.Asset{} + } + if err := m.Asset.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ChainParametersRequest) 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 ErrIntOverflowView + } + 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: ChainParametersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChainParametersRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ChainParametersResponse) 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 ErrIntOverflowView + } + 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: ChainParametersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChainParametersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Parameters == nil { + m.Parameters = &v1alpha13.ChainParameters{} + } + if err := m.Parameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FMDParametersRequest) 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 ErrIntOverflowView + } + 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: FMDParametersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FMDParametersRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FMDParametersResponse) 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 ErrIntOverflowView + } + 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: FMDParametersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FMDParametersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Parameters == nil { + m.Parameters = &v1alpha13.FmdParameters{} + } + if err := m.Parameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NoteByCommitmentRequest) 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 ErrIntOverflowView + } + 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: NoteByCommitmentRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NoteByCommitmentRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NoteCommitment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NoteCommitment == nil { + m.NoteCommitment = &v1alpha11.StateCommitment{} + } + if err := m.NoteCommitment.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AwaitDetection", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AwaitDetection = bool(v != 0) + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccountGroupId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.AccountGroupId{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.XAccountGroupId = &NoteByCommitmentRequest_AccountGroupId{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NoteByCommitmentResponse) 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 ErrIntOverflowView + } + 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: NoteByCommitmentResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NoteByCommitmentResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpendableNote", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SpendableNote == nil { + m.SpendableNote = &SpendableNoteRecord{} + } + if err := m.SpendableNote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SwapByCommitmentRequest) 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 ErrIntOverflowView + } + 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: SwapByCommitmentRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SwapByCommitmentRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SwapCommitment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SwapCommitment == nil { + m.SwapCommitment = &v1alpha11.StateCommitment{} + } + if err := m.SwapCommitment.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AwaitDetection", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AwaitDetection = bool(v != 0) + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccountGroupId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.AccountGroupId{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.XAccountGroupId = &SwapByCommitmentRequest_AccountGroupId{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SwapByCommitmentResponse) 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 ErrIntOverflowView + } + 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: SwapByCommitmentResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SwapByCommitmentResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Swap", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Swap == nil { + m.Swap = &SwapRecord{} + } + if err := m.Swap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NullifierStatusRequest) 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 ErrIntOverflowView + } + 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: NullifierStatusRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NullifierStatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nullifier", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Nullifier == nil { + m.Nullifier = &v1alpha11.Nullifier{} + } + if err := m.Nullifier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AwaitDetection", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AwaitDetection = bool(v != 0) + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccountGroupId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &v1alpha11.AccountGroupId{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.XAccountGroupId = &NullifierStatusRequest_AccountGroupId{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NullifierStatusResponse) 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 ErrIntOverflowView + } + 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: NullifierStatusResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NullifierStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Spent", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Spent = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TransactionInfoByHashRequest) 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 ErrIntOverflowView + } + 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: TransactionInfoByHashRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TransactionInfoByHashRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Id == nil { + m.Id = &v1alpha1.Id{} + } + if err := m.Id.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TransactionInfoRequest) 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 ErrIntOverflowView + } + 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: TransactionInfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TransactionInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartHeight", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.XStartHeight = &TransactionInfoRequest_StartHeight{v} + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EndHeight", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.XEndHeight = &TransactionInfoRequest_EndHeight{v} + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TransactionInfo) 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 ErrIntOverflowView + } + 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: TransactionInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TransactionInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.XHeight = &TransactionInfo_Height{v} + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Id == nil { + m.Id = &v1alpha1.Id{} + } + if err := m.Id.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Transaction", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Transaction == nil { + m.Transaction = &v1alpha1.Transaction{} + } + if err := m.Transaction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Perspective", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Perspective == nil { + m.Perspective = &v1alpha1.TransactionPerspective{} + } + if err := m.Perspective.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field View", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.View == nil { + m.View = &v1alpha1.TransactionView{} + } + if err := m.View.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TransactionInfoResponse) 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 ErrIntOverflowView + } + 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: TransactionInfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TransactionInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TxInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TxInfo == nil { + m.TxInfo = &TransactionInfo{} + } + if err := m.TxInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TransactionInfoByHashResponse) 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 ErrIntOverflowView + } + 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: TransactionInfoByHashResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TransactionInfoByHashResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TxInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TxInfo == nil { + m.TxInfo = &TransactionInfo{} + } + if err := m.TxInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NotesResponse) 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 ErrIntOverflowView + } + 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: NotesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NotesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NoteRecord", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NoteRecord == nil { + m.NoteRecord = &SpendableNoteRecord{} + } + if err := m.NoteRecord.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NotesForVotingResponse) 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 ErrIntOverflowView + } + 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: NotesForVotingResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NotesForVotingResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NoteRecord", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NoteRecord == nil { + m.NoteRecord = &SpendableNoteRecord{} + } + if err := m.NoteRecord.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IdentityKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.IdentityKey == nil { + m.IdentityKey = &v1alpha11.IdentityKey{} + } + if err := m.IdentityKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SpendableNoteRecord) 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 ErrIntOverflowView + } + 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: SpendableNoteRecord: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SpendableNoteRecord: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NoteCommitment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NoteCommitment == nil { + m.NoteCommitment = &v1alpha11.StateCommitment{} + } + if err := m.NoteCommitment.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Note", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Note == nil { + m.Note = &v1alpha11.Note{} + } + if err := m.Note.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AddressIndex", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AddressIndex == nil { + m.AddressIndex = &v1alpha11.AddressIndex{} + } + if err := m.AddressIndex.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nullifier", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Nullifier == nil { + m.Nullifier = &v1alpha11.Nullifier{} + } + if err := m.Nullifier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HeightCreated", wireType) + } + m.HeightCreated = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.HeightCreated |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HeightSpent", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.XHeightSpent = &SpendableNoteRecord_HeightSpent{v} + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Position", wireType) + } + m.Position = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Position |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Source == nil { + m.Source = &v1alpha13.NoteSource{} + } + if err := m.Source.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SwapRecord) 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 ErrIntOverflowView + } + 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: SwapRecord: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SwapRecord: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SwapCommitment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SwapCommitment == nil { + m.SwapCommitment = &v1alpha11.StateCommitment{} + } + if err := m.SwapCommitment.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Swap", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Swap == nil { + m.Swap = &v1alpha14.SwapPlaintext{} + } + if err := m.Swap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Position", wireType) + } + m.Position = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Position |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nullifier", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Nullifier == nil { + m.Nullifier = &v1alpha11.Nullifier{} + } + if err := m.Nullifier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutputData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.OutputData == nil { + m.OutputData = &v1alpha14.BatchSwapOutputData{} + } + if err := m.OutputData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HeightClaimed", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.XHeightClaimed = &SwapRecord_HeightClaimed{v} + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowView + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthView + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthView + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Source == nil { + m.Source = &v1alpha13.NoteSource{} + } + if err := m.Source.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipView(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthView + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipView(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, ErrIntOverflowView + } + 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, ErrIntOverflowView + } + 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, ErrIntOverflowView + } + 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, ErrInvalidLengthView + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupView + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthView + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthView = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowView = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupView = fmt.Errorf("proto: unexpected end of group") +) diff --git a/relayer/channel.go b/relayer/channel.go index 27121b2a1..2f3f32b64 100644 --- a/relayer/channel.go +++ b/relayer/channel.go @@ -59,6 +59,7 @@ func (c *Chain) CreateOpenChannels( memo, DefaultClientUpdateThreshold, DefaultFlushInterval, + DefaultMaxMsgLength, ) c.log.Info("Starting event processor for channel handshake", @@ -114,9 +115,48 @@ func (c *Chain) CloseChannel( // Timeout is per message. Two close channel handshake messages, allowing maxRetries for each. processorTimeout := timeout * 2 * time.Duration(maxRetries) + // Perform a flush first so that any timeouts are cleared. + flushCtx, flushCancel := context.WithTimeout(ctx, processorTimeout) + defer flushCancel() + + flushProcessor := processor.NewEventProcessor(). + WithChainProcessors( + c.chainProcessor(c.log, nil), + dst.chainProcessor(c.log, nil), + ). + WithPathProcessors(processor.NewPathProcessor( + c.log, + processor.NewPathEnd(pathName, c.PathEnd.ChainID, c.PathEnd.ClientID, "", []processor.ChainChannelKey{}), + processor.NewPathEnd(pathName, dst.PathEnd.ChainID, dst.PathEnd.ClientID, "", []processor.ChainChannelKey{}), + nil, + memo, + DefaultClientUpdateThreshold, + DefaultFlushInterval, + DefaultMaxMsgLength, + )). + WithInitialBlockHistory(0). + WithMessageLifecycle(&processor.FlushLifecycle{}). + Build() + + c.log.Info("Starting event processor for flush before channel close", + zap.String("src_chain_id", c.PathEnd.ChainID), + zap.String("src_port_id", srcPortID), + zap.String("dst_chain_id", dst.PathEnd.ChainID), + ) + + if err := flushProcessor.Run(flushCtx); err != nil { + return err + } + ctx, cancel := context.WithTimeout(ctx, processorTimeout) defer cancel() + c.log.Info("Starting event processor for channel close", + zap.String("src_chain_id", c.PathEnd.ChainID), + zap.String("src_port_id", srcPortID), + zap.String("dst_chain_id", dst.PathEnd.ChainID), + ) + return processor.NewEventProcessor(). WithChainProcessors( c.chainProcessor(c.log, nil), @@ -130,26 +170,15 @@ func (c *Chain) CloseChannel( memo, DefaultClientUpdateThreshold, DefaultFlushInterval, + DefaultMaxMsgLength, )). WithInitialBlockHistory(0). - WithMessageLifecycle(&processor.ChannelMessageLifecycle{ - Initial: &processor.ChannelMessage{ - ChainID: c.PathEnd.ChainID, - EventType: chantypes.EventTypeChannelCloseInit, - Info: provider.ChannelInfo{ - PortID: srcPortID, - ChannelID: srcChanID, - ConnID: c.PathEnd.ConnectionID, - }, - }, - Termination: &processor.ChannelMessage{ - ChainID: dst.PathEnd.ChainID, - EventType: chantypes.EventTypeChannelCloseConfirm, - Info: provider.ChannelInfo{ - CounterpartyPortID: srcPortID, - CounterpartyChannelID: srcChanID, - }, - }, + WithMessageLifecycle(&processor.ChannelCloseLifecycle{ + SrcChainID: c.PathEnd.ChainID, + SrcChannelID: srcChanID, + SrcPortID: srcPortID, + SrcConnID: c.PathEnd.ConnectionID, + DstConnID: dst.PathEnd.ConnectionID, }). Build(). Run(ctx) diff --git a/relayer/codecs/ethermint/algorithm.go b/relayer/codecs/ethermint/algorithm.go index 121af6e61..510b18542 100644 --- a/relayer/codecs/ethermint/algorithm.go +++ b/relayer/codecs/ethermint/algorithm.go @@ -1,8 +1,8 @@ package ethermint import ( + "github.com/btcsuite/btcd/btcutil/hdkeychain" "github.com/btcsuite/btcd/chaincfg" - "github.com/btcsuite/btcutil/hdkeychain" "github.com/tyler-smith/go-bip39" "github.com/ethereum/go-ethereum/accounts" diff --git a/relayer/codecs/ethermint/codec.go b/relayer/codecs/ethermint/codec.go index df398a823..e47d748a6 100644 --- a/relayer/codecs/ethermint/codec.go +++ b/relayer/codecs/ethermint/codec.go @@ -3,7 +3,6 @@ package ethermint import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - "github.com/cosmos/cosmos-sdk/types/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -20,9 +19,5 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { (*authtypes.GenesisAccount)(nil), &EthAccount{}, ) - registry.RegisterImplementations( - (*tx.ExtensionOptionI)(nil), - &ExtensionOptionsWeb3Tx{}, - &ExtensionOptionDynamicFeeTx{}, - ) + } diff --git a/relayer/codecs/injective/algorithm.go b/relayer/codecs/injective/algorithm.go index 4b6edd110..187a387f6 100644 --- a/relayer/codecs/injective/algorithm.go +++ b/relayer/codecs/injective/algorithm.go @@ -1,8 +1,8 @@ package injective import ( + "github.com/btcsuite/btcd/btcutil/hdkeychain" "github.com/btcsuite/btcd/chaincfg" - "github.com/btcsuite/btcutil/hdkeychain" "github.com/cosmos/cosmos-sdk/crypto/hd" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" ethaccounts "github.com/ethereum/go-ethereum/accounts" diff --git a/relayer/connection.go b/relayer/connection.go index 1f818eff7..df784d504 100644 --- a/relayer/connection.go +++ b/relayer/connection.go @@ -40,6 +40,7 @@ func (c *Chain) CreateOpenConnections( memo, DefaultClientUpdateThreshold, DefaultFlushInterval, + DefaultMaxMsgLength, ) var connectionSrc, connectionDst string diff --git a/relayer/events.go b/relayer/events.go new file mode 100644 index 000000000..799844e89 --- /dev/null +++ b/relayer/events.go @@ -0,0 +1,55 @@ +package relayer + +import ( + "fmt" + + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + connectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + "github.com/cosmos/relayer/v2/relayer/provider" +) + +// ParseClientIDFromEvents parses events emitted from a MsgCreateClient and returns the +// client identifier. +func ParseClientIDFromEvents(events []provider.RelayerEvent) (string, error) { + for _, event := range events { + if event.EventType == clienttypes.EventTypeCreateClient { + for attributeKey, attributeValue := range event.Attributes { + if attributeKey == clienttypes.AttributeKeyClientID { + return attributeValue, nil + } + } + } + } + return "", fmt.Errorf("client identifier event attribute not found") +} + +// ParseConnectionIDFromEvents parses events emitted from a MsgConnectionOpenInit or +// MsgConnectionOpenTry and returns the connection identifier. +func ParseConnectionIDFromEvents(events []provider.RelayerEvent) (string, error) { + for _, event := range events { + if event.EventType == connectiontypes.EventTypeConnectionOpenInit || event.EventType == connectiontypes.EventTypeConnectionOpenTry { + for attributeKey, attributeValue := range event.Attributes { + if attributeKey == connectiontypes.AttributeKeyConnectionID { + return attributeValue, nil + } + } + } + } + return "", fmt.Errorf("connection identifier event attribute not found") +} + +// ParseChannelIDFromEvents parses events emitted from a MsgChannelOpenInit or +// MsgChannelOpenTry and returns the channel identifier. +func ParseChannelIDFromEvents(events []provider.RelayerEvent) (string, error) { + for _, event := range events { + if event.EventType == channeltypes.EventTypeChannelOpenInit || event.EventType == channeltypes.EventTypeChannelOpenTry { + for attributeKey, attributeValue := range event.Attributes { + if attributeKey == channeltypes.AttributeKeyChannelID { + return attributeValue, nil + } + } + } + } + return "", fmt.Errorf("channel identifier event attribute not found") +} diff --git a/relayer/packet-tx.go b/relayer/packet-tx.go index ecc2146e0..1cb38c7b3 100644 --- a/relayer/packet-tx.go +++ b/relayer/packet-tx.go @@ -113,7 +113,15 @@ func (c *Chain) SendTransferMsg(ctx context.Context, log *zap.Logger, dst *Chain ) } return err + } else { + if result.SuccessfullySent() { + c.log.Info( + "Successfully sent a transfer", + zap.String("src_chain_id", c.ChainID()), + zap.String("dst_chain_id", dst.ChainID()), + zap.Object("send_result", result), + ) + } } - return nil } diff --git a/relayer/processor/message_processor.go b/relayer/processor/message_processor.go index a0964a751..b6137854e 100644 --- a/relayer/processor/message_processor.go +++ b/relayer/processor/message_processor.go @@ -411,6 +411,7 @@ func (mp *messageProcessor) sendClientUpdate( if err := dst.chainProvider.SendMessagesToMempool(broadcastCtx, msgs, mp.memo, ctx, nil); err != nil { mp.log.Error("Error sending client update message", + zap.String("path_name", src.info.PathName), zap.String("src_chain_id", src.info.ChainID), zap.String("dst_chain_id", dst.info.ChainID), zap.String("src_client_id", src.info.ClientID), @@ -467,6 +468,7 @@ func (mp *messageProcessor) sendBatchMessages( if err := dst.chainProvider.SendMessagesToMempool(broadcastCtx, msgs, mp.memo, ctx, callback); err != nil { errFields := []zapcore.Field{ + zap.String("path_name", src.info.PathName), zap.String("src_chain_id", src.info.ChainID), zap.String("dst_chain_id", dst.info.ChainID), zap.String("src_client_id", src.info.ClientID), @@ -522,6 +524,7 @@ func (mp *messageProcessor) sendSingleMessage( err := dst.chainProvider.SendMessagesToMempool(broadcastCtx, msgs, mp.memo, ctx, callback) if err != nil { errFields := []zapcore.Field{ + zap.String("path_name", src.info.PathName), zap.String("src_chain_id", src.info.ChainID), zap.String("dst_chain_id", dst.info.ChainID), zap.String("src_client_id", src.info.ClientID), diff --git a/relayer/processor/metrics.go b/relayer/processor/metrics.go index f5f4245e7..a549eb40a 100644 --- a/relayer/processor/metrics.go +++ b/relayer/processor/metrics.go @@ -26,18 +26,18 @@ func (m *PrometheusMetrics) SetLatestHeight(chain string, height int64) { m.LatestHeightGauge.WithLabelValues(chain).Set(float64(height)) } -func (m *PrometheusMetrics) SetWalletBalance(chain, key, denom string, balance float64) { - m.WalletBalance.WithLabelValues(chain, key, denom).Set(balance) +func (m *PrometheusMetrics) SetWalletBalance(chain, key, address, denom string, balance float64) { + m.WalletBalance.WithLabelValues(chain, key, address, denom).Set(balance) } -func (m *PrometheusMetrics) SetFeesSpent(chain, key, denom string, amount float64) { - m.FeesSpent.WithLabelValues(chain, key, denom).Set(amount) +func (m *PrometheusMetrics) SetFeesSpent(chain, key, address, denom string, amount float64) { + m.FeesSpent.WithLabelValues(chain, key, address, denom).Set(amount) } func NewPrometheusMetrics() *PrometheusMetrics { packetLabels := []string{"path", "chain", "channel", "port", "type"} heightLabels := []string{"chain"} - walletLabels := []string{"chain", "key", "denom"} + walletLabels := []string{"chain", "key", "address", "denom"} registry := prometheus.NewRegistry() registerer := promauto.With(registry) return &PrometheusMetrics{ diff --git a/relayer/processor/path_end_runtime.go b/relayer/processor/path_end_runtime.go index c41dee0a9..df5acf5da 100644 --- a/relayer/processor/path_end_runtime.go +++ b/relayer/processor/path_end_runtime.go @@ -242,6 +242,12 @@ func (pathEnd *pathEndRuntime) shouldTerminate(ibcMessagesCache IBCMessagesCache foundCounterpartyChannelID := m.Termination.Info.CounterpartyChannelID == "" foundCounterpartyPortID := m.Termination.Info.CounterpartyPortID == "" for _, ci := range cache { + pathEnd.log.Info("Channel handshake termination candidate", + zap.String("termination_port_id", m.Termination.Info.PortID), + zap.String("observed_port_id", ci.PortID), + zap.String("termination_counterparty_port_id", m.Termination.Info.CounterpartyPortID), + zap.String("observed_counterparty_port_id", ci.CounterpartyPortID), + ) if ci.ChannelID == m.Termination.Info.ChannelID { foundChannelID = true } @@ -259,6 +265,41 @@ func (pathEnd *pathEndRuntime) shouldTerminate(ibcMessagesCache IBCMessagesCache pathEnd.log.Info("Found termination condition for channel handshake") return true } + case *ChannelCloseLifecycle: + cache, ok := ibcMessagesCache.ChannelHandshake[chantypes.EventTypeChannelCloseConfirm] + if !ok { + return false + } + // check against m.Termination.Info + foundChannelID := m.SrcChannelID == "" + foundPortID := m.SrcPortID == "" + for _, ci := range cache { + pathEnd.log.Info("Channel close termination candidate", + zap.String("termination_port_id", m.SrcPortID), + zap.String("observed_port_id", ci.PortID), + zap.String("termination_channel_id", m.SrcChannelID), + zap.String("observed_channel_id", ci.ChannelID), + ) + if pathEnd.info.ChainID == m.SrcChainID { + if ci.ChannelID == m.SrcChannelID { + foundChannelID = true + } + if ci.PortID == m.SrcPortID { + foundPortID = true + } + } else { + if ci.CounterpartyChannelID == m.SrcChannelID { + foundChannelID = true + } + if ci.CounterpartyPortID == m.SrcPortID { + foundPortID = true + } + } + } + if foundChannelID && foundPortID { + pathEnd.log.Info("Found termination condition for channel close") + return true + } case *ConnectionMessageLifecycle: if m.Termination == nil || m.Termination.ChainID != pathEnd.info.ChainID { @@ -410,7 +451,7 @@ func (pathEnd *pathEndRuntime) shouldSendPacketMessage(message packetIBCMessage, pathEndForHeight = pathEnd } - if strings.Contains(pathEnd.clientState.ClientID, "tendermint") && message.info.Height >= pathEndForHeight.latestBlock.Height { + if strings.Contains(pathEnd.chainProvider.Type(), common.IconModule) && message.info.Height >= pathEndForHeight.latestBlock.Height { pathEnd.log.Debug("Waiting to relay packet message until counterparty height has incremented", zap.String("event_type", eventType), zap.Uint64("sequence", sequence), @@ -482,6 +523,9 @@ func (pathEnd *pathEndRuntime) removePacketRetention( toDelete := make(map[string][]uint64) toDeleteCounterparty := make(map[string][]uint64) switch eventType { + case chantypes.EventTypeSendPacket: + toDelete[eventType] = []uint64{sequence} + toDelete[preInitKey] = []uint64{sequence} case chantypes.EventTypeRecvPacket: toDelete[eventType] = []uint64{sequence} toDeleteCounterparty[chantypes.EventTypeSendPacket] = []uint64{sequence} @@ -503,10 +547,13 @@ func (pathEnd *pathEndRuntime) removePacketRetention( // It will also determine if the message needs to be given up on entirely and remove retention if so. func (pathEnd *pathEndRuntime) shouldSendConnectionMessage(message connectionIBCMessage, counterparty *pathEndRuntime) bool { eventType := message.eventType - k := connectionInfoConnectionKey(message.info).Counterparty() - pathEndForHeight := counterparty - if strings.Contains(pathEnd.clientState.ClientID, "tendermint") && message.info.Height >= pathEndForHeight.latestBlock.Height { + k := ConnectionInfoConnectionKey(message.info) + if eventType != conntypes.EventTypeConnectionOpenInit { + k = k.Counterparty() + } + + if strings.Contains(pathEnd.chainProvider.Type(), common.IconModule) && message.info.Height >= counterparty.latestBlock.Height { pathEnd.log.Debug("Waiting to relay connection message until counterparty height has incremented", zap.Inline(k), zap.String("event_type", eventType), @@ -546,15 +593,20 @@ func (pathEnd *pathEndRuntime) shouldSendConnectionMessage(message connectionIBC toDeleteCounterparty := make(map[string][]ConnectionKey) counterpartyKey := k.Counterparty() switch eventType { + case conntypes.EventTypeConnectionOpenInit: + toDelete[preInitKey] = []ConnectionKey{k.PreInitKey()} case conntypes.EventTypeConnectionOpenTry: toDeleteCounterparty[conntypes.EventTypeConnectionOpenInit] = []ConnectionKey{counterpartyKey.MsgInitKey()} + toDeleteCounterparty[preInitKey] = []ConnectionKey{counterpartyKey.PreInitKey()} case conntypes.EventTypeConnectionOpenAck: toDeleteCounterparty[conntypes.EventTypeConnectionOpenTry] = []ConnectionKey{counterpartyKey} toDelete[conntypes.EventTypeConnectionOpenInit] = []ConnectionKey{k.MsgInitKey()} + toDelete[preInitKey] = []ConnectionKey{k.PreInitKey()} case conntypes.EventTypeConnectionOpenConfirm: toDeleteCounterparty[conntypes.EventTypeConnectionOpenAck] = []ConnectionKey{counterpartyKey} toDelete[conntypes.EventTypeConnectionOpenTry] = []ConnectionKey{k} toDeleteCounterparty[conntypes.EventTypeConnectionOpenInit] = []ConnectionKey{counterpartyKey.MsgInitKey()} + toDeleteCounterparty[preInitKey] = []ConnectionKey{counterpartyKey.PreInitKey()} } // delete in progress send for this specific message pathEnd.connProcessing.deleteMessages(map[string][]ConnectionKey{eventType: {k}}) @@ -569,14 +621,17 @@ func (pathEnd *pathEndRuntime) shouldSendConnectionMessage(message connectionIBC return true } -// shouldSendConnectionMessage determines if the channel handshake message should be sent now. +// shouldSendChannelMessage determines if the channel handshake message should be sent now. // It will also determine if the message needs to be given up on entirely and remove retention if so. func (pathEnd *pathEndRuntime) shouldSendChannelMessage(message channelIBCMessage, counterparty *pathEndRuntime) bool { + eventType := message.eventType - channelKey := channelInfoChannelKey(message.info).Counterparty() + channelKey := ChannelInfoChannelKey(message.info) + if eventType != chantypes.EventTypeChannelOpenInit { + channelKey = channelKey.Counterparty() + } - pathEndForHeight := counterparty - if strings.Contains(pathEnd.clientState.ClientID, "tendermint") && message.info.Height >= pathEndForHeight.latestBlock.Height { + if strings.Contains(pathEnd.chainProvider.Type(), common.IconModule) && message.info.Height >= counterparty.latestBlock.Height { pathEnd.log.Debug("Waiting to relay channel message until counterparty height has incremented", zap.Inline(channelKey), zap.String("event_type", eventType), @@ -619,18 +674,24 @@ func (pathEnd *pathEndRuntime) shouldSendChannelMessage(message channelIBCMessag counterpartyKey := channelKey.Counterparty() switch eventType { + case chantypes.EventTypeChannelOpenInit: + toDelete[preInitKey] = []ChannelKey{channelKey.MsgInitKey()} case chantypes.EventTypeChannelOpenTry: toDeleteCounterparty[chantypes.EventTypeChannelOpenInit] = []ChannelKey{counterpartyKey.MsgInitKey()} + toDeleteCounterparty[preInitKey] = []ChannelKey{counterpartyKey.MsgInitKey()} case chantypes.EventTypeChannelOpenAck: toDeleteCounterparty[chantypes.EventTypeChannelOpenTry] = []ChannelKey{counterpartyKey} toDelete[chantypes.EventTypeChannelOpenInit] = []ChannelKey{channelKey.MsgInitKey()} + toDelete[preInitKey] = []ChannelKey{channelKey.MsgInitKey()} case chantypes.EventTypeChannelOpenConfirm: toDeleteCounterparty[chantypes.EventTypeChannelOpenAck] = []ChannelKey{counterpartyKey} toDelete[chantypes.EventTypeChannelOpenTry] = []ChannelKey{channelKey} toDeleteCounterparty[chantypes.EventTypeChannelOpenInit] = []ChannelKey{counterpartyKey.MsgInitKey()} + toDeleteCounterparty[preInitKey] = []ChannelKey{counterpartyKey.MsgInitKey()} case chantypes.EventTypeChannelCloseConfirm: - toDeleteCounterparty[chantypes.EventTypeChannelCloseInit] = []ChannelKey{counterpartyKey} toDelete[chantypes.EventTypeChannelCloseConfirm] = []ChannelKey{channelKey} + toDeleteCounterparty[chantypes.EventTypeChannelCloseInit] = []ChannelKey{counterpartyKey} + toDeleteCounterparty[preCloseKey] = []ChannelKey{counterpartyKey} // Gather relevant send packet messages, for this channel key, that should be deleted if we // are operating on an ordered channel. @@ -750,7 +811,10 @@ func (pathEnd *pathEndRuntime) trackProcessingMessage(tracker messageToTrack) ui } case channelMessageToTrack: eventType := t.msg.eventType - channelKey := channelInfoChannelKey(t.msg.info).Counterparty() + channelKey := ChannelInfoChannelKey(t.msg.info) + if eventType != chantypes.EventTypeChannelOpenInit { + channelKey = channelKey.Counterparty() + } msgProcessCache, ok := pathEnd.channelProcessing[eventType] if !ok { msgProcessCache = make(channelKeySendCache) @@ -768,7 +832,10 @@ func (pathEnd *pathEndRuntime) trackProcessingMessage(tracker messageToTrack) ui } case connectionMessageToTrack: eventType := t.msg.eventType - connectionKey := connectionInfoConnectionKey(t.msg.info).Counterparty() + connectionKey := ConnectionInfoConnectionKey(t.msg.info) + if eventType != conntypes.EventTypeConnectionOpenInit { + connectionKey = connectionKey.Counterparty() + } msgProcessCache, ok := pathEnd.connProcessing[eventType] if !ok { msgProcessCache = make(connectionKeySendCache) diff --git a/relayer/processor/path_processor.go b/relayer/processor/path_processor.go index ea104e94c..2b295d4ce 100644 --- a/relayer/processor/path_processor.go +++ b/relayer/processor/path_processor.go @@ -27,6 +27,9 @@ const ( // Amount of time to wait for interchain queries. interchainQueryTimeout = 60 * time.Second + // Amount of time between flushes if the previous flush failed. + flushFailureRetry = 15 * time.Second + // If message assembly fails from either proof query failure on the source // or assembling the message for the destination, how many blocks should pass // before retrying. @@ -63,7 +66,7 @@ type PathProcessor struct { messageLifecycle MessageLifecycle initialFlushComplete bool - flushTicker *time.Ticker + flushTimer *time.Timer flushInterval time.Duration // Signals to retry. @@ -71,6 +74,8 @@ type PathProcessor struct { sentInitialMsg bool + maxMsgs uint64 + metrics *PrometheusMetrics } @@ -94,12 +99,9 @@ func NewPathProcessor( memo string, clientUpdateThresholdTime time.Duration, flushInterval time.Duration, + maxMsgs uint64, ) *PathProcessor { - if flushInterval == 0 { - // "disable" periodic flushing by using a large value. - flushInterval = 200 * 24 * 365 * time.Hour - } - return &PathProcessor{ + pp := &PathProcessor{ log: log, pathEnd1: newPathEndRuntime(log, pathEnd1, metrics), pathEnd2: newPathEndRuntime(log, pathEnd2, metrics), @@ -108,11 +110,35 @@ func NewPathProcessor( clientUpdateThresholdTime: clientUpdateThresholdTime, flushInterval: flushInterval, metrics: metrics, + maxMsgs: maxMsgs, + } + if flushInterval == 0 { + pp.disablePeriodicFlush() } + return pp +} + +// disablePeriodicFlush will "disable" periodic flushing by using a large value. +func (pp *PathProcessor) disablePeriodicFlush() { + pp.flushInterval = 200 * 24 * 365 * time.Hour } func (pp *PathProcessor) SetMessageLifecycle(messageLifecycle MessageLifecycle) { pp.messageLifecycle = messageLifecycle + if !pp.shouldFlush() { + // disable flushing when termination conditions are set, e.g. connection/channel handshakes + pp.disablePeriodicFlush() + } +} + +func (pp *PathProcessor) shouldFlush() bool { + if pp.messageLifecycle == nil { + return true + } + if _, ok := pp.messageLifecycle.(*FlushLifecycle); ok { + return true + } + return false } // TEST USE ONLY @@ -161,7 +187,7 @@ func (pp *PathProcessor) channelPairs() []channelPair { } pairs := make([]channelPair, len(channels)) i := 0 - for k, _ := range channels { + for k := range channels { pairs[i] = channelPair{ pathEnd1ChannelKey: k, pathEnd2ChannelKey: k.Counterparty(), @@ -248,6 +274,16 @@ func (pp *PathProcessor) HandleNewData(chainID string, cacheData ChainProcessorC } } +func (pp *PathProcessor) handleFlush(ctx context.Context) { + flushTimer := pp.flushInterval + if err := pp.flush(ctx); err != nil { + pp.log.Warn("Flush not complete", zap.Error(err)) + flushTimer = flushFailureRetry + } + pp.flushTimer.Stop() + pp.flushTimer = time.NewTimer(flushTimer) +} + // processAvailableSignals will block if signals are not yet available, otherwise it will process one of the available signals. // It returns whether or not the pathProcessor should quit. func (pp *PathProcessor) processAvailableSignals(ctx context.Context, cancel func()) bool { @@ -272,9 +308,9 @@ func (pp *PathProcessor) processAvailableSignals(ctx context.Context, cancel fun case <-pp.retryProcess: // No new data to merge in, just retry handling. - case <-pp.flushTicker.C: + case <-pp.flushTimer.C: // Periodic flush to clear out any old packets - // pp.flush(ctx) // TODO original not commented + pp.handleFlush(ctx) } return false } @@ -283,8 +319,7 @@ func (pp *PathProcessor) processAvailableSignals(ctx context.Context, cancel fun func (pp *PathProcessor) Run(ctx context.Context, cancel func()) { var retryTimer *time.Timer - pp.flushTicker = time.NewTicker(pp.flushInterval) - defer pp.flushTicker.Stop() + pp.flushTimer = time.NewTimer(time.Hour) for { // block until we have any signals to process @@ -303,16 +338,16 @@ func (pp *PathProcessor) Run(ctx context.Context, cancel func()) { continue } - if !pp.initialFlushComplete { - // pp.flush(ctx) // TODO :: commented by icon-project + if pp.shouldFlush() && !pp.initialFlushComplete { + // pp.handleFlush(ctx) pp.initialFlushComplete = true - } else if pp.shouldTerminateForFlushComplete(ctx, cancel) { + } else if pp.shouldTerminateForFlushComplete() { cancel() return } // process latest message cache state from both pathEnds - if err := pp.processLatestMessages(ctx); err != nil { + if err := pp.processLatestMessages(ctx, cancel); err != nil { // in case of IBC message send errors, schedule retry after durationErrorRetry if retryTimer != nil { retryTimer.Stop() diff --git a/relayer/processor/path_processor_internal.go b/relayer/processor/path_processor_internal.go index 1963323ea..f5ab82fb2 100644 --- a/relayer/processor/path_processor_internal.go +++ b/relayer/processor/path_processor_internal.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "errors" + "fmt" "sort" "sync" @@ -16,43 +17,99 @@ import ( "golang.org/x/sync/errgroup" ) +// preInitKey is used to declare intent to initialize a connection or channel handshake +// i.e. a MsgConnectionOpenInit or a MsgChannelOpenInit should be broadcasted to start +// the handshake if this key exists in the relevant cache. +const ( + preInitKey = "pre_init" + preCloseKey = "pre_close" + maxPacketsPerFlush = 10 +) + // getMessagesToSend returns only the lowest sequence message (if it should be sent) for ordered channels, // otherwise returns all which should be sent. func (pp *PathProcessor) getMessagesToSend( + ctx context.Context, msgs []packetIBCMessage, src, dst *pathEndRuntime, ) (srcMsgs []packetIBCMessage, dstMsgs []packetIBCMessage) { if len(msgs) == 0 { return } + if msgs[0].info.ChannelOrder == chantypes.ORDERED.String() { - // for packet messages on ordered channels, only handle the lowest sequence number now. - sort.SliceStable(msgs, func(i, j int) bool { - return msgs[i].info.Sequence < msgs[j].info.Sequence - }) - firstMsg := msgs[0] - switch firstMsg.eventType { - case chantypes.EventTypeRecvPacket: - if dst.shouldSendPacketMessage(firstMsg, src) { - dstMsgs = append(dstMsgs, firstMsg) - } - case common.EventTimeoutRequest: - if dst.shouldSendPacketMessage(firstMsg, src) { - dstMsgs = append(dstMsgs, firstMsg) + eventMessages := make(map[string][]packetIBCMessage) + + for _, m := range msgs { + eventMessages[m.eventType] = append(eventMessages[m.eventType], m) + } + + for e, m := range eventMessages { + m := m + sort.SliceStable(m, func(i, j int) bool { + return m[i].info.Sequence < m[j].info.Sequence + }) + + if e == chantypes.EventTypeRecvPacket { + dstChan, dstPort := m[0].info.DestChannel, m[0].info.DestPort + res, err := dst.chainProvider.QueryNextSeqRecv(ctx, 0, dstChan, dstPort) + if err != nil { + dst.log.Error("Failed to query next sequence recv", + zap.String("channel_id", dstChan), + zap.String("port_id", dstPort), + zap.Error(err), + ) + return + } + + if m[0].info.Sequence != res.NextSequenceReceive { + dst.log.Error("Unexpected next sequence recv", + zap.String("channel_id", m[0].info.DestChannel), + zap.String("port_id", m[0].info.DestChannel), + zap.Uint64("expected", res.NextSequenceReceive), + zap.Uint64("actual", m[0].info.Sequence), + ) + return + } } - default: - if src.shouldSendPacketMessage(firstMsg, dst) { - srcMsgs = append(srcMsgs, firstMsg) + + for i, msg := range m { + // only handle consecutive sequences on ordered channels + if i > 0 && msg.info.Sequence-1 != m[i-1].info.Sequence { + dst.log.Error("Packets are not consecutive", + zap.String("channel_id", m[0].info.DestChannel), + zap.String("port_id", m[0].info.DestChannel), + zap.Uint64("seq", msg.info.Sequence), + zap.Uint64("prior_seq", m[i-1].info.Sequence), + ) + break + } + + switch e { + case chantypes.EventTypeRecvPacket: + if uint64(len(dstMsgs)) <= pp.maxMsgs && dst.shouldSendPacketMessage(msg, src) { + dstMsgs = append(dstMsgs, msg) + } + case common.EventTimeoutRequest: + if uint64(len(dstMsgs)) <= pp.maxMsgs && dst.shouldSendPacketMessage(msg, src) { + dstMsgs = append(dstMsgs, msg) + } + default: + if uint64(len(srcMsgs)) <= pp.maxMsgs && src.shouldSendPacketMessage(msg, dst) { + srcMsgs = append(srcMsgs, msg) + } + } } } + return srcMsgs, dstMsgs } - // for unordered channels, can handle multiple simultaneous packets. + // for unordered channels, don't need to worry about sequence ordering. for _, msg := range msgs { switch msg.eventType { case chantypes.EventTypeRecvPacket: - if dst.shouldSendPacketMessage(msg, src) { + if uint64(len(dstMsgs)) <= pp.maxMsgs && dst.shouldSendPacketMessage(msg, src) { dstMsgs = append(dstMsgs, msg) } case common.EventTimeoutRequest: @@ -60,7 +117,7 @@ func (pp *PathProcessor) getMessagesToSend( dstMsgs = append(dstMsgs, msg) } default: - if src.shouldSendPacketMessage(msg, dst) { + if uint64(len(srcMsgs)) <= pp.maxMsgs && src.shouldSendPacketMessage(msg, dst) { srcMsgs = append(srcMsgs, msg) } } @@ -68,119 +125,132 @@ func (pp *PathProcessor) getMessagesToSend( return srcMsgs, dstMsgs } -func (pp *PathProcessor) getUnrelayedPacketsAndAcksAndToDelete(ctx context.Context, pathEndPacketFlowMessages pathEndPacketFlowMessages) pathEndPacketFlowResponse { - res := pathEndPacketFlowResponse{ - ToDeleteSrc: make(map[string][]uint64), - ToDeleteDst: make(map[string][]uint64), - ToDeleteDstChannel: make(map[string][]ChannelKey), - } - - var msgs []packetIBCMessage - -MsgTransferLoop: - for transferSeq, msgTransfer := range pathEndPacketFlowMessages.SrcMsgTransfer { - for ackSeq := range pathEndPacketFlowMessages.SrcMsgAcknowledgement { - if transferSeq == ackSeq { - // we have an ack for this packet, so packet flow is complete - // remove all retention of this sequence number - res.ToDeleteSrc[chantypes.EventTypeSendPacket] = append(res.ToDeleteSrc[chantypes.EventTypeSendPacket], transferSeq) - res.ToDeleteDst[chantypes.EventTypeRecvPacket] = append(res.ToDeleteDst[chantypes.EventTypeRecvPacket], transferSeq) - res.ToDeleteDst[chantypes.EventTypeWriteAck] = append(res.ToDeleteDst[chantypes.EventTypeWriteAck], transferSeq) - res.ToDeleteSrc[chantypes.EventTypeAcknowledgePacket] = append(res.ToDeleteSrc[chantypes.EventTypeAcknowledgePacket], transferSeq) - continue MsgTransferLoop - } +func (pp *PathProcessor) unrelayedPacketFlowMessages( + ctx context.Context, + pathEndPacketFlowMessages pathEndPacketFlowMessages, +) pathEndPacketFlowResponse { + var ( + res pathEndPacketFlowResponse + msgs []packetIBCMessage + toDeleteSrc = make(map[string][]uint64) + toDeleteDst = make(map[string][]uint64) + toDeleteDstChannel = make(map[string][]ChannelKey) + ) + + k := pathEndPacketFlowMessages.ChannelKey + + deletePreInitIfMatches := func(info provider.PacketInfo) { + cachedInfo, ok := pathEndPacketFlowMessages.SrcPreTransfer[0] + if !ok { + return } + if !bytes.Equal(cachedInfo.Data, info.Data) { + return + } + toDeleteSrc[preInitKey] = []uint64{0} + } - for timeoutSeq, msgTimeout := range pathEndPacketFlowMessages.SrcMsgTimeout { - if transferSeq == timeoutSeq { - if msgTimeout.ChannelOrder == chantypes.ORDERED.String() { - // For ordered channel packets, flow is not done until channel-close-confirm is observed. - if pathEndPacketFlowMessages.DstMsgChannelCloseConfirm == nil { - // have not observed a channel-close-confirm yet for this channel, send it if ready. - // will come back through here next block if not yet ready. - closeChan := channelIBCMessage{ - eventType: chantypes.EventTypeChannelCloseConfirm, - info: provider.ChannelInfo{ - Height: msgTimeout.Height, - PortID: msgTimeout.SourcePort, - ChannelID: msgTimeout.SourceChannel, - CounterpartyPortID: msgTimeout.DestPort, - CounterpartyChannelID: msgTimeout.DestChannel, - Order: orderFromString(msgTimeout.ChannelOrder), - }, - } - - if pathEndPacketFlowMessages.Dst.shouldSendChannelMessage(closeChan, pathEndPacketFlowMessages.Src) { - res.DstChannelMessage = append(res.DstChannelMessage, closeChan) - } - } else { - // ordered channel, and we have a channel close confirm, so packet-flow and channel-close-flow is complete. - // remove all retention of this sequence number and this channel-close-confirm. - res.ToDeleteDstChannel[chantypes.EventTypeChannelCloseConfirm] = append(res.ToDeleteDstChannel[chantypes.EventTypeChannelCloseConfirm], pathEndPacketFlowMessages.ChannelKey.Counterparty()) - res.ToDeleteSrc[chantypes.EventTypeSendPacket] = append(res.ToDeleteSrc[chantypes.EventTypeSendPacket], transferSeq) - res.ToDeleteSrc[chantypes.EventTypeTimeoutPacket] = append(res.ToDeleteSrc[chantypes.EventTypeTimeoutPacket], transferSeq) - res.ToDeleteDst[common.EventTimeoutRequest] = append(res.ToDeleteDst[common.EventTimeoutRequest], transferSeq) + processRemovals := func() { + pathEndPacketFlowMessages.Src.messageCache.PacketFlow[k].DeleteMessages(toDeleteSrc) + pathEndPacketFlowMessages.Dst.messageCache.PacketFlow[k.Counterparty()].DeleteMessages(toDeleteDst) + pathEndPacketFlowMessages.Dst.messageCache.ChannelHandshake.DeleteMessages(toDeleteDstChannel) + pathEndPacketFlowMessages.Src.packetProcessing[k].deleteMessages(toDeleteSrc) + pathEndPacketFlowMessages.Dst.packetProcessing[k.Counterparty()].deleteMessages(toDeleteDst) + pathEndPacketFlowMessages.Dst.channelProcessing.deleteMessages(toDeleteDstChannel) + toDeleteSrc = make(map[string][]uint64) + toDeleteDst = make(map[string][]uint64) + toDeleteDstChannel = make(map[string][]ChannelKey) + } - } - } else { - // unordered channel, and we have a timeout for this packet, so packet flow is complete - // remove all retention of this sequence number - res.ToDeleteSrc[chantypes.EventTypeSendPacket] = append(res.ToDeleteSrc[chantypes.EventTypeSendPacket], transferSeq) - res.ToDeleteSrc[chantypes.EventTypeTimeoutPacket] = append(res.ToDeleteSrc[chantypes.EventTypeTimeoutPacket], transferSeq) - res.ToDeleteDst[common.EventTimeoutRequest] = append(res.ToDeleteDst[common.EventTimeoutRequest], transferSeq) + for seq, info := range pathEndPacketFlowMessages.SrcMsgAcknowledgement { + // we have observed an ack on chain for this packet, so packet flow is complete + // remove all retention of this sequence number + deletePreInitIfMatches(info) + toDeleteSrc[chantypes.EventTypeSendPacket] = append(toDeleteSrc[chantypes.EventTypeSendPacket], seq) + toDeleteDst[chantypes.EventTypeRecvPacket] = append(toDeleteDst[chantypes.EventTypeRecvPacket], seq) + toDeleteDst[chantypes.EventTypeWriteAck] = append(toDeleteDst[chantypes.EventTypeWriteAck], seq) + toDeleteSrc[chantypes.EventTypeAcknowledgePacket] = append(toDeleteSrc[chantypes.EventTypeAcknowledgePacket], seq) + } - } - continue MsgTransferLoop - } - } + for seq, info := range pathEndPacketFlowMessages.SrcMsgTimeoutOnClose { + // we have observed a timeout-on-close on chain for this packet, so packet flow is complete + // remove all retention of this sequence number + deletePreInitIfMatches(info) + toDeleteSrc[chantypes.EventTypeSendPacket] = append(toDeleteSrc[chantypes.EventTypeSendPacket], seq) + toDeleteDst[chantypes.EventTypeRecvPacket] = append(toDeleteDst[chantypes.EventTypeRecvPacket], seq) + toDeleteDst[chantypes.EventTypeWriteAck] = append(toDeleteDst[chantypes.EventTypeWriteAck], seq) + toDeleteSrc[chantypes.EventTypeAcknowledgePacket] = append(toDeleteSrc[chantypes.EventTypeAcknowledgePacket], seq) + } - for timeoutOnCloseSeq := range pathEndPacketFlowMessages.SrcMsgTimeoutOnClose { - if transferSeq == timeoutOnCloseSeq { - // we have a timeout for this packet, so packet flow is complete - // remove all retention of this sequence number - res.ToDeleteSrc[chantypes.EventTypeSendPacket] = append(res.ToDeleteSrc[chantypes.EventTypeSendPacket], transferSeq) - res.ToDeleteSrc[chantypes.EventTypeTimeoutPacketOnClose] = append(res.ToDeleteSrc[chantypes.EventTypeTimeoutPacketOnClose], transferSeq) - continue MsgTransferLoop + for seq, info := range pathEndPacketFlowMessages.SrcMsgTimeout { + deletePreInitIfMatches(info) + toDeleteSrc[chantypes.EventTypeSendPacket] = append(toDeleteSrc[chantypes.EventTypeSendPacket], seq) + toDeleteSrc[chantypes.EventTypeTimeoutPacket] = append(toDeleteSrc[chantypes.EventTypeTimeoutPacket], seq) + toDeleteDst[common.EventTimeoutRequest] = append(toDeleteDst[common.EventTimeoutRequest], seq) + if info.ChannelOrder == chantypes.ORDERED.String() { + // Channel is now closed on src. + // enqueue channel close init observation to be handled by channel close correlation + if _, ok := pathEndPacketFlowMessages.Src.messageCache.ChannelHandshake[chantypes.EventTypeChannelCloseInit]; !ok { + pathEndPacketFlowMessages.Src.messageCache.ChannelHandshake[chantypes.EventTypeChannelCloseInit] = make(ChannelMessageCache) + } + pathEndPacketFlowMessages.Src.messageCache.ChannelHandshake[chantypes.EventTypeChannelCloseInit][k] = provider.ChannelInfo{ + Height: info.Height, + PortID: info.SourcePort, + ChannelID: info.SourceChannel, + CounterpartyPortID: info.DestPort, + CounterpartyChannelID: info.DestChannel, + Order: orderFromString(info.ChannelOrder), } } + } - for requestTimeoutSeq, msgTimeoutRequest := range pathEndPacketFlowMessages.DstMsgRequestTimeout { - if transferSeq == requestTimeoutSeq { - timeoutMsg := packetIBCMessage{ - eventType: chantypes.EventTypeTimeoutPacket, - info: msgTimeoutRequest, - } - msgs = append(msgs, timeoutMsg) - continue MsgTransferLoop - } + processRemovals() + + for seq, info := range pathEndPacketFlowMessages.DstMsgRecvPacket { + deletePreInitIfMatches(info) + toDeleteSrc[chantypes.EventTypeSendPacket] = append(toDeleteSrc[chantypes.EventTypeSendPacket], seq) + + if len(info.Ack) == 0 { + // have recv_packet but not write_acknowledgement yet. skip for now. + continue } - for msgRecvSeq, msgAcknowledgement := range pathEndPacketFlowMessages.DstMsgRecvPacket { - if transferSeq == msgRecvSeq { - if len(msgAcknowledgement.Ack) == 0 { - // have recv_packet but not write_acknowledgement yet. skip for now. - continue MsgTransferLoop - } - // msg is received by dst chain, but no ack yet. Need to relay ack from dst to src! - ackMsg := packetIBCMessage{ - eventType: chantypes.EventTypeAcknowledgePacket, - info: msgAcknowledgement, - } - msgs = append(msgs, ackMsg) - continue MsgTransferLoop - } + // msg is received by dst chain, but no ack yet. Need to relay ack from dst to src! + ackMsg := packetIBCMessage{ + eventType: chantypes.EventTypeAcknowledgePacket, + info: info, } + msgs = append(msgs, ackMsg) + } + + processRemovals() + + for seq, msgTimeoutRequest := range pathEndPacketFlowMessages.DstMsgRequestTimeout { + toDeleteSrc[chantypes.EventTypeSendPacket] = append(toDeleteSrc[chantypes.EventTypeSendPacket], seq) + toDeleteDst[common.EventTimeoutRequest] = append(toDeleteDst[common.EventTimeoutRequest], seq) + timeoutMsg := packetIBCMessage{ + eventType: chantypes.EventTypeTimeoutPacket, + info: msgTimeoutRequest, + } + msgs = append(msgs, timeoutMsg) + } + processRemovals() + + for _, info := range pathEndPacketFlowMessages.SrcMsgTransfer { + deletePreInitIfMatches(info) + // Packet is not yet relayed! need to relay either MsgRecvPacket from src to dst, or MsgTimeout/MsgTimeoutOnClose from dst to src - if err := pathEndPacketFlowMessages.Dst.chainProvider.ValidatePacket(msgTransfer, pathEndPacketFlowMessages.Dst.latestBlock); err != nil { + if err := pathEndPacketFlowMessages.Dst.chainProvider.ValidatePacket(info, pathEndPacketFlowMessages.Dst.latestBlock); err != nil { var timeoutHeightErr *provider.TimeoutHeightError var timeoutTimestampErr *provider.TimeoutTimestampError var timeoutOnCloseErr *provider.TimeoutOnCloseError if pathEndPacketFlowMessages.Dst.chainProvider.Type() == common.IconModule { + switch { case errors.As(err, &timeoutHeightErr) || errors.As(err, &timeoutTimestampErr): timeoutRequestMsg := packetIBCMessage{ eventType: common.EventTimeoutRequest, - info: msgTransfer, + info: info, } msgs = append(msgs, timeoutRequestMsg) @@ -190,21 +260,20 @@ MsgTransferLoop: zap.Error(err), ) } - continue MsgTransferLoop - + continue } switch { case errors.As(err, &timeoutHeightErr) || errors.As(err, &timeoutTimestampErr): timeoutMsg := packetIBCMessage{ eventType: chantypes.EventTypeTimeoutPacket, - info: msgTransfer, + info: info, } msgs = append(msgs, timeoutMsg) case errors.As(err, &timeoutOnCloseErr): timeoutOnCloseMsg := packetIBCMessage{ eventType: chantypes.EventTypeTimeoutPacketOnClose, - info: msgTransfer, + info: info, } msgs = append(msgs, timeoutOnCloseMsg) default: @@ -213,215 +282,359 @@ MsgTransferLoop: zap.Error(err), ) } - continue MsgTransferLoop + continue } recvPacketMsg := packetIBCMessage{ eventType: chantypes.EventTypeRecvPacket, - info: msgTransfer, + info: info, } msgs = append(msgs, recvPacketMsg) } - res.SrcMessages, res.DstMessages = pp.getMessagesToSend(msgs, pathEndPacketFlowMessages.Src, pathEndPacketFlowMessages.Dst) - - // now iterate through packet-flow-complete messages and remove any leftover messages if the MsgTransfer or MsgRecvPacket was in a previous block that we did not query - for ackSeq := range pathEndPacketFlowMessages.SrcMsgAcknowledgement { - res.ToDeleteSrc[chantypes.EventTypeSendPacket] = append(res.ToDeleteSrc[chantypes.EventTypeSendPacket], ackSeq) - res.ToDeleteDst[chantypes.EventTypeRecvPacket] = append(res.ToDeleteDst[chantypes.EventTypeRecvPacket], ackSeq) - res.ToDeleteDst[chantypes.EventTypeWriteAck] = append(res.ToDeleteDst[chantypes.EventTypeWriteAck], ackSeq) - res.ToDeleteSrc[chantypes.EventTypeAcknowledgePacket] = append(res.ToDeleteSrc[chantypes.EventTypeAcknowledgePacket], ackSeq) - } - for timeoutSeq, msgTimeout := range pathEndPacketFlowMessages.SrcMsgTimeout { - if msgTimeout.ChannelOrder != chantypes.ORDERED.String() { - res.ToDeleteSrc[chantypes.EventTypeSendPacket] = append(res.ToDeleteSrc[chantypes.EventTypeSendPacket], timeoutSeq) - res.ToDeleteSrc[chantypes.EventTypeTimeoutPacket] = append(res.ToDeleteSrc[chantypes.EventTypeTimeoutPacket], timeoutSeq) - res.ToDeleteDst[common.EventTimeoutRequest] = append(res.ToDeleteDst[common.EventTimeoutRequest], timeoutSeq) + processRemovals() + for _, info := range pathEndPacketFlowMessages.SrcPreTransfer { + msgTransfer := packetIBCMessage{ + eventType: chantypes.EventTypeSendPacket, + info: info, } - } - for timeoutOnCloseSeq := range pathEndPacketFlowMessages.SrcMsgTimeoutOnClose { - res.ToDeleteSrc[chantypes.EventTypeSendPacket] = append(res.ToDeleteSrc[chantypes.EventTypeSendPacket], timeoutOnCloseSeq) - res.ToDeleteSrc[chantypes.EventTypeTimeoutPacketOnClose] = append(res.ToDeleteSrc[chantypes.EventTypeTimeoutPacketOnClose], timeoutOnCloseSeq) + msgs = append(msgs, msgTransfer) } + res.SrcMessages, res.DstMessages = pp.getMessagesToSend( + ctx, + msgs, + pathEndPacketFlowMessages.Src, + pathEndPacketFlowMessages.Dst, + ) + return res } -func (pp *PathProcessor) getUnrelayedConnectionHandshakeMessagesAndToDelete(pathEndConnectionHandshakeMessages pathEndConnectionHandshakeMessages) pathEndConnectionHandshakeResponse { - res := pathEndConnectionHandshakeResponse{ - ToDeleteSrc: make(map[string][]ConnectionKey), - ToDeleteDst: make(map[string][]ConnectionKey), +func (pp *PathProcessor) unrelayedConnectionHandshakeMessages( + pathEndConnectionHandshakeMessages pathEndConnectionHandshakeMessages, +) pathEndConnectionHandshakeResponse { + var ( + res pathEndConnectionHandshakeResponse + toDeleteSrc = make(map[string][]ConnectionKey) + toDeleteDst = make(map[string][]ConnectionKey) + ) + + processRemovals := func() { + pathEndConnectionHandshakeMessages.Src.messageCache.ConnectionHandshake.DeleteMessages(toDeleteSrc) + pathEndConnectionHandshakeMessages.Dst.messageCache.ConnectionHandshake.DeleteMessages(toDeleteDst) + pathEndConnectionHandshakeMessages.Src.connProcessing.deleteMessages(toDeleteSrc) + pathEndConnectionHandshakeMessages.Dst.connProcessing.deleteMessages(toDeleteDst) + toDeleteSrc = make(map[string][]ConnectionKey) + toDeleteDst = make(map[string][]ConnectionKey) } -ConnectionHandshakeLoop: - for openInitKey, openInitMsg := range pathEndConnectionHandshakeMessages.SrcMsgConnectionOpenInit { - var foundOpenTry *provider.ConnectionInfo + for connKey := range pathEndConnectionHandshakeMessages.DstMsgConnectionOpenConfirm { + // found open confirm, channel handshake complete. remove all retention - for openTryKey, openTryMsg := range pathEndConnectionHandshakeMessages.DstMsgConnectionOpenTry { - // MsgConnectionOpenInit does not have counterparty connection ID, so check if everything - // else matches for counterparty. If so, add counterparty connection ID for - // the checks later on in this function. - if openInitKey == openTryKey.Counterparty().MsgInitKey() { - openInitKey.CounterpartyConnID = openTryKey.ConnectionID - foundOpenTry = &openTryMsg - break - } - } + counterpartyKey := connKey.Counterparty() + toDeleteDst[conntypes.EventTypeConnectionOpenConfirm] = append( + toDeleteDst[conntypes.EventTypeConnectionOpenConfirm], + connKey, + ) + toDeleteSrc[conntypes.EventTypeConnectionOpenAck] = append( + toDeleteSrc[conntypes.EventTypeConnectionOpenAck], + counterpartyKey, + ) + toDeleteDst[conntypes.EventTypeConnectionOpenTry] = append( + toDeleteDst[conntypes.EventTypeConnectionOpenTry], + connKey, + ) - if foundOpenTry == nil { - // need to send an open try to dst - msgOpenTry := connectionIBCMessage{ - eventType: conntypes.EventTypeConnectionOpenTry, - info: openInitMsg, - } - if pathEndConnectionHandshakeMessages.Dst.shouldSendConnectionMessage(msgOpenTry, pathEndConnectionHandshakeMessages.Src) { - res.DstMessages = append(res.DstMessages, msgOpenTry) - } - continue ConnectionHandshakeLoop - } + // MsgConnectionOpenInit does not have CounterpartyConnectionID + toDeleteSrc[conntypes.EventTypeConnectionOpenInit] = append( + toDeleteSrc[conntypes.EventTypeConnectionOpenInit], + counterpartyKey.MsgInitKey(), + ) + toDeleteSrc[preInitKey] = append(toDeleteSrc[preInitKey], counterpartyKey.PreInitKey()) + } - var foundOpenAck *provider.ConnectionInfo - for openAckKey, openAckMsg := range pathEndConnectionHandshakeMessages.SrcMsgConnectionOpenAck { - if openInitKey == openAckKey { - foundOpenAck = &openAckMsg - break - } + processRemovals() + + for connKey, info := range pathEndConnectionHandshakeMessages.SrcMsgConnectionOpenAck { + // need to send an open confirm to dst + msgOpenConfirm := connectionIBCMessage{ + eventType: conntypes.EventTypeConnectionOpenConfirm, + info: info, } - if foundOpenAck == nil { - // need to send an open ack to src - msgOpenAck := connectionIBCMessage{ - eventType: conntypes.EventTypeConnectionOpenAck, - info: *foundOpenTry, - } - if pathEndConnectionHandshakeMessages.Src.shouldSendConnectionMessage(msgOpenAck, pathEndConnectionHandshakeMessages.Dst) { - res.SrcMessages = append(res.SrcMessages, msgOpenAck) - } - continue ConnectionHandshakeLoop + if pathEndConnectionHandshakeMessages.Dst.shouldSendConnectionMessage( + msgOpenConfirm, + pathEndConnectionHandshakeMessages.Src, + ) { + res.DstMessages = append(res.DstMessages, msgOpenConfirm) } - var foundOpenConfirm *provider.ConnectionInfo - for openConfirmKey, openConfirmMsg := range pathEndConnectionHandshakeMessages.DstMsgConnectionOpenConfirm { - if openInitKey == openConfirmKey.Counterparty() { - foundOpenConfirm = &openConfirmMsg - break - } + + toDeleteDst[conntypes.EventTypeConnectionOpenTry] = append( + toDeleteDst[conntypes.EventTypeConnectionOpenTry], connKey.Counterparty(), + ) + + // MsgConnectionOpenInit does not have CounterpartyConnectionID + toDeleteSrc[conntypes.EventTypeConnectionOpenInit] = append( + toDeleteSrc[conntypes.EventTypeConnectionOpenInit], connKey.MsgInitKey(), + ) + toDeleteSrc[preInitKey] = append(toDeleteSrc[preInitKey], connKey.PreInitKey()) + } + + processRemovals() + + for connKey, info := range pathEndConnectionHandshakeMessages.DstMsgConnectionOpenTry { + // need to send an open ack to src + msgOpenAck := connectionIBCMessage{ + eventType: conntypes.EventTypeConnectionOpenAck, + info: info, } - if foundOpenConfirm == nil { - // need to send an open confirm to dst - msgOpenConfirm := connectionIBCMessage{ - eventType: conntypes.EventTypeConnectionOpenConfirm, - info: *foundOpenAck, - } - if pathEndConnectionHandshakeMessages.Dst.shouldSendConnectionMessage(msgOpenConfirm, pathEndConnectionHandshakeMessages.Src) { - res.DstMessages = append(res.DstMessages, msgOpenConfirm) - } - continue ConnectionHandshakeLoop + if pathEndConnectionHandshakeMessages.Src.shouldSendConnectionMessage( + msgOpenAck, pathEndConnectionHandshakeMessages.Dst, + ) { + res.SrcMessages = append(res.SrcMessages, msgOpenAck) } - // handshake is complete for this connection, remove all retention. - res.ToDeleteDst[conntypes.EventTypeConnectionOpenTry] = append(res.ToDeleteDst[conntypes.EventTypeConnectionOpenTry], openInitKey) - res.ToDeleteSrc[conntypes.EventTypeConnectionOpenAck] = append(res.ToDeleteSrc[conntypes.EventTypeConnectionOpenAck], openInitKey) - res.ToDeleteDst[conntypes.EventTypeConnectionOpenConfirm] = append(res.ToDeleteDst[conntypes.EventTypeConnectionOpenConfirm], openInitKey) + + counterpartyKey := connKey.Counterparty() // MsgConnectionOpenInit does not have CounterpartyConnectionID - openInitKey.CounterpartyConnID = "" - res.ToDeleteSrc[conntypes.EventTypeConnectionOpenInit] = append(res.ToDeleteSrc[conntypes.EventTypeConnectionOpenInit], openInitKey) + toDeleteSrc[conntypes.EventTypeConnectionOpenInit] = append( + toDeleteSrc[conntypes.EventTypeConnectionOpenInit], counterpartyKey.MsgInitKey(), + ) + toDeleteSrc[preInitKey] = append(toDeleteSrc[preInitKey], counterpartyKey.PreInitKey()) } - // now iterate through connection-handshake-complete messages and remove any leftover messages - for openConfirmKey := range pathEndConnectionHandshakeMessages.DstMsgConnectionOpenConfirm { - res.ToDeleteDst[conntypes.EventTypeConnectionOpenTry] = append(res.ToDeleteDst[conntypes.EventTypeConnectionOpenTry], openConfirmKey) - res.ToDeleteSrc[conntypes.EventTypeConnectionOpenAck] = append(res.ToDeleteSrc[conntypes.EventTypeConnectionOpenAck], openConfirmKey) - res.ToDeleteDst[conntypes.EventTypeConnectionOpenConfirm] = append(res.ToDeleteDst[conntypes.EventTypeConnectionOpenConfirm], openConfirmKey) + processRemovals() + + for connKey, info := range pathEndConnectionHandshakeMessages.SrcMsgConnectionOpenInit { + // need to send an open try to dst + msgOpenTry := connectionIBCMessage{ + eventType: conntypes.EventTypeConnectionOpenTry, + info: info, + } + if pathEndConnectionHandshakeMessages.Dst.shouldSendConnectionMessage( + msgOpenTry, pathEndConnectionHandshakeMessages.Src, + ) { + res.DstMessages = append(res.DstMessages, msgOpenTry) + } // MsgConnectionOpenInit does not have CounterpartyConnectionID - openConfirmKey.CounterpartyConnID = "" - res.ToDeleteSrc[conntypes.EventTypeConnectionOpenInit] = append(res.ToDeleteSrc[conntypes.EventTypeConnectionOpenInit], openConfirmKey) + toDeleteSrc[preInitKey] = append(toDeleteSrc[preInitKey], connKey.PreInitKey()) } + + processRemovals() + + for _, info := range pathEndConnectionHandshakeMessages.SrcMsgConnectionPreInit { + // need to send an open init to src + msgOpenInit := connectionIBCMessage{ + eventType: conntypes.EventTypeConnectionOpenInit, + info: info, + } + if pathEndConnectionHandshakeMessages.Src.shouldSendConnectionMessage( + msgOpenInit, pathEndConnectionHandshakeMessages.Dst, + ) { + res.SrcMessages = append(res.SrcMessages, msgOpenInit) + } + } + return res } -func (pp *PathProcessor) getUnrelayedChannelHandshakeMessagesAndToDelete(pathEndChannelHandshakeMessages pathEndChannelHandshakeMessages) pathEndChannelHandshakeResponse { - res := pathEndChannelHandshakeResponse{ - ToDeleteSrc: make(map[string][]ChannelKey), - ToDeleteDst: make(map[string][]ChannelKey), - } - -ChannelHandshakeLoop: - for openInitKey, openInitMsg := range pathEndChannelHandshakeMessages.SrcMsgChannelOpenInit { - var foundOpenTry *provider.ChannelInfo - for openTryKey, openTryMsg := range pathEndChannelHandshakeMessages.DstMsgChannelOpenTry { - // MsgChannelOpenInit does not have counterparty channel ID, so check if everything - // else matches for counterparty. If so, add counterparty channel ID for - // the checks later on in this function. - if openInitKey == openTryKey.Counterparty().MsgInitKey() { - openInitKey.CounterpartyChannelID = openTryMsg.ChannelID - foundOpenTry = &openTryMsg - break - } +func (pp *PathProcessor) unrelayedChannelHandshakeMessages( + pathEndChannelHandshakeMessages pathEndChannelHandshakeMessages, +) pathEndChannelHandshakeResponse { + var ( + res pathEndChannelHandshakeResponse + toDeleteSrc = make(map[string][]ChannelKey) + toDeleteDst = make(map[string][]ChannelKey) + ) + processRemovals := func() { + pathEndChannelHandshakeMessages.Src.messageCache.ChannelHandshake.DeleteMessages(toDeleteSrc) + pathEndChannelHandshakeMessages.Dst.messageCache.ChannelHandshake.DeleteMessages(toDeleteDst) + pathEndChannelHandshakeMessages.Src.channelProcessing.deleteMessages(toDeleteSrc) + pathEndChannelHandshakeMessages.Dst.channelProcessing.deleteMessages(toDeleteDst) + toDeleteSrc = make(map[string][]ChannelKey) + toDeleteDst = make(map[string][]ChannelKey) + } + + for chanKey := range pathEndChannelHandshakeMessages.DstMsgChannelOpenConfirm { + // found open confirm, channel handshake complete. remove all retention + + counterpartyKey := chanKey.Counterparty() + toDeleteDst[chantypes.EventTypeChannelOpenConfirm] = append( + toDeleteDst[chantypes.EventTypeChannelOpenConfirm], + chanKey, + ) + toDeleteSrc[chantypes.EventTypeChannelOpenAck] = append( + toDeleteSrc[chantypes.EventTypeChannelOpenAck], + counterpartyKey, + ) + toDeleteDst[chantypes.EventTypeChannelOpenTry] = append( + toDeleteDst[chantypes.EventTypeChannelOpenTry], + chanKey, + ) + + // MsgChannelOpenInit does not have CounterpartyChannelID + toDeleteSrc[chantypes.EventTypeChannelOpenInit] = append( + toDeleteSrc[chantypes.EventTypeChannelOpenInit], + counterpartyKey.MsgInitKey(), + ) + toDeleteSrc[preInitKey] = append(toDeleteSrc[preInitKey], counterpartyKey.PreInitKey()) + } + + processRemovals() + + for chanKey, info := range pathEndChannelHandshakeMessages.SrcMsgChannelOpenAck { + // need to send an open confirm to dst + msgOpenConfirm := channelIBCMessage{ + eventType: chantypes.EventTypeChannelOpenConfirm, + info: info, } - if foundOpenTry == nil { - // need to send an open try to dst - msgOpenTry := channelIBCMessage{ - eventType: chantypes.EventTypeChannelOpenTry, - info: openInitMsg, - } - if pathEndChannelHandshakeMessages.Dst.shouldSendChannelMessage(msgOpenTry, pathEndChannelHandshakeMessages.Src) { - res.DstMessages = append(res.DstMessages, msgOpenTry) - } - continue ChannelHandshakeLoop + + if pathEndChannelHandshakeMessages.Dst.shouldSendChannelMessage( + msgOpenConfirm, + pathEndChannelHandshakeMessages.Src, + ) { + res.DstMessages = append(res.DstMessages, msgOpenConfirm) } - var foundOpenAck *provider.ChannelInfo - for openAckKey, openAckMsg := range pathEndChannelHandshakeMessages.SrcMsgChannelOpenAck { - if openInitKey == openAckKey { - foundOpenAck = &openAckMsg - break - } + + toDeleteDst[chantypes.EventTypeChannelOpenTry] = append( + toDeleteDst[chantypes.EventTypeChannelOpenTry], chanKey.Counterparty(), + ) + + // MsgChannelOpenInit does not have CounterpartyChannelID + toDeleteSrc[chantypes.EventTypeChannelOpenInit] = append( + toDeleteSrc[chantypes.EventTypeChannelOpenInit], chanKey.MsgInitKey(), + ) + toDeleteSrc[preInitKey] = append(toDeleteSrc[preInitKey], chanKey.PreInitKey()) + } + + processRemovals() + + for chanKey, info := range pathEndChannelHandshakeMessages.DstMsgChannelOpenTry { + // need to send an open ack to src + msgOpenAck := channelIBCMessage{ + eventType: chantypes.EventTypeChannelOpenAck, + info: info, } - if foundOpenAck == nil { - // need to send an open ack to src - msgOpenAck := channelIBCMessage{ - eventType: chantypes.EventTypeChannelOpenAck, - info: *foundOpenTry, - } - if pathEndChannelHandshakeMessages.Src.shouldSendChannelMessage(msgOpenAck, pathEndChannelHandshakeMessages.Dst) { - res.SrcMessages = append(res.SrcMessages, msgOpenAck) - } - continue ChannelHandshakeLoop + if pathEndChannelHandshakeMessages.Src.shouldSendChannelMessage( + msgOpenAck, pathEndChannelHandshakeMessages.Dst, + ) { + res.SrcMessages = append(res.SrcMessages, msgOpenAck) } - var foundOpenConfirm *provider.ChannelInfo - for openConfirmKey, openConfirmMsg := range pathEndChannelHandshakeMessages.DstMsgChannelOpenConfirm { - if openInitKey == openConfirmKey.Counterparty() { - foundOpenConfirm = &openConfirmMsg - break - } + + counterpartyKey := chanKey.Counterparty() + + // MsgChannelOpenInit does not have CounterpartyChannelID + toDeleteSrc[chantypes.EventTypeChannelOpenInit] = append( + toDeleteSrc[chantypes.EventTypeChannelOpenInit], counterpartyKey.MsgInitKey(), + ) + toDeleteSrc[preInitKey] = append(toDeleteSrc[preInitKey], counterpartyKey.PreInitKey()) + } + + processRemovals() + + for chanKey, info := range pathEndChannelHandshakeMessages.SrcMsgChannelOpenInit { + // need to send an open try to dst + msgOpenTry := channelIBCMessage{ + eventType: chantypes.EventTypeChannelOpenTry, + info: info, } - if foundOpenConfirm == nil { - // need to send an open confirm to dst - msgOpenConfirm := channelIBCMessage{ - eventType: chantypes.EventTypeChannelOpenConfirm, - info: *foundOpenAck, - } - if pathEndChannelHandshakeMessages.Dst.shouldSendChannelMessage(msgOpenConfirm, pathEndChannelHandshakeMessages.Src) { - res.DstMessages = append(res.DstMessages, msgOpenConfirm) - } - continue ChannelHandshakeLoop + if pathEndChannelHandshakeMessages.Dst.shouldSendChannelMessage( + msgOpenTry, pathEndChannelHandshakeMessages.Src, + ) { + res.DstMessages = append(res.DstMessages, msgOpenTry) } - // handshake is complete for this channel, remove all retention. - res.ToDeleteDst[chantypes.EventTypeChannelOpenTry] = append(res.ToDeleteDst[chantypes.EventTypeChannelOpenTry], openInitKey) - res.ToDeleteSrc[chantypes.EventTypeChannelOpenAck] = append(res.ToDeleteSrc[chantypes.EventTypeChannelOpenAck], openInitKey) - res.ToDeleteDst[chantypes.EventTypeChannelOpenConfirm] = append(res.ToDeleteDst[chantypes.EventTypeChannelOpenConfirm], openInitKey) + // MsgChannelOpenInit does not have CounterpartyChannelID - res.ToDeleteSrc[chantypes.EventTypeChannelOpenInit] = append(res.ToDeleteSrc[chantypes.EventTypeChannelOpenInit], openInitKey.MsgInitKey()) + toDeleteSrc[preInitKey] = append(toDeleteSrc[preInitKey], chanKey.PreInitKey()) } - // now iterate through channel-handshake-complete messages and remove any leftover messages - for openConfirmKey := range pathEndChannelHandshakeMessages.DstMsgChannelOpenConfirm { - res.ToDeleteDst[chantypes.EventTypeChannelOpenTry] = append(res.ToDeleteDst[chantypes.EventTypeChannelOpenTry], openConfirmKey) - res.ToDeleteSrc[chantypes.EventTypeChannelOpenAck] = append(res.ToDeleteSrc[chantypes.EventTypeChannelOpenAck], openConfirmKey) - res.ToDeleteDst[chantypes.EventTypeChannelOpenConfirm] = append(res.ToDeleteDst[chantypes.EventTypeChannelOpenConfirm], openConfirmKey) - // MsgChannelOpenInit does not have CounterpartyChannelID - res.ToDeleteSrc[chantypes.EventTypeChannelOpenInit] = append(res.ToDeleteSrc[chantypes.EventTypeChannelOpenInit], openConfirmKey.MsgInitKey()) + processRemovals() + + for _, info := range pathEndChannelHandshakeMessages.SrcMsgChannelPreInit { + // need to send an open init to src + msgOpenInit := channelIBCMessage{ + eventType: chantypes.EventTypeChannelOpenInit, + info: info, + } + if pathEndChannelHandshakeMessages.Src.shouldSendChannelMessage( + msgOpenInit, pathEndChannelHandshakeMessages.Dst, + ) { + res.SrcMessages = append(res.SrcMessages, msgOpenInit) + } + } + + return res +} + +func (pp *PathProcessor) unrelayedChannelCloseMessages( + pathEndChannelCloseMessages pathEndChannelCloseMessages, +) pathEndChannelHandshakeResponse { + var ( + res pathEndChannelHandshakeResponse + toDeleteSrc = make(map[string][]ChannelKey) + toDeleteDst = make(map[string][]ChannelKey) + ) + processRemovals := func() { + pathEndChannelCloseMessages.Src.messageCache.ChannelHandshake.DeleteMessages(toDeleteSrc) + pathEndChannelCloseMessages.Dst.messageCache.ChannelHandshake.DeleteMessages(toDeleteDst) + pathEndChannelCloseMessages.Src.channelProcessing.deleteMessages(toDeleteSrc) + pathEndChannelCloseMessages.Dst.channelProcessing.deleteMessages(toDeleteDst) + toDeleteSrc = make(map[string][]ChannelKey) + toDeleteDst = make(map[string][]ChannelKey) + } + + for chanKey := range pathEndChannelCloseMessages.DstMsgChannelCloseConfirm { + // found close confirm, channel handshake complete. remove all retention + + counterpartyKey := chanKey.Counterparty() + toDeleteDst[chantypes.EventTypeChannelCloseConfirm] = append( + toDeleteDst[chantypes.EventTypeChannelCloseConfirm], + chanKey, + ) + // MsgChannelCloseInit does not have CounterpartyChannelID // TODO: confirm this + toDeleteSrc[chantypes.EventTypeChannelCloseInit] = append( + toDeleteSrc[chantypes.EventTypeChannelCloseInit], + counterpartyKey.MsgInitKey(), + ) + // TODO: confirm chankey does not need modification + toDeleteSrc[preCloseKey] = append(toDeleteSrc[preCloseKey], counterpartyKey) + } + + processRemovals() + + for chanKey, info := range pathEndChannelCloseMessages.SrcMsgChannelCloseInit { + // need to send a close confirm to dst + msgCloseConfirm := channelIBCMessage{ + eventType: chantypes.EventTypeChannelCloseConfirm, + info: info, + } + if pathEndChannelCloseMessages.Dst.shouldSendChannelMessage( + msgCloseConfirm, pathEndChannelCloseMessages.Src, + ) { + res.DstMessages = append(res.DstMessages, msgCloseConfirm) + } + + // TODO: confirm chankey does not need modification + toDeleteSrc[preCloseKey] = append(toDeleteSrc[preCloseKey], chanKey) + } + + processRemovals() + + for _, info := range pathEndChannelCloseMessages.SrcMsgChannelPreInit { + // need to send a close init to src + msgCloseInit := channelIBCMessage{ + eventType: chantypes.EventTypeChannelCloseInit, + info: info, + } + if pathEndChannelCloseMessages.Src.shouldSendChannelMessage( + msgCloseInit, pathEndChannelCloseMessages.Dst, + ) { + res.SrcMessages = append(res.SrcMessages, msgCloseInit) + } } + return res } @@ -508,7 +721,23 @@ func (pp *PathProcessor) updateClientTrustedState(src *pathEndRuntime, dst *path } } -func (pp *PathProcessor) appendInitialMessageIfNecessary(pathEnd1Messages, pathEnd2Messages *pathEndMessages) { +var observedEventTypeForDesiredMessage = map[string]string{ + conntypes.EventTypeConnectionOpenConfirm: conntypes.EventTypeConnectionOpenAck, + conntypes.EventTypeConnectionOpenAck: conntypes.EventTypeConnectionOpenTry, + conntypes.EventTypeConnectionOpenTry: conntypes.EventTypeConnectionOpenInit, + conntypes.EventTypeConnectionOpenInit: preInitKey, + + chantypes.EventTypeChannelOpenConfirm: chantypes.EventTypeChannelOpenAck, + chantypes.EventTypeChannelOpenAck: chantypes.EventTypeChannelOpenTry, + chantypes.EventTypeChannelOpenTry: chantypes.EventTypeChannelOpenInit, + chantypes.EventTypeChannelOpenInit: preInitKey, + + chantypes.EventTypeAcknowledgePacket: chantypes.EventTypeRecvPacket, + chantypes.EventTypeRecvPacket: chantypes.EventTypeSendPacket, + chantypes.EventTypeSendPacket: preInitKey, +} + +func (pp *PathProcessor) queuePreInitMessages(cancel func()) { if pp.messageLifecycle == nil || pp.sentInitialMsg { return } @@ -516,6 +745,7 @@ func (pp *PathProcessor) appendInitialMessageIfNecessary(pathEnd1Messages, pathE pp.sentInitialMsg = true switch m := pp.messageLifecycle.(type) { case *PacketMessageLifecycle: + pp.sentInitialMsg = true if m.Initial == nil { return } @@ -526,24 +756,36 @@ func (pp *PathProcessor) appendInitialMessageIfNecessary(pathEnd1Messages, pathE zap.Inline(channelKey), zap.Error(err), ) + cancel() return } if !pp.IsRelayedChannel(m.Initial.ChainID, channelKey) { return } + eventType, ok := observedEventTypeForDesiredMessage[m.Initial.EventType] + if !ok { + pp.log.Error( + "Failed to queue initial connection message, event type not handled", + zap.String("event_type", m.Initial.EventType), + ) + cancel() + return + } if m.Initial.ChainID == pp.pathEnd1.info.ChainID { - pathEnd1Messages.packetMessages = append(pathEnd1Messages.packetMessages, packetIBCMessage{ - eventType: m.Initial.EventType, - info: m.Initial.Info, - }) + _, ok = pp.pathEnd1.messageCache.PacketFlow[channelKey][eventType] + if !ok { + pp.pathEnd1.messageCache.PacketFlow[channelKey][eventType] = make(PacketSequenceCache) + } + pp.pathEnd1.messageCache.PacketFlow[channelKey][eventType][0] = m.Initial.Info } else if m.Initial.ChainID == pp.pathEnd2.info.ChainID { - pathEnd2Messages.packetMessages = append(pathEnd2Messages.packetMessages, packetIBCMessage{ - eventType: m.Initial.EventType, - info: m.Initial.Info, - }) + _, ok = pp.pathEnd2.messageCache.PacketFlow[channelKey][eventType] + if !ok { + pp.pathEnd2.messageCache.PacketFlow[channelKey][eventType] = make(PacketSequenceCache) + } + pp.pathEnd2.messageCache.PacketFlow[channelKey][eventType][0] = m.Initial.Info } case *ConnectionMessageLifecycle: - + pp.sentInitialMsg = true if m.Initial == nil { return } @@ -551,19 +793,31 @@ func (pp *PathProcessor) appendInitialMessageIfNecessary(pathEnd1Messages, pathE if !pp.IsRelevantClient(m.Initial.ChainID, m.Initial.Info.ClientID) { return } - + eventType, ok := observedEventTypeForDesiredMessage[m.Initial.EventType] + if !ok { + pp.log.Error( + "Failed to queue initial connection message, event type not handled", + zap.String("event_type", m.Initial.EventType), + ) + cancel() + return + } + connKey := ConnectionInfoConnectionKey(m.Initial.Info) if m.Initial.ChainID == pp.pathEnd1.info.ChainID { - pathEnd1Messages.connectionMessages = append(pathEnd1Messages.connectionMessages, connectionIBCMessage{ - eventType: m.Initial.EventType, - info: m.Initial.Info, - }) + _, ok = pp.pathEnd1.messageCache.ConnectionHandshake[eventType] + if !ok { + pp.pathEnd1.messageCache.ConnectionHandshake[eventType] = make(ConnectionMessageCache) + } + pp.pathEnd1.messageCache.ConnectionHandshake[eventType][connKey] = m.Initial.Info } else if m.Initial.ChainID == pp.pathEnd2.info.ChainID { - pathEnd2Messages.connectionMessages = append(pathEnd2Messages.connectionMessages, connectionIBCMessage{ - eventType: m.Initial.EventType, - info: m.Initial.Info, - }) + _, ok = pp.pathEnd2.messageCache.ConnectionHandshake[eventType] + if !ok { + pp.pathEnd2.messageCache.ConnectionHandshake[eventType] = make(ConnectionMessageCache) + } + pp.pathEnd2.messageCache.ConnectionHandshake[eventType][connKey] = m.Initial.Info } case *ChannelMessageLifecycle: + pp.sentInitialMsg = true if m.Initial == nil { return } @@ -571,34 +825,109 @@ func (pp *PathProcessor) appendInitialMessageIfNecessary(pathEnd1Messages, pathE if !pp.IsRelevantConnection(m.Initial.ChainID, m.Initial.Info.ConnID) { return } - + eventType, ok := observedEventTypeForDesiredMessage[m.Initial.EventType] + if !ok { + pp.log.Error( + "Failed to queue initial channel message, event type not handled", + zap.String("event_type", m.Initial.EventType), + ) + cancel() + return + } + chanKey := ChannelInfoChannelKey(m.Initial.Info) if m.Initial.ChainID == pp.pathEnd1.info.ChainID { - pathEnd1Messages.channelMessages = append(pathEnd1Messages.channelMessages, channelIBCMessage{ - eventType: m.Initial.EventType, - info: m.Initial.Info, - }) + _, ok = pp.pathEnd1.messageCache.ChannelHandshake[eventType] + if !ok { + pp.pathEnd1.messageCache.ChannelHandshake[eventType] = make(ChannelMessageCache) + } + pp.pathEnd1.messageCache.ChannelHandshake[eventType][chanKey] = m.Initial.Info } else if m.Initial.ChainID == pp.pathEnd2.info.ChainID { + _, ok = pp.pathEnd2.messageCache.ChannelHandshake[eventType] + if !ok { + pp.pathEnd2.messageCache.ChannelHandshake[eventType] = make(ChannelMessageCache) + } + pp.pathEnd2.messageCache.ChannelHandshake[eventType][chanKey] = m.Initial.Info + } + case *ChannelCloseLifecycle: + pp.sentInitialMsg = true - pathEnd2Messages.channelMessages = append(pathEnd2Messages.channelMessages, channelIBCMessage{ - eventType: m.Initial.EventType, - info: m.Initial.Info, - }) + if !pp.IsRelevantConnection(pp.pathEnd1.info.ChainID, m.SrcConnID) { + return + } + + for k, open := range pp.pathEnd1.channelStateCache { + if k.ChannelID == m.SrcChannelID && k.PortID == m.SrcPortID && k.CounterpartyChannelID != "" && k.CounterpartyPortID != "" { + if open { + // channel is still open on pathEnd1 + break + } + if counterpartyOpen, ok := pp.pathEnd2.channelStateCache[k.Counterparty()]; ok && !counterpartyOpen { + pp.log.Info("Channel already closed on both sides") + cancel() + return + } + // queue channel close init on pathEnd1 + if _, ok := pp.pathEnd1.messageCache.ChannelHandshake[chantypes.EventTypeChannelCloseInit]; !ok { + pp.pathEnd1.messageCache.ChannelHandshake[chantypes.EventTypeChannelCloseInit] = make(ChannelMessageCache) + } + pp.pathEnd1.messageCache.ChannelHandshake[chantypes.EventTypeChannelCloseInit][k] = provider.ChannelInfo{ + PortID: k.PortID, + ChannelID: k.ChannelID, + CounterpartyPortID: k.CounterpartyPortID, + CounterpartyChannelID: k.CounterpartyChannelID, + ConnID: m.SrcConnID, + } + return + } + } + + for k, open := range pp.pathEnd2.channelStateCache { + if k.CounterpartyChannelID == m.SrcChannelID && k.CounterpartyPortID == m.SrcPortID && k.ChannelID != "" && k.PortID != "" { + if open { + // channel is still open on pathEnd2 + break + } + if counterpartyChanState, ok := pp.pathEnd1.channelStateCache[k.Counterparty()]; ok && !counterpartyChanState { + pp.log.Info("Channel already closed on both sides") + cancel() + return + } + // queue channel close init on pathEnd2 + if _, ok := pp.pathEnd2.messageCache.ChannelHandshake[chantypes.EventTypeChannelCloseInit]; !ok { + pp.pathEnd2.messageCache.ChannelHandshake[chantypes.EventTypeChannelCloseInit] = make(ChannelMessageCache) + } + pp.pathEnd2.messageCache.ChannelHandshake[chantypes.EventTypeChannelCloseInit][k] = provider.ChannelInfo{ + PortID: k.PortID, + ChannelID: k.ChannelID, + CounterpartyPortID: k.CounterpartyPortID, + CounterpartyChannelID: k.CounterpartyChannelID, + ConnID: m.DstConnID, + } + } } + pp.log.Error("This channel is unable to be closed. Channel must already be closed on one chain.", + zap.String("src_channel_id", m.SrcChannelID), + zap.String("src_port_id", m.SrcPortID), + ) + cancel() } } // messages from both pathEnds are needed in order to determine what needs to be relayed for a single pathEnd -func (pp *PathProcessor) processLatestMessages(ctx context.Context) error { +func (pp *PathProcessor) processLatestMessages(ctx context.Context, cancel func()) error { // Update trusted client state for both pathends pp.updateClientTrustedState(pp.pathEnd1, pp.pathEnd2) pp.updateClientTrustedState(pp.pathEnd2, pp.pathEnd1) channelPairs := pp.channelPairs() + pp.queuePreInitMessages(cancel) + pathEnd1ConnectionHandshakeMessages := pathEndConnectionHandshakeMessages{ Src: pp.pathEnd1, Dst: pp.pathEnd2, + SrcMsgConnectionPreInit: pp.pathEnd1.messageCache.ConnectionHandshake[preInitKey], SrcMsgConnectionOpenInit: pp.pathEnd1.messageCache.ConnectionHandshake[conntypes.EventTypeConnectionOpenInit], DstMsgConnectionOpenTry: pp.pathEnd2.messageCache.ConnectionHandshake[conntypes.EventTypeConnectionOpenTry], SrcMsgConnectionOpenAck: pp.pathEnd1.messageCache.ConnectionHandshake[conntypes.EventTypeConnectionOpenAck], @@ -607,19 +936,19 @@ func (pp *PathProcessor) processLatestMessages(ctx context.Context) error { pathEnd2ConnectionHandshakeMessages := pathEndConnectionHandshakeMessages{ Src: pp.pathEnd2, Dst: pp.pathEnd1, + SrcMsgConnectionPreInit: pp.pathEnd2.messageCache.ConnectionHandshake[preInitKey], SrcMsgConnectionOpenInit: pp.pathEnd2.messageCache.ConnectionHandshake[conntypes.EventTypeConnectionOpenInit], DstMsgConnectionOpenTry: pp.pathEnd1.messageCache.ConnectionHandshake[conntypes.EventTypeConnectionOpenTry], SrcMsgConnectionOpenAck: pp.pathEnd2.messageCache.ConnectionHandshake[conntypes.EventTypeConnectionOpenAck], DstMsgConnectionOpenConfirm: pp.pathEnd1.messageCache.ConnectionHandshake[conntypes.EventTypeConnectionOpenConfirm], } - - pathEnd1ConnectionHandshakeRes := pp.getUnrelayedConnectionHandshakeMessagesAndToDelete(pathEnd1ConnectionHandshakeMessages) - - pathEnd2ConnectionHandshakeRes := pp.getUnrelayedConnectionHandshakeMessagesAndToDelete(pathEnd2ConnectionHandshakeMessages) + pathEnd1ConnectionHandshakeRes := pp.unrelayedConnectionHandshakeMessages(pathEnd1ConnectionHandshakeMessages) + pathEnd2ConnectionHandshakeRes := pp.unrelayedConnectionHandshakeMessages(pathEnd2ConnectionHandshakeMessages) pathEnd1ChannelHandshakeMessages := pathEndChannelHandshakeMessages{ Src: pp.pathEnd1, Dst: pp.pathEnd2, + SrcMsgChannelPreInit: pp.pathEnd1.messageCache.ChannelHandshake[preInitKey], SrcMsgChannelOpenInit: pp.pathEnd1.messageCache.ChannelHandshake[chantypes.EventTypeChannelOpenInit], DstMsgChannelOpenTry: pp.pathEnd2.messageCache.ChannelHandshake[chantypes.EventTypeChannelOpenTry], SrcMsgChannelOpenAck: pp.pathEnd1.messageCache.ChannelHandshake[chantypes.EventTypeChannelOpenAck], @@ -629,34 +958,20 @@ func (pp *PathProcessor) processLatestMessages(ctx context.Context) error { pathEnd2ChannelHandshakeMessages := pathEndChannelHandshakeMessages{ Src: pp.pathEnd2, Dst: pp.pathEnd1, + SrcMsgChannelPreInit: pp.pathEnd2.messageCache.ChannelHandshake[preInitKey], SrcMsgChannelOpenInit: pp.pathEnd2.messageCache.ChannelHandshake[chantypes.EventTypeChannelOpenInit], DstMsgChannelOpenTry: pp.pathEnd1.messageCache.ChannelHandshake[chantypes.EventTypeChannelOpenTry], SrcMsgChannelOpenAck: pp.pathEnd2.messageCache.ChannelHandshake[chantypes.EventTypeChannelOpenAck], DstMsgChannelOpenConfirm: pp.pathEnd1.messageCache.ChannelHandshake[chantypes.EventTypeChannelOpenConfirm], } - - pathEnd1ChannelHandshakeRes := pp.getUnrelayedChannelHandshakeMessagesAndToDelete(pathEnd1ChannelHandshakeMessages) - pathEnd2ChannelHandshakeRes := pp.getUnrelayedChannelHandshakeMessagesAndToDelete(pathEnd2ChannelHandshakeMessages) + pathEnd1ChannelHandshakeRes := pp.unrelayedChannelHandshakeMessages(pathEnd1ChannelHandshakeMessages) + pathEnd2ChannelHandshakeRes := pp.unrelayedChannelHandshakeMessages(pathEnd2ChannelHandshakeMessages) // process the packet flows for both path ends to determine what needs to be relayed pathEnd1ProcessRes := make([]pathEndPacketFlowResponse, len(channelPairs)) pathEnd2ProcessRes := make([]pathEndPacketFlowResponse, len(channelPairs)) for i, pair := range channelPairs { - var pathEnd1ChannelCloseConfirm, pathEnd2ChannelCloseConfirm *provider.ChannelInfo - - if pathEnd1ChanCloseConfirmMsgs, ok := pp.pathEnd1.messageCache.ChannelHandshake[chantypes.EventTypeChannelCloseConfirm]; ok { - if pathEnd1ChannelCloseConfirmMsg, ok := pathEnd1ChanCloseConfirmMsgs[pair.pathEnd1ChannelKey]; ok { - pathEnd1ChannelCloseConfirm = &pathEnd1ChannelCloseConfirmMsg - } - } - - if pathEnd2ChanCloseConfirmMsgs, ok := pp.pathEnd2.messageCache.ChannelHandshake[chantypes.EventTypeChannelCloseConfirm]; ok { - if pathEnd2ChannelCloseConfirmMsg, ok := pathEnd2ChanCloseConfirmMsgs[pair.pathEnd2ChannelKey]; ok { - pathEnd2ChannelCloseConfirm = &pathEnd2ChannelCloseConfirmMsg - } - } - // Append acks into recv packet info if present pathEnd1DstMsgRecvPacket := pp.pathEnd2.messageCache.PacketFlow[pair.pathEnd2ChannelKey][chantypes.EventTypeRecvPacket] for seq, ackInfo := range pp.pathEnd2.messageCache.PacketFlow[pair.pathEnd2ChannelKey][chantypes.EventTypeWriteAck] { @@ -675,38 +990,58 @@ func (pp *PathProcessor) processLatestMessages(ctx context.Context) error { } pathEnd1PacketFlowMessages := pathEndPacketFlowMessages{ - Src: pp.pathEnd1, - Dst: pp.pathEnd2, - ChannelKey: pair.pathEnd1ChannelKey, - SrcMsgTransfer: pp.pathEnd1.messageCache.PacketFlow[pair.pathEnd1ChannelKey][chantypes.EventTypeSendPacket], - DstMsgRecvPacket: pathEnd1DstMsgRecvPacket, - SrcMsgAcknowledgement: pp.pathEnd1.messageCache.PacketFlow[pair.pathEnd1ChannelKey][chantypes.EventTypeAcknowledgePacket], - SrcMsgTimeout: pp.pathEnd1.messageCache.PacketFlow[pair.pathEnd1ChannelKey][chantypes.EventTypeTimeoutPacket], - SrcMsgTimeoutOnClose: pp.pathEnd1.messageCache.PacketFlow[pair.pathEnd1ChannelKey][chantypes.EventTypeTimeoutPacketOnClose], - DstMsgChannelCloseConfirm: pathEnd2ChannelCloseConfirm, - DstMsgRequestTimeout: pp.pathEnd2.messageCache.PacketFlow[pair.pathEnd2ChannelKey][common.EventTimeoutRequest], + Src: pp.pathEnd1, + Dst: pp.pathEnd2, + ChannelKey: pair.pathEnd1ChannelKey, + SrcPreTransfer: pp.pathEnd1.messageCache.PacketFlow[pair.pathEnd1ChannelKey][preInitKey], + SrcMsgTransfer: pp.pathEnd1.messageCache.PacketFlow[pair.pathEnd1ChannelKey][chantypes.EventTypeSendPacket], + DstMsgRecvPacket: pathEnd1DstMsgRecvPacket, + SrcMsgAcknowledgement: pp.pathEnd1.messageCache.PacketFlow[pair.pathEnd1ChannelKey][chantypes.EventTypeAcknowledgePacket], + SrcMsgTimeout: pp.pathEnd1.messageCache.PacketFlow[pair.pathEnd1ChannelKey][chantypes.EventTypeTimeoutPacket], + SrcMsgTimeoutOnClose: pp.pathEnd1.messageCache.PacketFlow[pair.pathEnd1ChannelKey][chantypes.EventTypeTimeoutPacketOnClose], + DstMsgRequestTimeout: pp.pathEnd2.messageCache.PacketFlow[pair.pathEnd2ChannelKey][common.EventTimeoutRequest], } pathEnd2PacketFlowMessages := pathEndPacketFlowMessages{ - Src: pp.pathEnd2, - Dst: pp.pathEnd1, - ChannelKey: pair.pathEnd2ChannelKey, - SrcMsgTransfer: pp.pathEnd2.messageCache.PacketFlow[pair.pathEnd2ChannelKey][chantypes.EventTypeSendPacket], - DstMsgRecvPacket: pathEnd2DstMsgRecvPacket, - SrcMsgAcknowledgement: pp.pathEnd2.messageCache.PacketFlow[pair.pathEnd2ChannelKey][chantypes.EventTypeAcknowledgePacket], - SrcMsgTimeout: pp.pathEnd2.messageCache.PacketFlow[pair.pathEnd2ChannelKey][chantypes.EventTypeTimeoutPacket], - SrcMsgTimeoutOnClose: pp.pathEnd2.messageCache.PacketFlow[pair.pathEnd2ChannelKey][chantypes.EventTypeTimeoutPacketOnClose], - DstMsgChannelCloseConfirm: pathEnd1ChannelCloseConfirm, - DstMsgRequestTimeout: pp.pathEnd1.messageCache.PacketFlow[pair.pathEnd1ChannelKey][common.EventTimeoutRequest], + Src: pp.pathEnd2, + Dst: pp.pathEnd1, + ChannelKey: pair.pathEnd2ChannelKey, + SrcPreTransfer: pp.pathEnd2.messageCache.PacketFlow[pair.pathEnd1ChannelKey][preInitKey], + SrcMsgTransfer: pp.pathEnd2.messageCache.PacketFlow[pair.pathEnd2ChannelKey][chantypes.EventTypeSendPacket], + DstMsgRecvPacket: pathEnd2DstMsgRecvPacket, + SrcMsgAcknowledgement: pp.pathEnd2.messageCache.PacketFlow[pair.pathEnd2ChannelKey][chantypes.EventTypeAcknowledgePacket], + SrcMsgTimeout: pp.pathEnd2.messageCache.PacketFlow[pair.pathEnd2ChannelKey][chantypes.EventTypeTimeoutPacket], + SrcMsgTimeoutOnClose: pp.pathEnd2.messageCache.PacketFlow[pair.pathEnd2ChannelKey][chantypes.EventTypeTimeoutPacketOnClose], + DstMsgRequestTimeout: pp.pathEnd1.messageCache.PacketFlow[pair.pathEnd1ChannelKey][common.EventTimeoutRequest], } - pathEnd1ProcessRes[i] = pp.getUnrelayedPacketsAndAcksAndToDelete(ctx, pathEnd1PacketFlowMessages) - pathEnd2ProcessRes[i] = pp.getUnrelayedPacketsAndAcksAndToDelete(ctx, pathEnd2PacketFlowMessages) + pathEnd1ProcessRes[i] = pp.unrelayedPacketFlowMessages(ctx, pathEnd1PacketFlowMessages) + pathEnd2ProcessRes[i] = pp.unrelayedPacketFlowMessages(ctx, pathEnd2PacketFlowMessages) } + pathEnd1ChannelCloseMessages := pathEndChannelCloseMessages{ + Src: pp.pathEnd1, + Dst: pp.pathEnd2, + SrcMsgChannelPreInit: pp.pathEnd1.messageCache.ChannelHandshake[preCloseKey], + SrcMsgChannelCloseInit: pp.pathEnd1.messageCache.ChannelHandshake[chantypes.EventTypeChannelCloseInit], + DstMsgChannelCloseConfirm: pp.pathEnd2.messageCache.ChannelHandshake[chantypes.EventTypeChannelCloseConfirm], + } + pathEnd2ChannelCloseMessages := pathEndChannelCloseMessages{ + Src: pp.pathEnd2, + Dst: pp.pathEnd1, + SrcMsgChannelPreInit: pp.pathEnd2.messageCache.ChannelHandshake[preCloseKey], + SrcMsgChannelCloseInit: pp.pathEnd2.messageCache.ChannelHandshake[chantypes.EventTypeChannelCloseInit], + DstMsgChannelCloseConfirm: pp.pathEnd1.messageCache.ChannelHandshake[chantypes.EventTypeChannelCloseConfirm], + } + pathEnd1ChannelCloseRes := pp.unrelayedChannelCloseMessages(pathEnd1ChannelCloseMessages) + pathEnd2ChannelCloseRes := pp.unrelayedChannelCloseMessages(pathEnd2ChannelCloseMessages) + // concatenate applicable messages for pathend pathEnd1ConnectionMessages, pathEnd2ConnectionMessages := pp.connectionMessagesToSend(pathEnd1ConnectionHandshakeRes, pathEnd2ConnectionHandshakeRes) - pathEnd1ChannelMessages, pathEnd2ChannelMessages := pp.channelMessagesToSend(pathEnd1ChannelHandshakeRes, pathEnd2ChannelHandshakeRes) + pathEnd1ChannelMessages, pathEnd2ChannelMessages := pp.channelMessagesToSend( + pathEnd1ChannelHandshakeRes, pathEnd2ChannelHandshakeRes, + pathEnd1ChannelCloseRes, pathEnd2ChannelCloseRes, + ) pathEnd1PacketMessages, pathEnd2PacketMessages, pathEnd1ChanCloseMessages, pathEnd2ChanCloseMessages := pp.packetMessagesToSend(channelPairs, pathEnd1ProcessRes, pathEnd2ProcessRes) pathEnd1ChannelMessages = append(pathEnd1ChannelMessages, pathEnd1ChanCloseMessages...) @@ -737,8 +1072,6 @@ func (pp *PathProcessor) processLatestMessages(ctx context.Context) error { clientICQMessages: pathEnd2ClientICQMessages, } - pp.appendInitialMessageIfNecessary(&pathEnd1Messages, &pathEnd2Messages) - // now assemble and send messages in parallel // if sending messages fails to one pathEnd, we don't need to halt sending to the other pathEnd. var eg errgroup.Group @@ -753,26 +1086,31 @@ func (pp *PathProcessor) processLatestMessages(ctx context.Context) error { return eg.Wait() } -func (pp *PathProcessor) channelMessagesToSend(pathEnd1ChannelHandshakeRes, pathEnd2ChannelHandshakeRes pathEndChannelHandshakeResponse) ([]channelIBCMessage, []channelIBCMessage) { - pathEnd1ChannelSrcLen := len(pathEnd1ChannelHandshakeRes.SrcMessages) - pathEnd1ChannelDstLen := len(pathEnd1ChannelHandshakeRes.DstMessages) - pathEnd2ChannelDstLen := len(pathEnd2ChannelHandshakeRes.DstMessages) - pathEnd2ChannelSrcLen := len(pathEnd2ChannelHandshakeRes.SrcMessages) - pathEnd1ChannelMessages := make([]channelIBCMessage, 0, pathEnd1ChannelSrcLen+pathEnd2ChannelDstLen) - pathEnd2ChannelMessages := make([]channelIBCMessage, 0, pathEnd2ChannelSrcLen+pathEnd1ChannelDstLen) +func (pp *PathProcessor) channelMessagesToSend(pathEnd1ChannelHandshakeRes, pathEnd2ChannelHandshakeRes, pathEnd1ChannelCloseRes, pathEnd2ChannelCloseRes pathEndChannelHandshakeResponse) ([]channelIBCMessage, []channelIBCMessage) { + pathEnd1ChannelOpenSrcLen := len(pathEnd1ChannelHandshakeRes.SrcMessages) + pathEnd1ChannelOpenDstLen := len(pathEnd1ChannelHandshakeRes.DstMessages) + pathEnd2ChannelOpenDstLen := len(pathEnd2ChannelHandshakeRes.DstMessages) + pathEnd2ChannelOpenSrcLen := len(pathEnd2ChannelHandshakeRes.SrcMessages) + + pathEnd1ChannelCloseSrcLen := len(pathEnd1ChannelHandshakeRes.SrcMessages) + pathEnd1ChannelCloseDstLen := len(pathEnd1ChannelHandshakeRes.DstMessages) + pathEnd2ChannelCloseDstLen := len(pathEnd2ChannelHandshakeRes.DstMessages) + pathEnd2ChannelCloseSrcLen := len(pathEnd2ChannelHandshakeRes.SrcMessages) + + pathEnd1ChannelMessages := make([]channelIBCMessage, 0, pathEnd1ChannelOpenSrcLen+pathEnd2ChannelOpenDstLen+pathEnd1ChannelCloseSrcLen+pathEnd2ChannelCloseDstLen) + pathEnd2ChannelMessages := make([]channelIBCMessage, 0, pathEnd2ChannelOpenSrcLen+pathEnd1ChannelOpenDstLen+pathEnd2ChannelCloseSrcLen+pathEnd1ChannelCloseDstLen) // pathEnd1 channel messages come from pathEnd1 src and pathEnd2 dst pathEnd1ChannelMessages = append(pathEnd1ChannelMessages, pathEnd2ChannelHandshakeRes.DstMessages...) + pathEnd1ChannelMessages = append(pathEnd1ChannelMessages, pathEnd2ChannelCloseRes.DstMessages...) pathEnd1ChannelMessages = append(pathEnd1ChannelMessages, pathEnd1ChannelHandshakeRes.SrcMessages...) + pathEnd1ChannelMessages = append(pathEnd1ChannelMessages, pathEnd1ChannelCloseRes.SrcMessages...) // pathEnd2 channel messages come from pathEnd2 src and pathEnd1 dst pathEnd2ChannelMessages = append(pathEnd2ChannelMessages, pathEnd1ChannelHandshakeRes.DstMessages...) + pathEnd2ChannelMessages = append(pathEnd2ChannelMessages, pathEnd1ChannelCloseRes.DstMessages...) pathEnd2ChannelMessages = append(pathEnd2ChannelMessages, pathEnd2ChannelHandshakeRes.SrcMessages...) - - pp.pathEnd1.messageCache.ChannelHandshake.DeleteMessages(pathEnd1ChannelHandshakeRes.ToDeleteSrc, pathEnd2ChannelHandshakeRes.ToDeleteDst) - pp.pathEnd2.messageCache.ChannelHandshake.DeleteMessages(pathEnd2ChannelHandshakeRes.ToDeleteSrc, pathEnd1ChannelHandshakeRes.ToDeleteDst) - pp.pathEnd1.channelProcessing.deleteMessages(pathEnd1ChannelHandshakeRes.ToDeleteSrc, pathEnd2ChannelHandshakeRes.ToDeleteDst) - pp.pathEnd2.channelProcessing.deleteMessages(pathEnd2ChannelHandshakeRes.ToDeleteSrc, pathEnd1ChannelHandshakeRes.ToDeleteDst) + pathEnd2ChannelMessages = append(pathEnd2ChannelMessages, pathEnd2ChannelCloseRes.SrcMessages...) return pathEnd1ChannelMessages, pathEnd2ChannelMessages } @@ -793,11 +1131,6 @@ func (pp *PathProcessor) connectionMessagesToSend(pathEnd1ConnectionHandshakeRes pathEnd2ConnectionMessages = append(pathEnd2ConnectionMessages, pathEnd1ConnectionHandshakeRes.DstMessages...) pathEnd2ConnectionMessages = append(pathEnd2ConnectionMessages, pathEnd2ConnectionHandshakeRes.SrcMessages...) - pp.pathEnd1.messageCache.ConnectionHandshake.DeleteMessages(pathEnd1ConnectionHandshakeRes.ToDeleteSrc, pathEnd2ConnectionHandshakeRes.ToDeleteDst) - pp.pathEnd2.messageCache.ConnectionHandshake.DeleteMessages(pathEnd2ConnectionHandshakeRes.ToDeleteSrc, pathEnd1ConnectionHandshakeRes.ToDeleteDst) - pp.pathEnd1.connProcessing.deleteMessages(pathEnd1ConnectionHandshakeRes.ToDeleteSrc, pathEnd2ConnectionHandshakeRes.ToDeleteDst) - pp.pathEnd2.connProcessing.deleteMessages(pathEnd2ConnectionHandshakeRes.ToDeleteSrc, pathEnd1ConnectionHandshakeRes.ToDeleteDst) - return pathEnd1ConnectionMessages, pathEnd2ConnectionMessages } @@ -824,7 +1157,7 @@ func (pp *PathProcessor) packetMessagesToSend( pathEnd1ChannelMessage := make([]channelIBCMessage, 0, pathEnd1ChannelLen) pathEnd2ChannelMessage := make([]channelIBCMessage, 0, pathEnd2ChannelLen) - for i, channelPair := range channelPairs { + for i := range channelPairs { pathEnd1PacketMessages = append(pathEnd1PacketMessages, pathEnd2ProcessRes[i].DstMessages...) pathEnd1PacketMessages = append(pathEnd1PacketMessages, pathEnd1ProcessRes[i].SrcMessages...) @@ -833,18 +1166,6 @@ func (pp *PathProcessor) packetMessagesToSend( pathEnd1ChannelMessage = append(pathEnd1ChannelMessage, pathEnd2ProcessRes[i].DstChannelMessage...) pathEnd2ChannelMessage = append(pathEnd2ChannelMessage, pathEnd1ProcessRes[i].DstChannelMessage...) - - pp.pathEnd1.messageCache.ChannelHandshake.DeleteMessages(pathEnd2ProcessRes[i].ToDeleteDstChannel) - pp.pathEnd1.channelProcessing.deleteMessages(pathEnd2ProcessRes[i].ToDeleteDstChannel) - - pp.pathEnd2.messageCache.ChannelHandshake.DeleteMessages(pathEnd1ProcessRes[i].ToDeleteDstChannel) - pp.pathEnd2.channelProcessing.deleteMessages(pathEnd1ProcessRes[i].ToDeleteDstChannel) - - pp.pathEnd1.messageCache.PacketFlow[channelPair.pathEnd1ChannelKey].DeleteMessages(pathEnd1ProcessRes[i].ToDeleteSrc, pathEnd2ProcessRes[i].ToDeleteDst) - pp.pathEnd2.messageCache.PacketFlow[channelPair.pathEnd2ChannelKey].DeleteMessages(pathEnd2ProcessRes[i].ToDeleteSrc, pathEnd1ProcessRes[i].ToDeleteDst) - - pp.pathEnd1.packetProcessing[channelPair.pathEnd1ChannelKey].deleteMessages(pathEnd1ProcessRes[i].ToDeleteSrc, pathEnd2ProcessRes[i].ToDeleteDst) - pp.pathEnd2.packetProcessing[channelPair.pathEnd2ChannelKey].deleteMessages(pathEnd2ProcessRes[i].ToDeleteSrc, pathEnd1ProcessRes[i].ToDeleteDst) } return pathEnd1PacketMessages, pathEnd2PacketMessages, pathEnd1ChannelMessage, pathEnd2ChannelMessage @@ -855,7 +1176,7 @@ func queryPacketCommitments( pathEnd *pathEndRuntime, k ChannelKey, commitments map[ChannelKey][]uint64, - mu *sync.Mutex, + mu sync.Locker, ) func() error { return func() error { pathEnd.log.Debug("Flushing", zap.String("channel", k.ChannelID), zap.String("port", k.PortID)) @@ -870,108 +1191,204 @@ func queryPacketCommitments( for i, p := range c.Commitments { commitments[k][i] = p.Sequence } + sort.SliceStable(commitments[k], func(i, j int) bool { + return commitments[k][i] < commitments[k][j] + }) return nil } } -func queuePendingRecvAndAcks( +// queuePendingRecvAndAcks returns whether flush can be considered complete (none skipped). +func (pp *PathProcessor) queuePendingRecvAndAcks( ctx context.Context, src, dst *pathEndRuntime, k ChannelKey, seqs []uint64, srcCache ChannelPacketMessagesCache, dstCache ChannelPacketMessagesCache, - srcMu *sync.Mutex, - dstMu *sync.Mutex, -) func() error { - return func() error { - if len(seqs) == 0 { - src.log.Debug("Nothing to flush", zap.String("channel", k.ChannelID), zap.String("port", k.PortID)) - return nil - } + srcMu sync.Locker, + dstMu sync.Locker, +) (bool, error) { + + if len(seqs) == 0 { + src.log.Debug("Nothing to flush", zap.String("channel", k.ChannelID), zap.String("port", k.PortID)) + return true, nil + } + + dstChan, dstPort := k.CounterpartyChannelID, k.CounterpartyPortID - unrecv, err := dst.chainProvider.QueryUnreceivedPackets(ctx, dst.latestBlock.Height, k.CounterpartyChannelID, k.CounterpartyPortID, seqs) + unrecv, err := dst.chainProvider.QueryUnreceivedPackets(ctx, dst.latestBlock.Height, dstChan, dstPort, seqs) + if err != nil { + return false, err + } + + dstHeight := int64(dst.latestBlock.Height) + + if len(unrecv) > 0 { + channel, err := dst.chainProvider.QueryChannel(ctx, dstHeight, dstChan, dstPort) if err != nil { - return err + return false, err + } + + if channel.Channel.Ordering == chantypes.ORDERED { + nextSeqRecv, err := dst.chainProvider.QueryNextSeqRecv(ctx, dstHeight, dstChan, dstPort) + if err != nil { + return false, err + } + + var newUnrecv []uint64 + + for _, seq := range unrecv { + if seq >= nextSeqRecv.NextSequenceReceive { + newUnrecv = append(newUnrecv, seq) + } + } + + unrecv = newUnrecv + + sort.SliceStable(unrecv, func(i, j int) bool { + return unrecv[i] < unrecv[j] + }) } + } + + var eg errgroup.Group - if len(unrecv) > 0 { - src.log.Debug("Will flush MsgRecvPacket", zap.String("channel", k.ChannelID), zap.String("port", k.PortID), zap.Uint64s("sequences", unrecv)) - } else { - src.log.Debug("No MsgRecvPacket to flush", zap.String("channel", k.ChannelID), zap.String("port", k.PortID)) + skipped := false + + for i, seq := range unrecv { + srcMu.Lock() + if srcCache.IsCached(chantypes.EventTypeSendPacket, k, seq) { + continue // already cached + } + srcMu.Unlock() + + if i >= maxPacketsPerFlush { + skipped = true + break } - for _, seq := range unrecv { + src.log.Debug("Querying send packet", + zap.String("channel", k.ChannelID), + zap.String("port", k.PortID), + zap.Uint64("sequence", seq), + ) + + seq := seq + + eg.Go(func() error { sendPacket, err := src.chainProvider.QuerySendPacket(ctx, k.ChannelID, k.PortID, seq) if err != nil { return err } srcMu.Lock() - if _, ok := srcCache[k]; !ok { - srcCache[k] = make(PacketMessagesCache) - } - if _, ok := srcCache[k][chantypes.EventTypeSendPacket]; !ok { - srcCache[k][chantypes.EventTypeSendPacket] = make(PacketSequenceCache) - } - srcCache[k][chantypes.EventTypeSendPacket][seq] = sendPacket + srcCache.Cache(chantypes.EventTypeSendPacket, k, seq, sendPacket) srcMu.Unlock() - } - var unacked []uint64 + src.log.Debug("Cached send packet", + zap.String("channel", k.ChannelID), + zap.String("port", k.PortID), + zap.String("ctrpty_channel", k.CounterpartyChannelID), + zap.String("ctrpty_port", k.CounterpartyPortID), + zap.Uint64("sequence", seq), + ) - SeqLoop: - for _, seq := range seqs { - for _, unrecvSeq := range unrecv { - if seq == unrecvSeq { - continue SeqLoop - } + return nil + }) + } + + if err := eg.Wait(); err != nil { + return false, err + } + + if len(unrecv) > 0 { + src.log.Debug("Will flush MsgRecvPacket", + zap.String("channel", k.ChannelID), + zap.String("port", k.PortID), + zap.Uint64s("sequences", unrecv), + ) + } else { + src.log.Debug("No MsgRecvPacket to flush", + zap.String("channel", k.ChannelID), + zap.String("port", k.PortID), + ) + } + + var unacked []uint64 + +SeqLoop: + for _, seq := range seqs { + for _, unrecvSeq := range unrecv { + if seq == unrecvSeq { + continue SeqLoop } - // does not exist in unrecv, so this is an ack that must be written - unacked = append(unacked, seq) } + // does not exist in unrecv, so this is an ack that must be written + unacked = append(unacked, seq) + } + + for i, seq := range unacked { + dstMu.Lock() + ck := k.Counterparty() + if dstCache.IsCached(chantypes.EventTypeRecvPacket, ck, seq) && + dstCache.IsCached(chantypes.EventTypeWriteAck, ck, seq) { + continue // already cached + } + dstMu.Unlock() - if len(unacked) > 0 { - src.log.Debug("Will flush MsgAcknowledgement", zap.String("channel", k.ChannelID), zap.String("port", k.PortID), zap.Uint64s("sequences", unrecv)) - } else { - src.log.Debug("No MsgAcknowledgement to flush", zap.String("channel", k.ChannelID), zap.String("port", k.PortID)) + if i >= maxPacketsPerFlush { + skipped = true + break } - for _, seq := range unacked { + seq := seq + + dst.log.Debug("Querying recv packet", + zap.String("channel", k.CounterpartyChannelID), + zap.String("port", k.CounterpartyPortID), + zap.Uint64("sequence", seq), + ) + + eg.Go(func() error { recvPacket, err := dst.chainProvider.QueryRecvPacket(ctx, k.CounterpartyChannelID, k.CounterpartyPortID, seq) if err != nil { return err } - srcMu.Lock() - if _, ok := srcCache[k]; !ok { - srcCache[k] = make(PacketMessagesCache) - } - if _, ok := srcCache[k][chantypes.EventTypeSendPacket]; !ok { - srcCache[k][chantypes.EventTypeSendPacket] = make(PacketSequenceCache) - } - srcCache[k][chantypes.EventTypeSendPacket][seq] = recvPacket - srcMu.Unlock() + ck := k.Counterparty() dstMu.Lock() - if _, ok := dstCache[k]; !ok { - dstCache[k] = make(PacketMessagesCache) - } - if _, ok := dstCache[k][chantypes.EventTypeRecvPacket]; !ok { - dstCache[k][chantypes.EventTypeRecvPacket] = make(PacketSequenceCache) - } - if _, ok := dstCache[k][chantypes.EventTypeWriteAck]; !ok { - dstCache[k][chantypes.EventTypeWriteAck] = make(PacketSequenceCache) - } - dstCache[k][chantypes.EventTypeRecvPacket][seq] = recvPacket - dstCache[k][chantypes.EventTypeWriteAck][seq] = recvPacket + dstCache.Cache(chantypes.EventTypeRecvPacket, ck, seq, recvPacket) + dstCache.Cache(chantypes.EventTypeWriteAck, ck, seq, recvPacket) dstMu.Unlock() - } - return nil + + return nil + }) + } + + if err := eg.Wait(); err != nil { + return false, err } + + if len(unacked) > 0 { + dst.log.Debug( + "Will flush MsgAcknowledgement", + zap.Object("channel", k), + zap.Uint64s("sequences", unacked), + ) + } else { + dst.log.Debug( + "No MsgAcknowledgement to flush", + zap.String("channel", k.CounterpartyChannelID), + zap.String("port", k.CounterpartyPortID), + ) + } + + return !skipped, nil } // flush runs queries to relay any pending messages which may have been // in blocks before the height that the chain processors started querying. -func (pp *PathProcessor) flush(ctx context.Context) { +func (pp *PathProcessor) flush(ctx context.Context) error { var ( commitments1 = make(map[ChannelKey][]uint64) commitments2 = make(map[ChannelKey][]uint64) @@ -984,46 +1401,96 @@ func (pp *PathProcessor) flush(ctx context.Context) { // Query remaining packet commitments on both chains var eg errgroup.Group - for k := range pp.pathEnd1.channelStateCache { + for k, open := range pp.pathEnd1.channelStateCache { + if !open { + continue + } + if !pp.pathEnd1.info.ShouldRelayChannel(ChainChannelKey{ + ChainID: pp.pathEnd1.info.ChainID, + CounterpartyChainID: pp.pathEnd2.info.ChainID, + ChannelKey: k, + }) { + continue + } eg.Go(queryPacketCommitments(ctx, pp.pathEnd1, k, commitments1, &commitments1Mu)) } - for k := range pp.pathEnd2.channelStateCache { + for k, open := range pp.pathEnd2.channelStateCache { + if !open { + continue + } + if !pp.pathEnd2.info.ShouldRelayChannel(ChainChannelKey{ + ChainID: pp.pathEnd2.info.ChainID, + CounterpartyChainID: pp.pathEnd1.info.ChainID, + ChannelKey: k, + }) { + continue + } eg.Go(queryPacketCommitments(ctx, pp.pathEnd2, k, commitments2, &commitments2Mu)) } if err := eg.Wait(); err != nil { - pp.log.Error("Failed to query packet commitments", zap.Error(err)) + return fmt.Errorf("failed to query packet commitments: %w", err) } // From remaining packet commitments, determine if: // 1. Packet commitment is on source, but MsgRecvPacket has not yet been relayed to destination // 2. Packet commitment is on source, and MsgRecvPacket has been relayed to destination, but MsgAcknowledgement has not been written to source to clear the packet commitment. // Based on above conditions, enqueue MsgRecvPacket and MsgAcknowledgement messages + skipped := false for k, seqs := range commitments1 { - eg.Go(queuePendingRecvAndAcks(ctx, pp.pathEnd1, pp.pathEnd2, k, seqs, pathEnd1Cache.PacketFlow, pathEnd2Cache.PacketFlow, &pathEnd1CacheMu, &pathEnd2CacheMu)) + k := k + seqs := seqs + eg.Go(func() error { + done, err := pp.queuePendingRecvAndAcks(ctx, pp.pathEnd1, pp.pathEnd2, k, seqs, pathEnd1Cache.PacketFlow, pathEnd2Cache.PacketFlow, &pathEnd1CacheMu, &pathEnd2CacheMu) + if err != nil { + return err + } + if !done { + skipped = true + } + return nil + }) } for k, seqs := range commitments2 { - eg.Go(queuePendingRecvAndAcks(ctx, pp.pathEnd2, pp.pathEnd1, k, seqs, pathEnd2Cache.PacketFlow, pathEnd1Cache.PacketFlow, &pathEnd2CacheMu, &pathEnd1CacheMu)) + k := k + seqs := seqs + eg.Go(func() error { + done, err := pp.queuePendingRecvAndAcks(ctx, pp.pathEnd2, pp.pathEnd1, k, seqs, pathEnd2Cache.PacketFlow, pathEnd1Cache.PacketFlow, &pathEnd2CacheMu, &pathEnd1CacheMu) + if err != nil { + return err + } + if !done { + skipped = true + } + return nil + }) } if err := eg.Wait(); err != nil { - pp.log.Error("Failed to enqueue pending messages for flush", zap.Error(err)) + return fmt.Errorf("failed to enqueue pending messages for flush: %w", err) } pp.pathEnd1.mergeMessageCache(pathEnd1Cache, pp.pathEnd2.info.ChainID, pp.pathEnd2.inSync) pp.pathEnd2.mergeMessageCache(pathEnd2Cache, pp.pathEnd1.info.ChainID, pp.pathEnd1.inSync) + + if skipped { + return fmt.Errorf("flush was successful, but more packet sequences are still pending") + } + + return nil } // shouldTerminateForFlushComplete will determine if the relayer should exit // when FlushLifecycle is used. It will exit when all of the message caches are cleared. -func (pp *PathProcessor) shouldTerminateForFlushComplete( - ctx context.Context, cancel func(), -) bool { +func (pp *PathProcessor) shouldTerminateForFlushComplete() bool { if _, ok := pp.messageLifecycle.(*FlushLifecycle); !ok { return false } - for _, packetMessagesCache := range pp.pathEnd1.messageCache.PacketFlow { + for k, packetMessagesCache := range pp.pathEnd1.messageCache.PacketFlow { + if open, ok := pp.pathEnd1.channelStateCache[k]; !ok || !open { + continue + } for _, c := range packetMessagesCache { if len(c) > 0 { return false @@ -1031,16 +1498,23 @@ func (pp *PathProcessor) shouldTerminateForFlushComplete( } } for _, c := range pp.pathEnd1.messageCache.ChannelHandshake { - if len(c) > 0 { - return false + for k := range pp.pathEnd1.channelStateCache { + if _, ok := c[k]; ok { + return false + } } } for _, c := range pp.pathEnd1.messageCache.ConnectionHandshake { - if len(c) > 0 { - return false + for k := range pp.pathEnd1.connectionStateCache { + if _, ok := c[k]; ok { + return false + } } } - for _, packetMessagesCache := range pp.pathEnd2.messageCache.PacketFlow { + for k, packetMessagesCache := range pp.pathEnd2.messageCache.PacketFlow { + if open, ok := pp.pathEnd1.channelStateCache[k]; !ok || !open { + continue + } for _, c := range packetMessagesCache { if len(c) > 0 { return false @@ -1048,13 +1522,17 @@ func (pp *PathProcessor) shouldTerminateForFlushComplete( } } for _, c := range pp.pathEnd2.messageCache.ChannelHandshake { - if len(c) > 0 { - return false + for k := range pp.pathEnd1.channelStateCache { + if _, ok := c[k]; ok { + return false + } } } for _, c := range pp.pathEnd2.messageCache.ConnectionHandshake { - if len(c) > 0 { - return false + for k := range pp.pathEnd1.connectionStateCache { + if _, ok := c[k]; ok { + return false + } } } pp.log.Info("Found termination condition for flush, all caches cleared") diff --git a/relayer/processor/types.go b/relayer/processor/types.go index 1a59d98fc..8fa7b19c4 100644 --- a/relayer/processor/types.go +++ b/relayer/processor/types.go @@ -73,6 +73,18 @@ type ChannelMessageLifecycle struct { func (t *ChannelMessageLifecycle) messageLifecycler() {} +// ChannelCloseLifecycle is used as a stop condition for the PathProcessor. +// It will attempt to finish closing the channel and terminate once the channel is closed. +type ChannelCloseLifecycle struct { + SrcChainID string + SrcChannelID string + SrcPortID string + SrcConnID string + DstConnID string +} + +func (t *ChannelCloseLifecycle) messageLifecycler() {} + // IBCMessagesCache holds cached messages for packet flows, connection handshakes, // and channel handshakes. The PathProcessors use this for message correlation to determine // when messages should be sent and are pruned when flows/handshakes are complete. @@ -176,6 +188,18 @@ func (k ChannelKey) MsgInitKey() ChannelKey { } } +// PreInitKey is used for comparing pre-init keys with other connection +// handshake messages. Before the channel handshake, +// do not have ChannelID or CounterpartyChannelID. +func (k ChannelKey) PreInitKey() ChannelKey { + return ChannelKey{ + ChannelID: "", + PortID: k.PortID, + CounterpartyChannelID: "", + CounterpartyPortID: k.CounterpartyPortID, + } +} + func (k ChannelKey) MarshalLogObject(enc zapcore.ObjectEncoder) error { enc.AddString("channel_id", k.ChannelID) enc.AddString("port_id", k.PortID) @@ -213,6 +237,18 @@ func (connectionKey ConnectionKey) MsgInitKey() ConnectionKey { } } +// PreInitKey is used for comparing pre-init keys with other connection +// handshake messages. Before starting a connection handshake, +// do not have ConnectionID or CounterpartyConnectionID. +func (connectionKey ConnectionKey) PreInitKey() ConnectionKey { + return ConnectionKey{ + ClientID: connectionKey.ClientID, + ConnectionID: "", + CounterpartyClientID: connectionKey.CounterpartyClientID, + CounterpartyConnID: "", + } +} + func (k ConnectionKey) MarshalLogObject(enc zapcore.ObjectEncoder) error { enc.AddString("connection_id", k.ConnectionID) enc.AddString("client_id", k.ClientID) @@ -295,6 +331,36 @@ func (c PacketMessagesCache) DeleteMessages(toDelete ...map[string][]uint64) { } } +// IsCached returns true if a sequence for a channel key and event type is already cached. +func (c ChannelPacketMessagesCache) IsCached(eventType string, k ChannelKey, sequence uint64) bool { + if _, ok := c[k]; !ok { + return false + } + if _, ok := c[k][eventType]; !ok { + return false + } + if _, ok := c[k][eventType][sequence]; !ok { + return false + } + return true +} + +// Cache stores packet info safely, generating intermediate maps along the way if necessary. +func (c ChannelPacketMessagesCache) Cache( + eventType string, + k ChannelKey, + sequence uint64, + packetInfo provider.PacketInfo, +) { + if _, ok := c[k]; !ok { + c[k] = make(PacketMessagesCache) + } + if _, ok := c[k][eventType]; !ok { + c[k][eventType] = make(PacketSequenceCache) + } + c[k][eventType][sequence] = packetInfo +} + // Merge merges another ChannelPacketMessagesCache into this one. func (c ChannelPacketMessagesCache) Merge(other ChannelPacketMessagesCache) { for channelKey, messageCache := range other { diff --git a/relayer/processor/types_internal.go b/relayer/processor/types_internal.go index 693422bff..a1493c443 100644 --- a/relayer/processor/types_internal.go +++ b/relayer/processor/types_internal.go @@ -13,6 +13,11 @@ import ( "go.uber.org/zap/zapcore" ) +var _ zapcore.ObjectMarshaler = packetIBCMessage{} +var _ zapcore.ObjectMarshaler = channelIBCMessage{} +var _ zapcore.ObjectMarshaler = connectionIBCMessage{} +var _ zapcore.ObjectMarshaler = clientICQMessage{} + // pathEndMessages holds the different IBC messages that // will attempt to be sent to the pathEnd. type pathEndMessages struct { @@ -388,15 +393,15 @@ type clientICQProcessingCache map[provider.ClientICQQueryID]processingMessage // contains MsgRecvPacket from counterparty // entire packet flow type pathEndPacketFlowMessages struct { - Src *pathEndRuntime - Dst *pathEndRuntime - ChannelKey ChannelKey - SrcMsgTransfer PacketSequenceCache - DstMsgRecvPacket PacketSequenceCache - SrcMsgAcknowledgement PacketSequenceCache - SrcMsgTimeout PacketSequenceCache - SrcMsgTimeoutOnClose PacketSequenceCache - DstMsgChannelCloseConfirm *provider.ChannelInfo + Src *pathEndRuntime + Dst *pathEndRuntime + ChannelKey ChannelKey + SrcPreTransfer PacketSequenceCache + SrcMsgTransfer PacketSequenceCache + DstMsgRecvPacket PacketSequenceCache + SrcMsgAcknowledgement PacketSequenceCache + SrcMsgTimeout PacketSequenceCache + SrcMsgTimeoutOnClose PacketSequenceCache // Adding for Icon chain DstMsgRequestTimeout PacketSequenceCache @@ -405,6 +410,7 @@ type pathEndPacketFlowMessages struct { type pathEndConnectionHandshakeMessages struct { Src *pathEndRuntime Dst *pathEndRuntime + SrcMsgConnectionPreInit ConnectionMessageCache SrcMsgConnectionOpenInit ConnectionMessageCache DstMsgConnectionOpenTry ConnectionMessageCache SrcMsgConnectionOpenAck ConnectionMessageCache @@ -414,37 +420,36 @@ type pathEndConnectionHandshakeMessages struct { type pathEndChannelHandshakeMessages struct { Src *pathEndRuntime Dst *pathEndRuntime + SrcMsgChannelPreInit ChannelMessageCache SrcMsgChannelOpenInit ChannelMessageCache DstMsgChannelOpenTry ChannelMessageCache SrcMsgChannelOpenAck ChannelMessageCache DstMsgChannelOpenConfirm ChannelMessageCache } +type pathEndChannelCloseMessages struct { + Src *pathEndRuntime + Dst *pathEndRuntime + SrcMsgChannelPreInit ChannelMessageCache + SrcMsgChannelCloseInit ChannelMessageCache + DstMsgChannelCloseConfirm ChannelMessageCache +} + type pathEndPacketFlowResponse struct { SrcMessages []packetIBCMessage DstMessages []packetIBCMessage DstChannelMessage []channelIBCMessage - - ToDeleteSrc map[string][]uint64 - ToDeleteDst map[string][]uint64 - ToDeleteDstChannel map[string][]ChannelKey } type pathEndChannelHandshakeResponse struct { SrcMessages []channelIBCMessage DstMessages []channelIBCMessage - - ToDeleteSrc map[string][]ChannelKey - ToDeleteDst map[string][]ChannelKey } type pathEndConnectionHandshakeResponse struct { SrcMessages []connectionIBCMessage DstMessages []connectionIBCMessage - - ToDeleteSrc map[string][]ConnectionKey - ToDeleteDst map[string][]ConnectionKey } func packetInfoChannelKey(p provider.PacketInfo) ChannelKey { @@ -456,24 +461,6 @@ func packetInfoChannelKey(p provider.PacketInfo) ChannelKey { } } -func connectionInfoConnectionKey(c provider.ConnectionInfo) ConnectionKey { - return ConnectionKey{ - ClientID: c.ClientID, - ConnectionID: c.ConnID, - CounterpartyClientID: c.CounterpartyClientID, - CounterpartyConnID: c.CounterpartyConnID, - } -} - -func channelInfoChannelKey(c provider.ChannelInfo) ChannelKey { - return ChannelKey{ - ChannelID: c.ChannelID, - PortID: c.PortID, - CounterpartyChannelID: c.CounterpartyChannelID, - CounterpartyPortID: c.CounterpartyPortID, - } -} - type messageToTrack interface { // assembledMsg returns the assembled message ready to send. assembledMsg() provider.RelayerMessage diff --git a/relayer/processor/utils.go b/relayer/processor/utils.go index 185510b78..1a004c3f6 100644 --- a/relayer/processor/utils.go +++ b/relayer/processor/utils.go @@ -4,13 +4,12 @@ import ( "math" "strings" + "github.com/cosmos/relayer/v2/relayer/common" "github.com/cosmos/relayer/v2/relayer/provider" ) -const clientName = "iconclient" - func ClientIsIcon(cs provider.ClientState) bool { - if strings.Contains(cs.ClientID, clientName) { + if strings.Contains(cs.ClientID, common.IconLightClient) { return true } return false @@ -54,5 +53,3 @@ func nextIconIBCHeader(heightMap IBCHeaderCache, height uint64) (provider.IBCHea header, ok := heightMap[nextHeight] return header, ok } - -// The next header is { false [] 0} true diff --git a/relayer/provider/provider.go b/relayer/provider/provider.go index f0844f77b..9aa8966f0 100644 --- a/relayer/provider/provider.go +++ b/relayer/provider/provider.go @@ -31,7 +31,6 @@ type ProviderConfig interface { NewProvider(log *zap.Logger, homepath string, debug bool, chainName string) (ChainProvider, error) Validate() error BroadcastMode() BroadcastMode - Set(field string, value interface{}) error } type RelayerMessage interface { @@ -218,8 +217,8 @@ func (r RelayerTxResponse) MarshalLogObject(enc zapcore.ObjectEncoder) error { type KeyProvider interface { CreateKeystore(path string) error KeystoreCreated(path string) bool - AddKey(name string, coinType uint32) (output *KeyOutput, err error) - RestoreKey(name, mnemonic string, coinType uint32) (address string, err error) + AddKey(name string, coinType uint32, signingAlgorithm string) (output *KeyOutput, err error) + RestoreKey(name, mnemonic string, coinType uint32, signingAlgorithm string) (address string, err error) ShowAddress(name string) (address string, err error) ListAddresses() (map[string]string, error) DeleteKey(name string) error @@ -237,7 +236,7 @@ type ChainProvider interface { NewClientState(dstChainID string, dstIBCHeader IBCHeader, dstTrustingPeriod, dstUbdPeriod time.Duration, allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour bool) (ibcexported.ClientState, error) // TODO: Remove later - NewClientStateMock(dstChainID string, dstIBCHeader IBCHeader, dstTrustingPeriod, dstUbdPeriod time.Duration, allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour bool) (ibcexported.ClientState, error) + // NewClientStateMock(dstChainID string, dstIBCHeader IBCHeader, dstTrustingPeriod, dstUbdPeriod time.Duration, allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour bool) (ibcexported.ClientState, error) MsgCreateClient(clientState ibcexported.ClientState, consensusState ibcexported.ConsensusState) (RelayerMessage, error) @@ -297,6 +296,9 @@ type ChainProvider interface { // i.e. the chain where the MsgTransfer was committed. MsgTimeoutOnClose(msgTransfer PacketInfo, proofUnreceived PacketProof) (RelayerMessage, error) + // Get the commitment prefix of the chain. + CommitmentPrefix() commitmenttypes.MerklePrefix + // [End] Packet flow IBC message assembly // [Begin] Connection handshake IBC message assembly @@ -399,11 +401,12 @@ type ChainProvider interface { asyncCallback func(*RelayerTxResponse, error), ) error + MsgRegisterCounterpartyPayee(portID, channelID, relayerAddr, counterpartyPayeeAddr string) (RelayerMessage, error) + ChainName() string ChainId() string Type() string ProviderConfig() ProviderConfig - CommitmentPrefix() commitmenttypes.MerklePrefix Key() string Address() (string, error) Timeout() string diff --git a/relayer/relayMsgs.go b/relayer/relayMsgs.go index 52d95f160..698e8b28a 100644 --- a/relayer/relayMsgs.go +++ b/relayer/relayMsgs.go @@ -108,6 +108,11 @@ type SendMsgsResult struct { SrcSendError, DstSendError error } +// SuccessfullySent reports the presence successfully sent batches +func (r SendMsgsResult) SuccessfullySent() bool { + return (r.SuccessfulSrcBatches > 0 || r.SuccessfulDstBatches > 0) +} + // PartiallySent reports the presence of both some successfully sent batches // and some errors. func (r SendMsgsResult) PartiallySent() bool { diff --git a/relayer/strategies.go b/relayer/strategies.go index baace97c2..a829ebce9 100644 --- a/relayer/strategies.go +++ b/relayer/strategies.go @@ -13,6 +13,7 @@ import ( "github.com/cosmos/relayer/v2/relayer/chains/archway" "github.com/cosmos/relayer/v2/relayer/chains/cosmos" "github.com/cosmos/relayer/v2/relayer/chains/icon" + penumbraprocessor "github.com/cosmos/relayer/v2/relayer/chains/penumbra" "github.com/cosmos/relayer/v2/relayer/processor" "go.uber.org/zap" ) @@ -27,7 +28,9 @@ const ( ProcessorEvents string = "events" ProcessorLegacy = "legacy" DefaultClientUpdateThreshold = 0 * time.Millisecond - DefaultFlushInterval = 60 * time.Minute + DefaultFlushInterval = 5 * time.Minute + DefaultMaxMsgLength = 5 + TwoMB = 2 * 1024 * 1024 ) // StartRelayer starts the main relaying loop and returns a channel that will contain any control-flow related errors. @@ -36,7 +39,7 @@ func StartRelayer( log *zap.Logger, chains map[string]*Chain, paths []NamedPath, - maxTxSize, maxMsgLength uint64, + maxMsgLength uint64, memo string, clientUpdateThresholdTime time.Duration, flushInterval time.Duration, @@ -81,7 +84,6 @@ func StartRelayer( chainProcessors, ePaths, initialBlockHistory, - maxTxSize, maxMsgLength, memo, messageLifecycle, @@ -99,7 +101,7 @@ func StartRelayer( src, dst := chains[p.Src.ChainID], chains[p.Dst.ChainID] src.PathEnd = p.Src dst.PathEnd = p.Dst - go relayerStartLegacy(ctx, log, src, dst, p.Filter, maxTxSize, maxMsgLength, memo, errorChan) + go relayerStartLegacy(ctx, log, src, dst, p.Filter, TwoMB, maxMsgLength, memo, errorChan) return errorChan default: panic(fmt.Errorf("unexpected processor type: %s, supports one of: [%s, %s]", processorType, ProcessorEvents, ProcessorLegacy)) @@ -117,6 +119,8 @@ type path struct { func (chain *Chain) chainProcessor(log *zap.Logger, metrics *processor.PrometheusMetrics) processor.ChainProcessor { // Handle new ChainProcessor implementations as cases here switch p := chain.ChainProvider.(type) { + case *penumbraprocessor.PenumbraProvider: + return penumbraprocessor.NewPenumbraChainProcessor(log, p) case *cosmos.CosmosProvider: return cosmos.NewCosmosChainProcessor(log, p, metrics) case *icon.IconProvider: @@ -135,7 +139,6 @@ func relayerStartEventProcessor( chainProcessors []processor.ChainProcessor, paths []path, initialBlockHistory uint64, - maxTxSize, maxMsgLength uint64, memo string, messageLifecycle processor.MessageLifecycle, @@ -158,6 +161,7 @@ func relayerStartEventProcessor( memo, clientUpdateThresholdTime, flushInterval, + maxMsgLength, )) } diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index 856fb275f..725d881a7 100755 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -15,8 +15,13 @@ for dir in $proto_dirs; do done done +buf generate --template proto/buf.gen.penumbra.yaml buf.build/penumbra-zone/penumbra + # move proto files to the right places + # # Note: Proto files are suffixed with the current binary version. +rm -r github.com/cosmos/relayer/v2/relayer/chains/penumbra/client +rm -r github.com/cosmos/relayer/v2/relayer/chains/penumbra/narsil cp -r github.com/cosmos/relayer/v2/* ./ -rm -rf github.com \ No newline at end of file +rm -rf github.com diff --git a/third_party/proto/amino/amino.proto b/third_party/proto/amino/amino.proto deleted file mode 100644 index 05f965830..000000000 --- a/third_party/proto/amino/amino.proto +++ /dev/null @@ -1,80 +0,0 @@ -syntax = "proto3"; - -package amino; - -import "google/protobuf/descriptor.proto"; - -// TODO(fdymylja): once we fully migrate to protov2 the go_package needs to be -// updated. We need this right now because gogoproto codegen needs to import the -// extension. -option go_package = "github.com/cosmos/cosmos-sdk/types/tx/amino"; - -extend google.protobuf.MessageOptions { - // name is the string used when registering a concrete - // type into the Amino type registry, via the Amino codec's - // `RegisterConcrete()` method. This string MUST be at most 39 - // characters long, or else the message will be rejected by the - // Ledger hardware device. - string name = 11110001; - - // encoding describes the encoding format used by Amino for the given - // message. The field type is chosen to be a string for - // flexibility, but it should ideally be short and expected to be - // machine-readable, for example "base64" or "utf8_json". We - // highly recommend to use underscores for word separation instead of spaces. - // - // If left empty, then the Amino encoding is expected to be the same as the - // Protobuf one. - // - // This annotation should not be confused with the `encoding` - // one which operates on the field level. - string message_encoding = 11110002; -} - -extend google.protobuf.FieldOptions { - // encoding describes the encoding format used by Amino for - // the given field. The field type is chosen to be a string for - // flexibility, but it should ideally be short and expected to be - // machine-readable, for example "base64" or "utf8_json". We - // highly recommend to use underscores for word separation instead of spaces. - // - // If left empty, then the Amino encoding is expected to be the same as the - // Protobuf one. - // - // This annotation should not be confused with the - // `message_encoding` one which operates on the message level. - string encoding = 11110003; - - // field_name sets a different field name (i.e. key name) in - // the amino JSON object for the given field. - // - // Example: - // - // message Foo { - // string bar = 1 [(amino.field_name) = "baz"]; - // } - // - // Then the Amino encoding of Foo will be: - // `{"baz":"some value"}` - string field_name = 11110004; - - // dont_omitempty sets the field in the JSON object even if - // its value is empty, i.e. equal to the Golang zero value. To learn what - // the zero values are, see https://go.dev/ref/spec#The_zero_value. - // - // Fields default to `omitempty`, which is the default behavior when this - // annotation is unset. When set to true, then the field value in the - // JSON object will be set, i.e. not `undefined`. - // - // Example: - // - // message Foo { - // string bar = 1; - // string baz = 2 [(amino.dont_omitempty) = true]; - // } - // - // f := Foo{}; - // out := AminoJSONEncoder(&f); - // out == {"baz":""} - bool dont_omitempty = 11110005; -} \ No newline at end of file diff --git a/third_party/proto/buf.yaml b/third_party/proto/buf.yaml deleted file mode 100644 index e1693df81..000000000 --- a/third_party/proto/buf.yaml +++ /dev/null @@ -1,6 +0,0 @@ -version: v1 -lint: - ignore: - - cometbft - - gogoproto - - cosmos_proto \ No newline at end of file diff --git a/third_party/proto/cosmos/auth/v1beta1/auth.proto b/third_party/proto/cosmos/auth/v1beta1/auth.proto deleted file mode 100644 index 2b9ead613..000000000 --- a/third_party/proto/cosmos/auth/v1beta1/auth.proto +++ /dev/null @@ -1,23 +0,0 @@ -syntax = "proto3"; -package cosmos.auth.v1beta1; - -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; - -// BaseAccount defines a base account type. It contains all the necessary fields -// for basic account functionality. Any custom account type should extend this -// type for additional functionality (e.g. vesting). -message BaseAccount { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.equal) = false; - - string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - google.protobuf.Any pub_key = 2 - [ (gogoproto.jsontag) = "public_key,omitempty" ]; - uint64 account_number = 3; - uint64 sequence = 4; -} diff --git a/third_party/proto/cosmos_proto/cosmos.proto b/third_party/proto/cosmos_proto/cosmos.proto deleted file mode 100644 index 1524a4257..000000000 --- a/third_party/proto/cosmos_proto/cosmos.proto +++ /dev/null @@ -1,97 +0,0 @@ -syntax = "proto3"; -package cosmos_proto; - -import "google/protobuf/descriptor.proto"; - -option go_package = "github.com/cosmos/cosmos-proto;cosmos_proto"; - -extend google.protobuf.MessageOptions { - - // implements_interface is used to indicate the type name of the interface - // that a message implements so that it can be used in google.protobuf.Any - // fields that accept that interface. A message can implement multiple - // interfaces. Interfaces should be declared using a declare_interface - // file option. - repeated string implements_interface = 93001; -} - -extend google.protobuf.FieldOptions { - - // accepts_interface is used to annotate that a google.protobuf.Any - // field accepts messages that implement the specified interface. - // Interfaces should be declared using a declare_interface file option. - string accepts_interface = 93001; - - // scalar is used to indicate that this field follows the formatting defined - // by the named scalar which should be declared with declare_scalar. Code - // generators may choose to use this information to map this field to a - // language-specific type representing the scalar. - string scalar = 93002; -} - -extend google.protobuf.FileOptions { - - // declare_interface declares an interface type to be used with - // accepts_interface and implements_interface. Interface names are - // expected to follow the following convention such that their declaration - // can be discovered by tools: for a given interface type a.b.C, it is - // expected that the declaration will be found in a protobuf file named - // a/b/interfaces.proto in the file descriptor set. - repeated InterfaceDescriptor declare_interface = 793021; - - // declare_scalar declares a scalar type to be used with - // the scalar field option. Scalar names are - // expected to follow the following convention such that their declaration - // can be discovered by tools: for a given scalar type a.b.C, it is - // expected that the declaration will be found in a protobuf file named - // a/b/scalars.proto in the file descriptor set. - repeated ScalarDescriptor declare_scalar = 793022; -} - -// InterfaceDescriptor describes an interface type to be used with -// accepts_interface and implements_interface and declared by declare_interface. -message InterfaceDescriptor { - - // name is the name of the interface. It should be a short-name (without - // a period) such that the fully qualified name of the interface will be - // package.name, ex. for the package a.b and interface named C, the - // fully-qualified name will be a.b.C. - string name = 1; - - // description is a human-readable description of the interface and its - // purpose. - string description = 2; -} - -// ScalarDescriptor describes an scalar type to be used with -// the scalar field option and declared by declare_scalar. -// Scalars extend simple protobuf built-in types with additional -// syntax and semantics, for instance to represent big integers. -// Scalars should ideally define an encoding such that there is only one -// valid syntactical representation for a given semantic meaning, -// i.e. the encoding should be deterministic. -message ScalarDescriptor { - - // name is the name of the scalar. It should be a short-name (without - // a period) such that the fully qualified name of the scalar will be - // package.name, ex. for the package a.b and scalar named C, the - // fully-qualified name will be a.b.C. - string name = 1; - - // description is a human-readable description of the scalar and its - // encoding format. For instance a big integer or decimal scalar should - // specify precisely the expected encoding format. - string description = 2; - - // field_type is the type of field with which this scalar can be used. - // Scalars can be used with one and only one type of field so that - // encoding standards and simple and clear. Currently only string and - // bytes fields are supported for scalars. - repeated ScalarType field_type = 3; -} - -enum ScalarType { - SCALAR_TYPE_UNSPECIFIED = 0; - SCALAR_TYPE_STRING = 1; - SCALAR_TYPE_BYTES = 2; -} \ No newline at end of file diff --git a/third_party/proto/gogoproto/gogo.proto b/third_party/proto/gogoproto/gogo.proto deleted file mode 100644 index bf975466a..000000000 --- a/third_party/proto/gogoproto/gogo.proto +++ /dev/null @@ -1,145 +0,0 @@ -// Protocol Buffers for Go with Gadgets -// -// Copyright (c) 2013, The GoGo Authors. All rights reserved. -// http://github.com/gogo/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto2"; -package gogoproto; - -import "google/protobuf/descriptor.proto"; - -option java_package = "com.google.protobuf"; -option java_outer_classname = "GoGoProtos"; -option go_package = "github.com/gogo/protobuf/gogoproto"; - -extend google.protobuf.EnumOptions { - optional bool goproto_enum_prefix = 62001; - optional bool goproto_enum_stringer = 62021; - optional bool enum_stringer = 62022; - optional string enum_customname = 62023; - optional bool enumdecl = 62024; -} - -extend google.protobuf.EnumValueOptions { - optional string enumvalue_customname = 66001; -} - -extend google.protobuf.FileOptions { - optional bool goproto_getters_all = 63001; - optional bool goproto_enum_prefix_all = 63002; - optional bool goproto_stringer_all = 63003; - optional bool verbose_equal_all = 63004; - optional bool face_all = 63005; - optional bool gostring_all = 63006; - optional bool populate_all = 63007; - optional bool stringer_all = 63008; - optional bool onlyone_all = 63009; - - optional bool equal_all = 63013; - optional bool description_all = 63014; - optional bool testgen_all = 63015; - optional bool benchgen_all = 63016; - optional bool marshaler_all = 63017; - optional bool unmarshaler_all = 63018; - optional bool stable_marshaler_all = 63019; - - optional bool sizer_all = 63020; - - optional bool goproto_enum_stringer_all = 63021; - optional bool enum_stringer_all = 63022; - - optional bool unsafe_marshaler_all = 63023; - optional bool unsafe_unmarshaler_all = 63024; - - optional bool goproto_extensions_map_all = 63025; - optional bool goproto_unrecognized_all = 63026; - optional bool gogoproto_import = 63027; - optional bool protosizer_all = 63028; - optional bool compare_all = 63029; - optional bool typedecl_all = 63030; - optional bool enumdecl_all = 63031; - - optional bool goproto_registration = 63032; - optional bool messagename_all = 63033; - - optional bool goproto_sizecache_all = 63034; - optional bool goproto_unkeyed_all = 63035; -} - -extend google.protobuf.MessageOptions { - optional bool goproto_getters = 64001; - optional bool goproto_stringer = 64003; - optional bool verbose_equal = 64004; - optional bool face = 64005; - optional bool gostring = 64006; - optional bool populate = 64007; - optional bool stringer = 67008; - optional bool onlyone = 64009; - - optional bool equal = 64013; - optional bool description = 64014; - optional bool testgen = 64015; - optional bool benchgen = 64016; - optional bool marshaler = 64017; - optional bool unmarshaler = 64018; - optional bool stable_marshaler = 64019; - - optional bool sizer = 64020; - - optional bool unsafe_marshaler = 64023; - optional bool unsafe_unmarshaler = 64024; - - optional bool goproto_extensions_map = 64025; - optional bool goproto_unrecognized = 64026; - - optional bool protosizer = 64028; - optional bool compare = 64029; - - optional bool typedecl = 64030; - - optional bool messagename = 64033; - - optional bool goproto_sizecache = 64034; - optional bool goproto_unkeyed = 64035; -} - -extend google.protobuf.FieldOptions { - optional bool nullable = 65001; - optional bool embed = 65002; - optional string customtype = 65003; - optional string customname = 65004; - optional string jsontag = 65005; - optional string moretags = 65006; - optional string casttype = 65007; - optional string castkey = 65008; - optional string castvalue = 65009; - - optional bool stdtime = 65010; - optional bool stdduration = 65011; - optional bool wktpointer = 65012; - - optional string castrepeated = 65013; -} \ No newline at end of file diff --git a/third_party/proto/tendermint/crypto/proof.proto b/third_party/proto/tendermint/crypto/proof.proto deleted file mode 100644 index ad4145f3d..000000000 --- a/third_party/proto/tendermint/crypto/proof.proto +++ /dev/null @@ -1,41 +0,0 @@ -syntax = "proto3"; - -// buf:lint:ignore PACKAGE_VERSION_SUFFIX -package tendermint.crypto; - -option go_package = "github.com/cometbft/cometbft/proto/tendermint/crypto"; - -import "gogoproto/gogo.proto"; - -message Proof { - int64 total = 1; - int64 index = 2; - bytes leaf_hash = 3; - repeated bytes aunts = 4; -} - -message ValueOp { - // Encoded in ProofOp.Key. - bytes key = 1; - - // To encode in ProofOp.Data - Proof proof = 2; -} - -message DominoOp { - string key = 1; - string input = 2; - string output = 3; -} - -// ProofOp defines an operation used for calculating Merkle root -// The data could be arbitrary format, providing nessecary data -// for example neighbouring node hash -message ProofOp { - string type = 1; - bytes key = 2; - bytes data = 3; -} - -// ProofOps is Merkle proof defined by the list of ProofOps -message ProofOps { repeated ProofOp ops = 1 [ (gogoproto.nullable) = false ]; } \ No newline at end of file