file_name
stringlengths 3
137
| prefix
stringlengths 0
918k
| suffix
stringlengths 0
962k
| middle
stringlengths 0
812k
|
---|---|---|---|
editorconfig.ts
|
import * as path from 'path';
import { BaseCommand, Flags } from '@straw-hat/cli-core/dist/base-command';
import { render } from '@straw-hat/cli-core/dist/template';
import { getCwd } from '@straw-hat/cli-core/dist/helpers';
const templatePath = path.join(
__dirname,
'..',
'..',
'..',
'templates',
'commands',
'editorconfig',
'.editorconfig.ejs'
);
function resolveFileLocation(context: string) {
return path.join(context, '.editorconfig');
}
export class
|
extends BaseCommand {
static override description = 'generates the .editorconfig file';
static override flags = {
context: Flags.string({
description: 'directory where the .editorconfig file will be created. Defaults to current working directory',
}),
};
async run() {
const { flags } = await this.parse(EditorConfigCommand);
const context = flags.context ?? getCwd();
const destPath = resolveFileLocation(context);
await render({ fromPath: templatePath, destPath });
}
}
|
EditorConfigCommand
|
main.go
|
package main
import (
"fmt"
"os"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/cobra/doc"
"github.com/flanksource/karina/cmd"
)
var (
version = "dev"
commit = "none"
date = "unknown"
)
func
|
() {
var root = &cobra.Command{
Use: "karina",
PersistentPreRun: cmd.GlobalPreRun,
}
root.AddCommand(
cmd.Access,
cmd.APIDocs,
cmd.Apply,
cmd.Backup,
cmd.CA,
cmd.Cleanup,
cmd.CleanupJobs,
cmd.Config,
cmd.Conformance,
cmd.Consul,
cmd.Dashboard,
cmd.DB,
cmd.Deploy,
cmd.DNS,
cmd.Exec,
cmd.ExecNode,
cmd.Etcd,
cmd.Harbor,
cmd.Images,
cmd.Logs,
cmd.MachineImages,
cmd.Namespace,
cmd.Node,
cmd.NSX,
cmd.Operator,
cmd.Orphan,
cmd.Provision,
cmd.Render,
cmd.Report,
cmd.Rolling,
cmd.Snapshot,
cmd.Status,
cmd.Test,
cmd.TerminateNodes,
cmd.TerminateOrphans,
cmd.Undelete,
cmd.Upgrade,
cmd.Vault,
)
if len(commit) > 8 {
version = fmt.Sprintf("%v, commit %v, built at %v", version, commit[0:8], date)
}
root.AddCommand(&cobra.Command{
Use: "version",
Short: "Print the version of karina",
Args: cobra.MinimumNArgs(0),
Run: func(cmd *cobra.Command, args []string) {
fmt.Println(version)
},
})
docs := &cobra.Command{
Use: "docs",
Short: "generate documentation",
}
docs.AddCommand(&cobra.Command{
Use: "cli [PATH]",
Short: "generate CLI documentation",
Args: cobra.MinimumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
err := doc.GenMarkdownTree(root, args[0])
if err != nil {
log.Fatal(err)
}
},
})
docs.AddCommand(cmd.APIDocs)
root.AddCommand(docs)
config := "karina.yml"
if env := os.Getenv("PLATFORM_CONFIG"); env != "" {
config = env
}
root.PersistentFlags().StringArrayP("config", "c", []string{config}, "Path to config file")
root.PersistentFlags().StringArrayP("extra", "e", nil, "Extra arguments to apply e.g. -e ldap.domain=example.com")
root.PersistentFlags().StringP("kubeconfig", "", "", "Specify a kubeconfig to use, if empty a new kubeconfig is generated from master CA's at runtime")
root.PersistentFlags().CountP("loglevel", "v", "Increase logging level")
root.PersistentFlags().Bool("prune", true, "Delete previously enabled resources")
root.PersistentFlags().Bool("dry-run", false, "Don't apply any changes, print what would have been done")
root.PersistentFlags().Bool("trace", false, "Print out generated specs and configs")
root.PersistentFlags().Bool("in-cluster", false, "Use in cluster kubernetes config")
root.SetUsageTemplate(root.UsageTemplate() + fmt.Sprintf("\nversion: %s\n ", version))
if err := root.Execute(); err != nil {
os.Exit(1)
}
}
|
main
|
test_exceptions.py
|
import os
from prequ._pip_compat import (
create_package_finder, install_req_from_editable, install_req_from_line)
from prequ.exceptions import (
IncompatibleRequirements, NoCandidateFound, UnsupportedConstraint)
from .dirs import FAKE_PYPI_WHEELS_DIR
from .test_repositories import get_pypi_repository
try:
from pip.index import InstallationCandidate
except ImportError:
from pip._internal.index import InstallationCandidate
def get_finder():
repo = get_pypi_repository()
finder = create_package_finder(
find_links=[],
index_urls=['pypi.localhost'],
allow_all_prereleases=False,
session=repo.session)
return finder
def test_no_candidate_found_with_versions():
ireq = install_req_from_line('some-package==12.3.4')
tried = [
InstallationCandidate('some-package', ver, None)
for ver in ['1.2.3', '12.3.0', '12.3.5']]
no_candidate_found = NoCandidateFound(ireq, tried, get_finder())
assert '{}'.format(no_candidate_found) == (
"Could not find a version that matches some-package==12.3.4\n"
"Tried: 1.2.3, 12.3.0, 12.3.5\n"
"There are incompatible versions in the resolved dependencies.")
def test_no_candidate_found_no_versions():
ireq = install_req_from_line('some-package==12.3.4')
tried = []
no_candidate_found = NoCandidateFound(ireq, tried, get_finder())
assert '{}'.format(no_candidate_found) == (
"Could not find a version that matches some-package==12.3.4\n"
"No versions found\n"
"Was pypi.localhost reachable?")
def test_unsupported_constraint_simple():
msg = "Foo bar distribution is not supported"
ireq = install_req_from_line('foo-bar')
unsupported_constraint = UnsupportedConstraint(msg, ireq)
assert '{}'.format(unsupported_constraint) == (
"Foo bar distribution is not supported (constraint was: foo-bar)")
def test_unsupported_constraint_editable_wheel():
wheel_path = os.path.join(
FAKE_PYPI_WHEELS_DIR, 'small_fake_a-0.1-py2.py3-none-any.whl')
msg = "Editable wheel is too square"
ireq_wheel = install_req_from_line(wheel_path)
ireq = install_req_from_editable(str(ireq_wheel.link))
unsupported_constraint = UnsupportedConstraint(msg, ireq)
assert '{}'.format(unsupported_constraint) == (
|
"Editable wheel is too square (constraint was: {})".format(ireq))
def test_incompatible_requirements():
ireq_a = install_req_from_line('dummy==1.5')
ireq_b = install_req_from_line('dummy==2.6')
incompatible_reqs = IncompatibleRequirements(ireq_a, ireq_b)
assert '{}'.format(incompatible_reqs) == (
"Incompatible requirements found: dummy==1.5 and dummy==2.6")
| |
mostWanted.js
|
"use strict";
/**
* You are given a text, which contains different english letters and punctuation symbols.
* You should find the most frequent letter in the text.
* The letter returned must be in lower case.
*
* While checking for the most wanted letter, casing does not matter,
* so for the purpose of your search, "A" == "a".
* Make sure you do not count punctuation symbols, digits and whitespaces, only letters.
*
* If you have two or more letters with the same frequency,
* then return the letter which comes first in the latin alphabet.
* For example -- "one" contains "o", "n", "e" only once for each, thus we choose "e".
*
* Input: A text for analysis as a string.
* Output: The most frequent letter in lower case as a string.
*
* Example:
* mostWanted("Hello World!") == "l"
* mostWanted("How do you do?") == "o"
* mostWanted("One") == "e"
* mostWanted("Oops!") == "o"
* mostWanted("AAaooo!!!!") == "a"
* mostWanted("abe") == "a"
*/
const mostWanted = (data) => {
let countMap = {};
for (let i = 0, length = data.length; i < length; i++) {
const word = data[i].toLowerCase();
if (word.match(/^([a-z]+)$/)) {
if (countMap[word]) {
countMap[word] = countMap[word] + 1;
} else {
countMap[word] = 1;
}
}
}
return getBiggestKey(countMap);
}
const getBiggestKey = (targetMap) => {
let biggestKeys = [];
let biggestValue = 0;
|
if (value === biggestValue) {
biggestKeys.push(key);
} else {
biggestKeys = [key];
}
biggestValue = value;
}
}
if (biggestKeys.length > 1) {
return biggestKeys.sort()[0];
}
return biggestKeys[0];
}
var assert = require('assert');
if (!global.is_checking) {
assert.equal(mostWanted("Hello World!"), "l", "1st example");
assert.equal(mostWanted("How do you do?"), "o", "2nd example");
assert.equal(mostWanted("One"), "e", "3rd example");
assert.equal(mostWanted("Oops!"), "o", "4th example");
assert.equal(mostWanted("AAaooo!!!!"), "a", "Letters");
console.log("Coding complete? Click 'Check' to review your tests and earn cool rewards!");
}
|
for (let key in targetMap) {
const value = targetMap[key];
if (value >= biggestValue) {
|
test_imports.py
|
# Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
def test_imports():
# flake8: noqa
from sparseml.onnx import (
check_onnx_install,
check_onnxruntime_install,
detect_framework,
framework_info,
is_supported,
onnx,
onnx_err,
onnxruntime,
onnxruntime_err,
require_onnx,
require_onnxruntime,
sparsification_info,
|
)
|
|
config.go
|
// Copyright 2015 The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package config
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/url"
"path/filepath"
"regexp"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws/ec2metadata"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/prometheus/common/model"
"gopkg.in/yaml.v2"
)
var (
patFileSDName = regexp.MustCompile(`^[^*]*(\*[^/]*)?\.(json|yml|yaml|JSON|YML|YAML)$`)
patRulePath = regexp.MustCompile(`^[^*]*(\*[^/]*)?$`)
relabelTarget = regexp.MustCompile(`^(?:(?:[a-zA-Z_]|\$(?:\{\w+\}|\w+))+\w*)+$`)
)
// Load parses the YAML input s into a Config.
func Load(s string) (*Config, error) {
cfg := &Config{}
// If the entire config body is empty the UnmarshalYAML method is
// never called. We thus have to set the DefaultConfig at the entry
// point as well.
*cfg = DefaultConfig
err := yaml.Unmarshal([]byte(s), cfg)
if err != nil {
return nil, err
}
cfg.original = s
return cfg, nil
}
// LoadFile parses the given YAML file into a Config.
func LoadFile(filename string) (*Config, error)
|
// The defaults applied before parsing the respective config sections.
var (
// DefaultConfig is the default top-level configuration.
DefaultConfig = Config{
GlobalConfig: DefaultGlobalConfig,
}
// DefaultGlobalConfig is the default global configuration.
DefaultGlobalConfig = GlobalConfig{
ScrapeInterval: model.Duration(1 * time.Minute),
ScrapeTimeout: model.Duration(10 * time.Second),
EvaluationInterval: model.Duration(1 * time.Minute),
}
// DefaultScrapeConfig is the default scrape configuration.
DefaultScrapeConfig = ScrapeConfig{
// ScrapeTimeout and ScrapeInterval default to the
// configured globals.
MetricsPath: "/metrics",
Scheme: "http",
HonorLabels: false,
}
// DefaultAlertmanagerConfig is the default alertmanager configuration.
DefaultAlertmanagerConfig = AlertmanagerConfig{
Scheme: "http",
Timeout: 10 * time.Second,
}
// DefaultRelabelConfig is the default Relabel configuration.
DefaultRelabelConfig = RelabelConfig{
Action: RelabelReplace,
Separator: ";",
Regex: MustNewRegexp("(.*)"),
Replacement: "$1",
}
// DefaultDNSSDConfig is the default DNS SD configuration.
DefaultDNSSDConfig = DNSSDConfig{
RefreshInterval: model.Duration(30 * time.Second),
Type: "SRV",
}
// DefaultFileSDConfig is the default file SD configuration.
DefaultFileSDConfig = FileSDConfig{
RefreshInterval: model.Duration(5 * time.Minute),
}
// DefaultConsulSDConfig is the default Consul SD configuration.
DefaultConsulSDConfig = ConsulSDConfig{
TagSeparator: ",",
Scheme: "http",
}
// DefaultServersetSDConfig is the default Serverset SD configuration.
DefaultServersetSDConfig = ServersetSDConfig{
Timeout: model.Duration(10 * time.Second),
}
// DefaultNerveSDConfig is the default Nerve SD configuration.
DefaultNerveSDConfig = NerveSDConfig{
Timeout: model.Duration(10 * time.Second),
}
// DefaultMarathonSDConfig is the default Marathon SD configuration.
DefaultMarathonSDConfig = MarathonSDConfig{
Timeout: model.Duration(30 * time.Second),
RefreshInterval: model.Duration(30 * time.Second),
}
// DefaultKubernetesSDConfig is the default Kubernetes SD configuration
DefaultKubernetesSDConfig = KubernetesSDConfig{}
// DefaultGCESDConfig is the default EC2 SD configuration.
DefaultGCESDConfig = GCESDConfig{
Port: 80,
TagSeparator: ",",
RefreshInterval: model.Duration(60 * time.Second),
}
// DefaultEC2SDConfig is the default EC2 SD configuration.
DefaultEC2SDConfig = EC2SDConfig{
Port: 80,
RefreshInterval: model.Duration(60 * time.Second),
}
// DefaultOpenstackSDConfig is the default OpenStack SD configuration.
DefaultOpenstackSDConfig = OpenstackSDConfig{
Port: 80,
RefreshInterval: model.Duration(60 * time.Second),
}
// DefaultAzureSDConfig is the default Azure SD configuration.
DefaultAzureSDConfig = AzureSDConfig{
Port: 80,
RefreshInterval: model.Duration(5 * time.Minute),
}
// DefaultTritonSDConfig is the default Triton SD configuration.
DefaultTritonSDConfig = TritonSDConfig{
Port: 9163,
RefreshInterval: model.Duration(60 * time.Second),
Version: 1,
}
// DefaultRemoteWriteConfig is the default remote write configuration.
DefaultRemoteWriteConfig = RemoteWriteConfig{
RemoteTimeout: model.Duration(30 * time.Second),
QueueConfig: DefaultQueueConfig,
}
// DefaultQueueConfig is the default remote queue configuration.
DefaultQueueConfig = QueueConfig{
// With a maximum of 1000 shards, assuming an average of 100ms remote write
// time and 100 samples per batch, we will be able to push 1M samples/s.
MaxShards: 1000,
MaxSamplesPerSend: 100,
// By default, buffer 1000 batches, which at 100ms per batch is 1:40mins. At
// 1000 shards, this will buffer 100M samples total.
Capacity: 100 * 1000,
BatchSendDeadline: 5 * time.Second,
// Max number of times to retry a batch on recoverable errors.
MaxRetries: 10,
MinBackoff: 30 * time.Millisecond,
MaxBackoff: 100 * time.Millisecond,
}
// DefaultRemoteReadConfig is the default remote read configuration.
DefaultRemoteReadConfig = RemoteReadConfig{
RemoteTimeout: model.Duration(1 * time.Minute),
}
)
// URL is a custom URL type that allows validation at configuration load time.
type URL struct {
*url.URL
}
// UnmarshalYAML implements the yaml.Unmarshaler interface for URLs.
func (u *URL) UnmarshalYAML(unmarshal func(interface{}) error) error {
var s string
if err := unmarshal(&s); err != nil {
return err
}
urlp, err := url.Parse(s)
if err != nil {
return err
}
u.URL = urlp
return nil
}
// MarshalYAML implements the yaml.Marshaler interface for URLs.
func (u URL) MarshalYAML() (interface{}, error) {
if u.URL != nil {
return u.String(), nil
}
return nil, nil
}
// Config is the top-level configuration for Prometheus's config files.
type Config struct {
GlobalConfig GlobalConfig `yaml:"global"`
AlertingConfig AlertingConfig `yaml:"alerting,omitempty"`
RuleFiles []string `yaml:"rule_files,omitempty"`
ScrapeConfigs []*ScrapeConfig `yaml:"scrape_configs,omitempty"`
RemoteWriteConfigs []*RemoteWriteConfig `yaml:"remote_write,omitempty"`
RemoteReadConfigs []*RemoteReadConfig `yaml:"remote_read,omitempty"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
// original is the input from which the config was parsed.
original string
}
// Secret special type for storing secrets.
type Secret string
// UnmarshalYAML implements the yaml.Unmarshaler interface for Secrets.
func (s *Secret) UnmarshalYAML(unmarshal func(interface{}) error) error {
type plain Secret
return unmarshal((*plain)(s))
}
// MarshalYAML implements the yaml.Marshaler interface for Secrets.
func (s Secret) MarshalYAML() (interface{}, error) {
if s != "" {
return "<secret>", nil
}
return nil, nil
}
// resolveFilepaths joins all relative paths in a configuration
// with a given base directory.
func resolveFilepaths(baseDir string, cfg *Config) {
join := func(fp string) string {
if len(fp) > 0 && !filepath.IsAbs(fp) {
fp = filepath.Join(baseDir, fp)
}
return fp
}
for i, rf := range cfg.RuleFiles {
cfg.RuleFiles[i] = join(rf)
}
clientPaths := func(scfg *HTTPClientConfig) {
scfg.BearerTokenFile = join(scfg.BearerTokenFile)
scfg.TLSConfig.CAFile = join(scfg.TLSConfig.CAFile)
scfg.TLSConfig.CertFile = join(scfg.TLSConfig.CertFile)
scfg.TLSConfig.KeyFile = join(scfg.TLSConfig.KeyFile)
}
sdPaths := func(cfg *ServiceDiscoveryConfig) {
for _, kcfg := range cfg.KubernetesSDConfigs {
kcfg.BearerTokenFile = join(kcfg.BearerTokenFile)
kcfg.TLSConfig.CAFile = join(kcfg.TLSConfig.CAFile)
kcfg.TLSConfig.CertFile = join(kcfg.TLSConfig.CertFile)
kcfg.TLSConfig.KeyFile = join(kcfg.TLSConfig.KeyFile)
}
for _, mcfg := range cfg.MarathonSDConfigs {
mcfg.BearerTokenFile = join(mcfg.BearerTokenFile)
mcfg.TLSConfig.CAFile = join(mcfg.TLSConfig.CAFile)
mcfg.TLSConfig.CertFile = join(mcfg.TLSConfig.CertFile)
mcfg.TLSConfig.KeyFile = join(mcfg.TLSConfig.KeyFile)
}
for _, consulcfg := range cfg.ConsulSDConfigs {
consulcfg.TLSConfig.CAFile = join(consulcfg.TLSConfig.CAFile)
consulcfg.TLSConfig.CertFile = join(consulcfg.TLSConfig.CertFile)
consulcfg.TLSConfig.KeyFile = join(consulcfg.TLSConfig.KeyFile)
}
}
for _, cfg := range cfg.ScrapeConfigs {
clientPaths(&cfg.HTTPClientConfig)
sdPaths(&cfg.ServiceDiscoveryConfig)
}
for _, cfg := range cfg.AlertingConfig.AlertmanagerConfigs {
clientPaths(&cfg.HTTPClientConfig)
sdPaths(&cfg.ServiceDiscoveryConfig)
}
}
func checkOverflow(m map[string]interface{}, ctx string) error {
if len(m) > 0 {
var keys []string
for k := range m {
keys = append(keys, k)
}
return fmt.Errorf("unknown fields in %s: %s", ctx, strings.Join(keys, ", "))
}
return nil
}
func (c Config) String() string {
b, err := yaml.Marshal(c)
if err != nil {
return fmt.Sprintf("<error creating config string: %s>", err)
}
return string(b)
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error {
*c = DefaultConfig
// We want to set c to the defaults and then overwrite it with the input.
// To make unmarshal fill the plain data struct rather than calling UnmarshalYAML
// again, we have to hide it using a type indirection.
type plain Config
if err := unmarshal((*plain)(c)); err != nil {
return err
}
if err := checkOverflow(c.XXX, "config"); err != nil {
return err
}
// If a global block was open but empty the default global config is overwritten.
// We have to restore it here.
if c.GlobalConfig.isZero() {
c.GlobalConfig = DefaultGlobalConfig
}
for _, rf := range c.RuleFiles {
if !patRulePath.MatchString(rf) {
return fmt.Errorf("invalid rule file path %q", rf)
}
}
// Do global overrides and validate unique names.
jobNames := map[string]struct{}{}
for _, scfg := range c.ScrapeConfigs {
// First set the correct scrape interval, then check that the timeout
// (inferred or explicit) is not greater than that.
if scfg.ScrapeInterval == 0 {
scfg.ScrapeInterval = c.GlobalConfig.ScrapeInterval
}
if scfg.ScrapeTimeout > scfg.ScrapeInterval {
return fmt.Errorf("scrape timeout greater than scrape interval for scrape config with job name %q", scfg.JobName)
}
if scfg.ScrapeTimeout == 0 {
if c.GlobalConfig.ScrapeTimeout > scfg.ScrapeInterval {
scfg.ScrapeTimeout = scfg.ScrapeInterval
} else {
scfg.ScrapeTimeout = c.GlobalConfig.ScrapeTimeout
}
}
if _, ok := jobNames[scfg.JobName]; ok {
return fmt.Errorf("found multiple scrape configs with job name %q", scfg.JobName)
}
jobNames[scfg.JobName] = struct{}{}
}
return nil
}
// GlobalConfig configures values that are used across other configuration
// objects.
type GlobalConfig struct {
// How frequently to scrape targets by default.
ScrapeInterval model.Duration `yaml:"scrape_interval,omitempty"`
// The default timeout when scraping targets.
ScrapeTimeout model.Duration `yaml:"scrape_timeout,omitempty"`
// How frequently to evaluate rules by default.
EvaluationInterval model.Duration `yaml:"evaluation_interval,omitempty"`
// The labels to add to any timeseries that this Prometheus instance scrapes.
ExternalLabels model.LabelSet `yaml:"external_labels,omitempty"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *GlobalConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
// Create a clean global config as the previous one was already populated
// by the default due to the YAML parser behavior for empty blocks.
gc := &GlobalConfig{}
type plain GlobalConfig
if err := unmarshal((*plain)(gc)); err != nil {
return err
}
if err := checkOverflow(gc.XXX, "global config"); err != nil {
return err
}
// First set the correct scrape interval, then check that the timeout
// (inferred or explicit) is not greater than that.
if gc.ScrapeInterval == 0 {
gc.ScrapeInterval = DefaultGlobalConfig.ScrapeInterval
}
if gc.ScrapeTimeout > gc.ScrapeInterval {
return fmt.Errorf("global scrape timeout greater than scrape interval")
}
if gc.ScrapeTimeout == 0 {
if DefaultGlobalConfig.ScrapeTimeout > gc.ScrapeInterval {
gc.ScrapeTimeout = gc.ScrapeInterval
} else {
gc.ScrapeTimeout = DefaultGlobalConfig.ScrapeTimeout
}
}
if gc.EvaluationInterval == 0 {
gc.EvaluationInterval = DefaultGlobalConfig.EvaluationInterval
}
*c = *gc
return nil
}
// isZero returns true iff the global config is the zero value.
func (c *GlobalConfig) isZero() bool {
return c.ExternalLabels == nil &&
c.ScrapeInterval == 0 &&
c.ScrapeTimeout == 0 &&
c.EvaluationInterval == 0
}
// TLSConfig configures the options for TLS connections.
type TLSConfig struct {
// The CA cert to use for the targets.
CAFile string `yaml:"ca_file,omitempty"`
// The client cert file for the targets.
CertFile string `yaml:"cert_file,omitempty"`
// The client key file for the targets.
KeyFile string `yaml:"key_file,omitempty"`
// Used to verify the hostname for the targets.
ServerName string `yaml:"server_name,omitempty"`
// Disable target certificate validation.
InsecureSkipVerify bool `yaml:"insecure_skip_verify"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *TLSConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
type plain TLSConfig
if err := unmarshal((*plain)(c)); err != nil {
return err
}
if err := checkOverflow(c.XXX, "TLS config"); err != nil {
return err
}
return nil
}
// ServiceDiscoveryConfig configures lists of different service discovery mechanisms.
type ServiceDiscoveryConfig struct {
// List of labeled target groups for this job.
StaticConfigs []*TargetGroup `yaml:"static_configs,omitempty"`
// List of DNS service discovery configurations.
DNSSDConfigs []*DNSSDConfig `yaml:"dns_sd_configs,omitempty"`
// List of file service discovery configurations.
FileSDConfigs []*FileSDConfig `yaml:"file_sd_configs,omitempty"`
// List of Consul service discovery configurations.
ConsulSDConfigs []*ConsulSDConfig `yaml:"consul_sd_configs,omitempty"`
// List of Serverset service discovery configurations.
ServersetSDConfigs []*ServersetSDConfig `yaml:"serverset_sd_configs,omitempty"`
// NerveSDConfigs is a list of Nerve service discovery configurations.
NerveSDConfigs []*NerveSDConfig `yaml:"nerve_sd_configs,omitempty"`
// MarathonSDConfigs is a list of Marathon service discovery configurations.
MarathonSDConfigs []*MarathonSDConfig `yaml:"marathon_sd_configs,omitempty"`
// List of Kubernetes service discovery configurations.
KubernetesSDConfigs []*KubernetesSDConfig `yaml:"kubernetes_sd_configs,omitempty"`
// List of GCE service discovery configurations.
GCESDConfigs []*GCESDConfig `yaml:"gce_sd_configs,omitempty"`
// List of EC2 service discovery configurations.
EC2SDConfigs []*EC2SDConfig `yaml:"ec2_sd_configs,omitempty"`
// List of OpenStack service discovery configurations.
OpenstackSDConfigs []*OpenstackSDConfig `yaml:"openstack_sd_configs,omitempty"`
// List of Azure service discovery configurations.
AzureSDConfigs []*AzureSDConfig `yaml:"azure_sd_configs,omitempty"`
// List of Triton service discovery configurations.
TritonSDConfigs []*TritonSDConfig `yaml:"triton_sd_configs,omitempty"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *ServiceDiscoveryConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
type plain ServiceDiscoveryConfig
if err := unmarshal((*plain)(c)); err != nil {
return err
}
if err := checkOverflow(c.XXX, "service discovery config"); err != nil {
return err
}
return nil
}
// HTTPClientConfig configures an HTTP client.
type HTTPClientConfig struct {
// The HTTP basic authentication credentials for the targets.
BasicAuth *BasicAuth `yaml:"basic_auth,omitempty"`
// The bearer token for the targets.
BearerToken Secret `yaml:"bearer_token,omitempty"`
// The bearer token file for the targets.
BearerTokenFile string `yaml:"bearer_token_file,omitempty"`
// HTTP proxy server to use to connect to the targets.
ProxyURL URL `yaml:"proxy_url,omitempty"`
// TLSConfig to use to connect to the targets.
TLSConfig TLSConfig `yaml:"tls_config,omitempty"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
func (c *HTTPClientConfig) validate() error {
if len(c.BearerToken) > 0 && len(c.BearerTokenFile) > 0 {
return fmt.Errorf("at most one of bearer_token & bearer_token_file must be configured")
}
if c.BasicAuth != nil && (len(c.BearerToken) > 0 || len(c.BearerTokenFile) > 0) {
return fmt.Errorf("at most one of basic_auth, bearer_token & bearer_token_file must be configured")
}
return nil
}
// ScrapeConfig configures a scraping unit for Prometheus.
type ScrapeConfig struct {
// The job name to which the job label is set by default.
JobName string `yaml:"job_name"`
// Indicator whether the scraped metrics should remain unmodified.
HonorLabels bool `yaml:"honor_labels,omitempty"`
// A set of query parameters with which the target is scraped.
Params url.Values `yaml:"params,omitempty"`
// How frequently to scrape the targets of this scrape config.
ScrapeInterval model.Duration `yaml:"scrape_interval,omitempty"`
// The timeout for scraping targets of this config.
ScrapeTimeout model.Duration `yaml:"scrape_timeout,omitempty"`
// The HTTP resource path on which to fetch metrics from targets.
MetricsPath string `yaml:"metrics_path,omitempty"`
// The URL scheme with which to fetch metrics from targets.
Scheme string `yaml:"scheme,omitempty"`
// More than this many samples post metric-relabelling will cause the scrape to fail.
SampleLimit uint `yaml:"sample_limit,omitempty"`
// We cannot do proper Go type embedding below as the parser will then parse
// values arbitrarily into the overflow maps of further-down types.
ServiceDiscoveryConfig ServiceDiscoveryConfig `yaml:",inline"`
HTTPClientConfig HTTPClientConfig `yaml:",inline"`
// List of target relabel configurations.
RelabelConfigs []*RelabelConfig `yaml:"relabel_configs,omitempty"`
// List of metric relabel configurations.
MetricRelabelConfigs []*RelabelConfig `yaml:"metric_relabel_configs,omitempty"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *ScrapeConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
*c = DefaultScrapeConfig
type plain ScrapeConfig
err := unmarshal((*plain)(c))
if err != nil {
return err
}
if err = checkOverflow(c.XXX, "scrape_config"); err != nil {
return err
}
if len(c.JobName) == 0 {
return fmt.Errorf("job_name is empty")
}
// The UnmarshalYAML method of HTTPClientConfig is not being called because it's not a pointer.
// We cannot make it a pointer as the parser panics for inlined pointer structs.
// Thus we just do its validation here.
if err = c.HTTPClientConfig.validate(); err != nil {
return err
}
// Check for users putting URLs in target groups.
if len(c.RelabelConfigs) == 0 {
for _, tg := range c.ServiceDiscoveryConfig.StaticConfigs {
for _, t := range tg.Targets {
if err = CheckTargetAddress(t[model.AddressLabel]); err != nil {
return err
}
}
}
}
return nil
}
// AlertingConfig configures alerting and alertmanager related configs.
type AlertingConfig struct {
AlertRelabelConfigs []*RelabelConfig `yaml:"alert_relabel_configs,omitempty"`
AlertmanagerConfigs []*AlertmanagerConfig `yaml:"alertmanagers,omitempty"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *AlertingConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
// Create a clean global config as the previous one was already populated
// by the default due to the YAML parser behavior for empty blocks.
*c = AlertingConfig{}
type plain AlertingConfig
if err := unmarshal((*plain)(c)); err != nil {
return err
}
if err := checkOverflow(c.XXX, "alerting config"); err != nil {
return err
}
return nil
}
// AlertmanagerConfig configures how Alertmanagers can be discovered and communicated with.
type AlertmanagerConfig struct {
// We cannot do proper Go type embedding below as the parser will then parse
// values arbitrarily into the overflow maps of further-down types.
ServiceDiscoveryConfig ServiceDiscoveryConfig `yaml:",inline"`
HTTPClientConfig HTTPClientConfig `yaml:",inline"`
// The URL scheme to use when talking to Alertmanagers.
Scheme string `yaml:"scheme,omitempty"`
// Path prefix to add in front of the push endpoint path.
PathPrefix string `yaml:"path_prefix,omitempty"`
// The timeout used when sending alerts.
Timeout time.Duration `yaml:"timeout,omitempty"`
// List of Alertmanager relabel configurations.
RelabelConfigs []*RelabelConfig `yaml:"relabel_configs,omitempty"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *AlertmanagerConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
*c = DefaultAlertmanagerConfig
type plain AlertmanagerConfig
if err := unmarshal((*plain)(c)); err != nil {
return err
}
if err := checkOverflow(c.XXX, "alertmanager config"); err != nil {
return err
}
// The UnmarshalYAML method of HTTPClientConfig is not being called because it's not a pointer.
// We cannot make it a pointer as the parser panics for inlined pointer structs.
// Thus we just do its validation here.
if err := c.HTTPClientConfig.validate(); err != nil {
return err
}
// Check for users putting URLs in target groups.
if len(c.RelabelConfigs) == 0 {
for _, tg := range c.ServiceDiscoveryConfig.StaticConfigs {
for _, t := range tg.Targets {
if err := CheckTargetAddress(t[model.AddressLabel]); err != nil {
return err
}
}
}
}
return nil
}
// CheckTargetAddress checks if target address is valid.
func CheckTargetAddress(address model.LabelValue) error {
// For now check for a URL, we may want to expand this later.
if strings.Contains(string(address), "/") {
return fmt.Errorf("%q is not a valid hostname", address)
}
return nil
}
// BasicAuth contains basic HTTP authentication credentials.
type BasicAuth struct {
Username string `yaml:"username"`
Password Secret `yaml:"password"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
// ClientCert contains client cert credentials.
type ClientCert struct {
Cert string `yaml:"cert"`
Key Secret `yaml:"key"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (a *BasicAuth) UnmarshalYAML(unmarshal func(interface{}) error) error {
type plain BasicAuth
err := unmarshal((*plain)(a))
if err != nil {
return err
}
return checkOverflow(a.XXX, "basic_auth")
}
// TargetGroup is a set of targets with a common label set.
type TargetGroup struct {
// Targets is a list of targets identified by a label set. Each target is
// uniquely identifiable in the group by its address label.
Targets []model.LabelSet
// Labels is a set of labels that is common across all targets in the group.
Labels model.LabelSet
// Source is an identifier that describes a group of targets.
Source string
}
func (tg TargetGroup) String() string {
return tg.Source
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (tg *TargetGroup) UnmarshalYAML(unmarshal func(interface{}) error) error {
g := struct {
Targets []string `yaml:"targets"`
Labels model.LabelSet `yaml:"labels"`
XXX map[string]interface{} `yaml:",inline"`
}{}
if err := unmarshal(&g); err != nil {
return err
}
tg.Targets = make([]model.LabelSet, 0, len(g.Targets))
for _, t := range g.Targets {
tg.Targets = append(tg.Targets, model.LabelSet{
model.AddressLabel: model.LabelValue(t),
})
}
tg.Labels = g.Labels
return checkOverflow(g.XXX, "static_config")
}
// MarshalYAML implements the yaml.Marshaler interface.
func (tg TargetGroup) MarshalYAML() (interface{}, error) {
g := &struct {
Targets []string `yaml:"targets"`
Labels model.LabelSet `yaml:"labels,omitempty"`
}{
Targets: make([]string, 0, len(tg.Targets)),
Labels: tg.Labels,
}
for _, t := range tg.Targets {
g.Targets = append(g.Targets, string(t[model.AddressLabel]))
}
return g, nil
}
// UnmarshalJSON implements the json.Unmarshaler interface.
func (tg *TargetGroup) UnmarshalJSON(b []byte) error {
g := struct {
Targets []string `json:"targets"`
Labels model.LabelSet `json:"labels"`
}{}
if err := json.Unmarshal(b, &g); err != nil {
return err
}
tg.Targets = make([]model.LabelSet, 0, len(g.Targets))
for _, t := range g.Targets {
tg.Targets = append(tg.Targets, model.LabelSet{
model.AddressLabel: model.LabelValue(t),
})
}
tg.Labels = g.Labels
return nil
}
// DNSSDConfig is the configuration for DNS based service discovery.
type DNSSDConfig struct {
Names []string `yaml:"names"`
RefreshInterval model.Duration `yaml:"refresh_interval,omitempty"`
Type string `yaml:"type"`
Port int `yaml:"port"` // Ignored for SRV records
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *DNSSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
*c = DefaultDNSSDConfig
type plain DNSSDConfig
err := unmarshal((*plain)(c))
if err != nil {
return err
}
if err := checkOverflow(c.XXX, "dns_sd_config"); err != nil {
return err
}
if len(c.Names) == 0 {
return fmt.Errorf("DNS-SD config must contain at least one SRV record name")
}
switch strings.ToUpper(c.Type) {
case "SRV":
case "A", "AAAA":
if c.Port == 0 {
return fmt.Errorf("a port is required in DNS-SD configs for all record types except SRV")
}
default:
return fmt.Errorf("invalid DNS-SD records type %s", c.Type)
}
return nil
}
// FileSDConfig is the configuration for file based discovery.
type FileSDConfig struct {
Files []string `yaml:"files"`
RefreshInterval model.Duration `yaml:"refresh_interval,omitempty"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *FileSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
*c = DefaultFileSDConfig
type plain FileSDConfig
err := unmarshal((*plain)(c))
if err != nil {
return err
}
if err := checkOverflow(c.XXX, "file_sd_config"); err != nil {
return err
}
if len(c.Files) == 0 {
return fmt.Errorf("file service discovery config must contain at least one path name")
}
for _, name := range c.Files {
if !patFileSDName.MatchString(name) {
return fmt.Errorf("path name %q is not valid for file discovery", name)
}
}
return nil
}
// ConsulSDConfig is the configuration for Consul service discovery.
type ConsulSDConfig struct {
Server string `yaml:"server"`
Token Secret `yaml:"token,omitempty"`
Datacenter string `yaml:"datacenter,omitempty"`
TagSeparator string `yaml:"tag_separator,omitempty"`
Scheme string `yaml:"scheme,omitempty"`
Username string `yaml:"username,omitempty"`
Password Secret `yaml:"password,omitempty"`
// The list of services for which targets are discovered.
// Defaults to all services if empty.
Services []string `yaml:"services"`
TLSConfig TLSConfig `yaml:"tls_config,omitempty"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *ConsulSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
*c = DefaultConsulSDConfig
type plain ConsulSDConfig
err := unmarshal((*plain)(c))
if err != nil {
return err
}
if err := checkOverflow(c.XXX, "consul_sd_config"); err != nil {
return err
}
if strings.TrimSpace(c.Server) == "" {
return fmt.Errorf("Consul SD configuration requires a server address")
}
return nil
}
// ServersetSDConfig is the configuration for Twitter serversets in Zookeeper based discovery.
type ServersetSDConfig struct {
Servers []string `yaml:"servers"`
Paths []string `yaml:"paths"`
Timeout model.Duration `yaml:"timeout,omitempty"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *ServersetSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
*c = DefaultServersetSDConfig
type plain ServersetSDConfig
err := unmarshal((*plain)(c))
if err != nil {
return err
}
if err := checkOverflow(c.XXX, "serverset_sd_config"); err != nil {
return err
}
if len(c.Servers) == 0 {
return fmt.Errorf("serverset SD config must contain at least one Zookeeper server")
}
if len(c.Paths) == 0 {
return fmt.Errorf("serverset SD config must contain at least one path")
}
for _, path := range c.Paths {
if !strings.HasPrefix(path, "/") {
return fmt.Errorf("serverset SD config paths must begin with '/': %s", path)
}
}
return nil
}
// NerveSDConfig is the configuration for AirBnB's Nerve in Zookeeper based discovery.
type NerveSDConfig struct {
Servers []string `yaml:"servers"`
Paths []string `yaml:"paths"`
Timeout model.Duration `yaml:"timeout,omitempty"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *NerveSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
*c = DefaultNerveSDConfig
type plain NerveSDConfig
err := unmarshal((*plain)(c))
if err != nil {
return err
}
if err := checkOverflow(c.XXX, "nerve_sd_config"); err != nil {
return err
}
if len(c.Servers) == 0 {
return fmt.Errorf("nerve SD config must contain at least one Zookeeper server")
}
if len(c.Paths) == 0 {
return fmt.Errorf("nerve SD config must contain at least one path")
}
for _, path := range c.Paths {
if !strings.HasPrefix(path, "/") {
return fmt.Errorf("nerve SD config paths must begin with '/': %s", path)
}
}
return nil
}
// MarathonSDConfig is the configuration for services running on Marathon.
type MarathonSDConfig struct {
Servers []string `yaml:"servers,omitempty"`
Timeout model.Duration `yaml:"timeout,omitempty"`
RefreshInterval model.Duration `yaml:"refresh_interval,omitempty"`
TLSConfig TLSConfig `yaml:"tls_config,omitempty"`
BearerToken Secret `yaml:"bearer_token,omitempty"`
BearerTokenFile string `yaml:"bearer_token_file,omitempty"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *MarathonSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
*c = DefaultMarathonSDConfig
type plain MarathonSDConfig
err := unmarshal((*plain)(c))
if err != nil {
return err
}
if err := checkOverflow(c.XXX, "marathon_sd_config"); err != nil {
return err
}
if len(c.Servers) == 0 {
return fmt.Errorf("Marathon SD config must contain at least one Marathon server")
}
if len(c.BearerToken) > 0 && len(c.BearerTokenFile) > 0 {
return fmt.Errorf("at most one of bearer_token & bearer_token_file must be configured")
}
return nil
}
// KubernetesRole is role of the service in Kubernetes.
type KubernetesRole string
// The valid options for KubernetesRole.
const (
KubernetesRoleNode = "node"
KubernetesRolePod = "pod"
KubernetesRoleService = "service"
KubernetesRoleEndpoint = "endpoints"
)
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *KubernetesRole) UnmarshalYAML(unmarshal func(interface{}) error) error {
if err := unmarshal((*string)(c)); err != nil {
return err
}
switch *c {
case KubernetesRoleNode, KubernetesRolePod, KubernetesRoleService, KubernetesRoleEndpoint:
return nil
default:
return fmt.Errorf("Unknown Kubernetes SD role %q", *c)
}
}
// KubernetesSDConfig is the configuration for Kubernetes service discovery.
type KubernetesSDConfig struct {
APIServer URL `yaml:"api_server"`
Role KubernetesRole `yaml:"role"`
BasicAuth *BasicAuth `yaml:"basic_auth,omitempty"`
BearerToken Secret `yaml:"bearer_token,omitempty"`
BearerTokenFile string `yaml:"bearer_token_file,omitempty"`
TLSConfig TLSConfig `yaml:"tls_config,omitempty"`
NamespaceDiscovery KubernetesNamespaceDiscovery `yaml:"namespaces"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *KubernetesSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
*c = KubernetesSDConfig{}
type plain KubernetesSDConfig
err := unmarshal((*plain)(c))
if err != nil {
return err
}
if err := checkOverflow(c.XXX, "kubernetes_sd_config"); err != nil {
return err
}
if c.Role == "" {
return fmt.Errorf("role missing (one of: pod, service, endpoints, node)")
}
if len(c.BearerToken) > 0 && len(c.BearerTokenFile) > 0 {
return fmt.Errorf("at most one of bearer_token & bearer_token_file must be configured")
}
if c.BasicAuth != nil && (len(c.BearerToken) > 0 || len(c.BearerTokenFile) > 0) {
return fmt.Errorf("at most one of basic_auth, bearer_token & bearer_token_file must be configured")
}
if c.APIServer.URL == nil &&
(c.BasicAuth != nil || c.BearerToken != "" || c.BearerTokenFile != "" ||
c.TLSConfig.CAFile != "" || c.TLSConfig.CertFile != "" || c.TLSConfig.KeyFile != "") {
return fmt.Errorf("to use custom authentication please provide the 'api_server' URL explicitly")
}
return nil
}
// KubernetesNamespaceDiscovery is the configuration for discovering
// Kubernetes namespaces.
type KubernetesNamespaceDiscovery struct {
Names []string `yaml:"names"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *KubernetesNamespaceDiscovery) UnmarshalYAML(unmarshal func(interface{}) error) error {
*c = KubernetesNamespaceDiscovery{}
type plain KubernetesNamespaceDiscovery
err := unmarshal((*plain)(c))
if err != nil {
return err
}
if err := checkOverflow(c.XXX, "namespaces"); err != nil {
return err
}
return nil
}
// GCESDConfig is the configuration for GCE based service discovery.
type GCESDConfig struct {
// Project: The Google Cloud Project ID
Project string `yaml:"project"`
// Zone: The zone of the scrape targets.
// If you need to configure multiple zones use multiple gce_sd_configs
Zone string `yaml:"zone"`
// Filter: Can be used optionally to filter the instance list by other criteria.
// Syntax of this filter string is described here in the filter query parameter section:
// https://cloud.google.com/compute/docs/reference/latest/instances/list
Filter string `yaml:"filter,omitempty"`
RefreshInterval model.Duration `yaml:"refresh_interval,omitempty"`
Port int `yaml:"port"`
TagSeparator string `yaml:"tag_separator,omitempty"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *GCESDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
*c = DefaultGCESDConfig
type plain GCESDConfig
err := unmarshal((*plain)(c))
if err != nil {
return err
}
if err := checkOverflow(c.XXX, "gce_sd_config"); err != nil {
return err
}
if c.Project == "" {
return fmt.Errorf("GCE SD configuration requires a project")
}
if c.Zone == "" {
return fmt.Errorf("GCE SD configuration requires a zone")
}
return nil
}
// EC2SDConfig is the configuration for EC2 based service discovery.
type EC2SDConfig struct {
Region string `yaml:"region"`
AccessKey string `yaml:"access_key,omitempty"`
SecretKey Secret `yaml:"secret_key,omitempty"`
Profile string `yaml:"profile,omitempty"`
RefreshInterval model.Duration `yaml:"refresh_interval,omitempty"`
Port int `yaml:"port"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *EC2SDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
*c = DefaultEC2SDConfig
type plain EC2SDConfig
err := unmarshal((*plain)(c))
if err != nil {
return err
}
if err := checkOverflow(c.XXX, "ec2_sd_config"); err != nil {
return err
}
if c.Region == "" {
sess, err := session.NewSession()
if err != nil {
return err
}
metadata := ec2metadata.New(sess)
region, err := metadata.Region()
if err != nil {
return fmt.Errorf("EC2 SD configuration requires a region")
}
c.Region = region
}
return nil
}
// OpenstackSDConfig is the configuration for OpenStack based service discovery.
type OpenstackSDConfig struct {
IdentityEndpoint string `yaml:"identity_endpoint"`
Username string `yaml:"username"`
UserID string `yaml:"userid"`
Password Secret `yaml:"password"`
ProjectName string `yaml:"project_name"`
ProjectID string `yaml:"project_id"`
DomainName string `yaml:"domain_name"`
DomainID string `yaml:"domain_id"`
Region string `yaml:"region"`
RefreshInterval model.Duration `yaml:"refresh_interval,omitempty"`
Port int `yaml:"port"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *OpenstackSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
*c = DefaultOpenstackSDConfig
type plain OpenstackSDConfig
err := unmarshal((*plain)(c))
if err != nil {
return err
}
return checkOverflow(c.XXX, "openstack_sd_config")
}
// AzureSDConfig is the configuration for Azure based service discovery.
type AzureSDConfig struct {
Port int `yaml:"port"`
SubscriptionID string `yaml:"subscription_id"`
TenantID string `yaml:"tenant_id,omitempty"`
ClientID string `yaml:"client_id,omitempty"`
ClientSecret Secret `yaml:"client_secret,omitempty"`
RefreshInterval model.Duration `yaml:"refresh_interval,omitempty"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *AzureSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
*c = DefaultAzureSDConfig
type plain AzureSDConfig
err := unmarshal((*plain)(c))
if err != nil {
return err
}
return checkOverflow(c.XXX, "azure_sd_config")
}
// TritonSDConfig is the configuration for Triton based service discovery.
type TritonSDConfig struct {
Account string `yaml:"account"`
DNSSuffix string `yaml:"dns_suffix"`
Endpoint string `yaml:"endpoint"`
Port int `yaml:"port"`
RefreshInterval model.Duration `yaml:"refresh_interval,omitempty"`
TLSConfig TLSConfig `yaml:"tls_config,omitempty"`
Version int `yaml:"version"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *TritonSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
*c = DefaultTritonSDConfig
type plain TritonSDConfig
err := unmarshal((*plain)(c))
if err != nil {
return err
}
if c.Account == "" {
return fmt.Errorf("Triton SD configuration requires an account")
}
if c.DNSSuffix == "" {
return fmt.Errorf("Triton SD configuration requires a dns_suffix")
}
if c.Endpoint == "" {
return fmt.Errorf("Triton SD configuration requires an endpoint")
}
if c.RefreshInterval <= 0 {
return fmt.Errorf("Triton SD configuration requires RefreshInterval to be a positive integer")
}
return checkOverflow(c.XXX, "triton_sd_config")
}
// RelabelAction is the action to be performed on relabeling.
type RelabelAction string
const (
// RelabelReplace performs a regex replacement.
RelabelReplace RelabelAction = "replace"
// RelabelKeep drops targets for which the input does not match the regex.
RelabelKeep RelabelAction = "keep"
// RelabelDrop drops targets for which the input does match the regex.
RelabelDrop RelabelAction = "drop"
// RelabelHashMod sets a label to the modulus of a hash of labels.
RelabelHashMod RelabelAction = "hashmod"
// RelabelLabelMap copies labels to other labelnames based on a regex.
RelabelLabelMap RelabelAction = "labelmap"
// RelabelLabelDrop drops any label matching the regex.
RelabelLabelDrop RelabelAction = "labeldrop"
// RelabelLabelKeep drops any label not matching the regex.
RelabelLabelKeep RelabelAction = "labelkeep"
)
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (a *RelabelAction) UnmarshalYAML(unmarshal func(interface{}) error) error {
var s string
if err := unmarshal(&s); err != nil {
return err
}
switch act := RelabelAction(strings.ToLower(s)); act {
case RelabelReplace, RelabelKeep, RelabelDrop, RelabelHashMod, RelabelLabelMap, RelabelLabelDrop, RelabelLabelKeep:
*a = act
return nil
}
return fmt.Errorf("unknown relabel action %q", s)
}
// RelabelConfig is the configuration for relabeling of target label sets.
type RelabelConfig struct {
// A list of labels from which values are taken and concatenated
// with the configured separator in order.
SourceLabels model.LabelNames `yaml:"source_labels,flow,omitempty"`
// Separator is the string between concatenated values from the source labels.
Separator string `yaml:"separator,omitempty"`
// Regex against which the concatenation is matched.
Regex Regexp `yaml:"regex,omitempty"`
// Modulus to take of the hash of concatenated values from the source labels.
Modulus uint64 `yaml:"modulus,omitempty"`
// TargetLabel is the label to which the resulting string is written in a replacement.
// Regexp interpolation is allowed for the replace action.
TargetLabel string `yaml:"target_label,omitempty"`
// Replacement is the regex replacement pattern to be used.
Replacement string `yaml:"replacement,omitempty"`
// Action is the action to be performed for the relabeling.
Action RelabelAction `yaml:"action,omitempty"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *RelabelConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
*c = DefaultRelabelConfig
type plain RelabelConfig
if err := unmarshal((*plain)(c)); err != nil {
return err
}
if err := checkOverflow(c.XXX, "relabel_config"); err != nil {
return err
}
if c.Regex.Regexp == nil {
c.Regex = MustNewRegexp("")
}
if c.Modulus == 0 && c.Action == RelabelHashMod {
return fmt.Errorf("relabel configuration for hashmod requires non-zero modulus")
}
if (c.Action == RelabelReplace || c.Action == RelabelHashMod) && c.TargetLabel == "" {
return fmt.Errorf("relabel configuration for %s action requires 'target_label' value", c.Action)
}
if c.Action == RelabelReplace && !relabelTarget.MatchString(c.TargetLabel) {
return fmt.Errorf("%q is invalid 'target_label' for %s action", c.TargetLabel, c.Action)
}
if c.Action == RelabelHashMod && !model.LabelName(c.TargetLabel).IsValid() {
return fmt.Errorf("%q is invalid 'target_label' for %s action", c.TargetLabel, c.Action)
}
if c.Action == RelabelLabelDrop || c.Action == RelabelLabelKeep {
if c.SourceLabels != nil ||
c.TargetLabel != DefaultRelabelConfig.TargetLabel ||
c.Modulus != DefaultRelabelConfig.Modulus ||
c.Separator != DefaultRelabelConfig.Separator ||
c.Replacement != DefaultRelabelConfig.Replacement {
return fmt.Errorf("%s action requires only 'regex', and no other fields", c.Action)
}
}
return nil
}
// Regexp encapsulates a regexp.Regexp and makes it YAML marshallable.
type Regexp struct {
*regexp.Regexp
original string
}
// NewRegexp creates a new anchored Regexp and returns an error if the
// passed-in regular expression does not compile.
func NewRegexp(s string) (Regexp, error) {
regex, err := regexp.Compile("^(?:" + s + ")$")
return Regexp{
Regexp: regex,
original: s,
}, err
}
// MustNewRegexp works like NewRegexp, but panics if the regular expression does not compile.
func MustNewRegexp(s string) Regexp {
re, err := NewRegexp(s)
if err != nil {
panic(err)
}
return re
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (re *Regexp) UnmarshalYAML(unmarshal func(interface{}) error) error {
var s string
if err := unmarshal(&s); err != nil {
return err
}
r, err := NewRegexp(s)
if err != nil {
return err
}
*re = r
return nil
}
// MarshalYAML implements the yaml.Marshaler interface.
func (re Regexp) MarshalYAML() (interface{}, error) {
if re.original != "" {
return re.original, nil
}
return nil, nil
}
// RemoteWriteConfig is the configuration for writing to remote storage.
type RemoteWriteConfig struct {
URL *URL `yaml:"url,omitempty"`
RemoteTimeout model.Duration `yaml:"remote_timeout,omitempty"`
WriteRelabelConfigs []*RelabelConfig `yaml:"write_relabel_configs,omitempty"`
// We cannot do proper Go type embedding below as the parser will then parse
// values arbitrarily into the overflow maps of further-down types.
HTTPClientConfig HTTPClientConfig `yaml:",inline"`
QueueConfig QueueConfig `yaml:"queue_config,omitempty"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *RemoteWriteConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
*c = DefaultRemoteWriteConfig
type plain RemoteWriteConfig
if err := unmarshal((*plain)(c)); err != nil {
return err
}
// The UnmarshalYAML method of HTTPClientConfig is not being called because it's not a pointer.
// We cannot make it a pointer as the parser panics for inlined pointer structs.
// Thus we just do its validation here.
if err := c.HTTPClientConfig.validate(); err != nil {
return err
}
if err := checkOverflow(c.XXX, "remote_write"); err != nil {
return err
}
return nil
}
// QueueConfig is the configuration for the queue used to write to remote
// storage.
type QueueConfig struct {
// Number of samples to buffer per shard before we start dropping them.
Capacity int `yaml:"capacity,omitempty"`
// Max number of shards, i.e. amount of concurrency.
MaxShards int `yaml:"max_shards,omitempty"`
// Maximum number of samples per send.
MaxSamplesPerSend int `yaml:"max_samples_per_send,omitempty"`
// Maximum time sample will wait in buffer.
BatchSendDeadline time.Duration `yaml:"batch_send_deadline,omitempty"`
// Max number of times to retry a batch on recoverable errors.
MaxRetries int `yaml:"max_retries,omitempty"`
// On recoverable errors, backoff exponentially.
MinBackoff time.Duration `yaml:"min_backoff,omitempty"`
MaxBackoff time.Duration `yaml:"max_backoff,omitempty"`
}
// RemoteReadConfig is the configuration for reading from remote storage.
type RemoteReadConfig struct {
URL *URL `yaml:"url,omitempty"`
RemoteTimeout model.Duration `yaml:"remote_timeout,omitempty"`
// We cannot do proper Go type embedding below as the parser will then parse
// values arbitrarily into the overflow maps of further-down types.
HTTPClientConfig HTTPClientConfig `yaml:",inline"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
func (c *RemoteReadConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
*c = DefaultRemoteReadConfig
type plain RemoteReadConfig
if err := unmarshal((*plain)(c)); err != nil {
return err
}
// The UnmarshalYAML method of HTTPClientConfig is not being called because it's not a pointer.
// We cannot make it a pointer as the parser panics for inlined pointer structs.
// Thus we just do its validation here.
if err := c.HTTPClientConfig.validate(); err != nil {
return err
}
if err := checkOverflow(c.XXX, "remote_read"); err != nil {
return err
}
return nil
}
|
{
content, err := ioutil.ReadFile(filename)
if err != nil {
return nil, err
}
cfg, err := Load(string(content))
if err != nil {
return nil, err
}
resolveFilepaths(filepath.Dir(filename), cfg)
return cfg, nil
}
|
test_run.py
|
import os
import filecmp
from dvc.main import main
from dvc.utils import file_md5
from dvc.stage import Stage
from dvc.command.run import CmdRun
|
from tests.basic_env import TestDvc
class TestRun(TestDvc):
def test(self):
cmd = 'python {} {} {}'.format(self.CODE, self.FOO, 'out')
deps = [self.FOO, self.CODE]
outs = [os.path.join(self.dvc.root_dir, 'out')]
outs_no_cache = []
fname = os.path.join(self.dvc.root_dir, 'out.dvc')
cwd = os.curdir
self.dvc.add(self.FOO)
stage = self.dvc.run(cmd=cmd,
deps=deps,
outs=outs,
outs_no_cache=outs_no_cache,
fname=fname,
cwd=cwd)
self.assertTrue(filecmp.cmp(self.FOO, 'out'))
self.assertTrue(os.path.isfile(stage.path))
self.assertEqual(stage.cmd, cmd)
self.assertEqual(len(stage.deps), len(deps))
self.assertEqual(len(stage.outs), len(outs + outs_no_cache))
self.assertEqual(stage.outs[0].path, outs[0])
self.assertEqual(stage.outs[0].md5, file_md5(self.FOO)[0])
self.assertTrue(stage.path, fname)
class TestRunEmpty(TestDvc):
def test(self):
self.dvc.run(cmd='',
deps=[],
outs=[],
outs_no_cache=[],
fname='empty.dvc',
cwd=os.curdir)
class TestRunNoExec(TestDvc):
def test(self):
self.dvc.run(cmd='python {} {} {}'.format(self.CODE, self.FOO, 'out'),
no_exec=True)
self.assertFalse(os.path.exists('out'))
class TestCmdRun(TestDvc):
def test_run(self):
ret = main(['run',
'-d', self.FOO,
'-d', self.CODE,
'-o', 'out',
'-f', 'out.dvc',
'python', self.CODE, self.FOO, 'out'])
self.assertEqual(ret, 0)
self.assertTrue(os.path.isfile('out'))
self.assertTrue(os.path.isfile('out.dvc'))
self.assertTrue(filecmp.cmp(self.FOO, 'out'))
def test_run_bad_command(self):
ret = main(['run',
'non-existing-command'])
self.assertNotEqual(ret, 0)
| |
rankRoom.py
|
fields = {
100000201 : [100000205, 2],
103000003 : [103000008, 1],
102000003 : [102000004, 1],
|
# 120000101 : [100000205, 2],
}
currentMap = sm.getFieldID()
if currentMap == 120000101:# Pirates
sm.chatBlue("[WIP] no MapID for Hall of Pirates")
elif currentMap in fields:
sm.warp(fields[currentMap][0], fields[currentMap][1])
else:
sm.chat("This script (rankRoom.py) has not been coded for the given map (" + str(currentMap) + ")")
sm.dispose()
|
101000003 : [101000004, 2],
|
8.js
|
webpackJsonp([8,34],{AmgI:function(t,e,a){(t.exports=a("FZ+f")(!1)).push([t.i,"",""])},MTnp:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a("woOf"),o=a.n(i),n=a("S1zi"),r=a("0xDb"),s={components:{DialogArticles:n.default},data:function(){var t=this;return{loading:!1,dialogShow:!1,dateOption:"",dataForm:{type:"",title:"",status:""},pickerOptions:{onPick:function(e){var a=e.maxDate,i=e.minDate,o=Object(r.b)(i),n=Object(r.b)(a);t.dataForm.dateBegin=o,t.dataForm.dateEnd=n}},dataList:[],pageIndex:1,pageSize:20,totalPage:0,positionArr:["系统公告","精选活动"],positionOptions:[{value:null,text:"全部"},{value:0,text:"系统公告"},{value:3,text:"精选活动"}],statusOptions:[{value:null,text:"全部"},{value:1,text:"发布中"},{value:0,text:"已下架"}]}},watch:{},activated:function(){this.getDataList()},methods:{closeDialog:function(){this.dialogShow=!1,this.getDataList()},resetForm:function(){this.dataForm={dateBegin:"",dateEnd:"",title:"",position:"",status:""},this.dateOption=""},getDataList:function(){var t=this;this.loading=!0;var e={page:this.pageIndex,limit:this.pageSize},a=o()(e,this.dataForm);this.$http({url:this.$http.adornUrl("msg/list"),method:"post",data:this.$http.adornData(a,!1,"form")}).then(function(e){var a=e.data;a&&0===a.code?(t.dataList=a.page.list,t.totalPage=a.page.totalNum):(t.dataList=[],t.totalPage=0),t.loading=!1})},sizeChangeHandle:function(t){this.pageSize=t,this.pageIndex=1,this.getDataList()},currentChangeHandle:function(t){this.pageIndex=t,this.getDataList()},refreshDataList:function(){this.dialogShow=!1,this.getDataList()},addOrUpdateHandle:function(t){var e=this;this.dialogShow=!0,this.$nextTick(function(){e.$refs.addOrUpdate.init(t)})},releaseOrcancel:function(t,e){var a=this,i={id:t,status:e};this.$http({headers:{"Content-Type":"application/json; charset=utf-8"},url:this.$http.adornUrl("msg/update"),method:"post",data:this.$http.adornData(i,!1)}).then(function(t){var e=t.data;e&&0===e.code?a.$message({message:"操作成功",type:"success",duration:1500,onClose:function(){a.refreshDataList()}}):a.$message.error(e.msg)})}}},l={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"omt-bannerAdmin"},[a("div",{directives:[{name:"show",rawName:"v-show",value:!t.dialogShow,expression:"!dialogShow"}],staticClass:"bannerAdminWrap"},[a("el-form",{staticClass:"demo-ruleForm",attrs:{inline:!0,model:t.dataForm},nativeOn:{keyup:function(e){if(!("button"in e)&&t._k(e.keyCode,"enter",13,e.key))return null;t.getDataList()}}},[a("el-form-item",{attrs:{label:"标题"}},[a("el-input",{model:{value:t.dataForm.title,callback:function(e){t.$set(t.dataForm,"title",e)},expression:"dataForm.title"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"消息类型"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择"},on:{change:t.getDataList},model:{value:t.dataForm.type,callback:function(e){t.$set(t.dataForm,"type",e)},expression:"dataForm.type"}},t._l(t.positionOptions,function(t){return a("el-option",{key:t.value,attrs:{label:t.text,value:t.value}})}))],1),t._v(" "),a("el-form-item",{attrs:{label:"状态"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择"},on:{change:t.getDataList},model:{value:t.dataForm.status,callback:function(e){t.$set(t.dataForm,"status",e)},expression:"dataForm.status"}},t._l(t.statusOptions,function(t){return a("el-option",{key:t.value,attrs:{label:t.text,value:t.value}})}))],1),t._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary",icon:"el-icon-search"},on:{click:function(e){t.getDataList()}}},[t._v("查询")]),t._v(" "),a("el-button",{on:{click:function(e){t.resetForm()}}},[t._v("重置")])],1),t._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary",icon:"el-icon-plus"},on:{click:function(e){t.addOrUpdateHandle()}}},[t._v("发布消息")])],1)],1),t._v(" "),a("el-table",{staticStyle:{width:"100%"},attrs:{data:t.dataList,border:""}},[a("el-table-column",{attrs:{type:"index",label:"序号",width:"50"}}),t._v(" "),a("el-table-column",{attrs:{prop:"type","header-align":"center",align:"center",width:"150",label:"消息类型"},scopedSlots:t._u([{key:"default",fn:function(e){return[0===e.row.type?a("span",[t._v("系统公告")]):3===e.row.type?a("span",[t._v("精选活动")]):t._e()]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"addtime","header-align":"center",align:"center",width:"200",label:"创建时间"}}),t._v(" "),a("el-table-column",{attrs:{prop:"title","header-align":"center",align:"center",label:"标题"}}),t._v(" "),a("el-table-column",{attrs:{"header-align":"center",align:"center",width:"120",label:"状态"},scopedSlots:t._u([{key:"default",fn:function(e){return[0===e.row.status?a("el-tag",{attrs:{size:"small",type:"danger"}},[t._v("已下架")]):a("el-tag",{attrs:{size:"small"}},[t._v("发布中")])]}}])}),t._v(" "),a("el-table-column",{attrs:{fixed:"right","header-align":"center",align:"center",width:"200",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{size:"mini"},on:{click:function(a){t.addOrUpdateHandle(e.row)}}},[t._v("编辑")]),t._v(" "),0===e.row.status?a("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(a){t.releaseOrcancel(e.row.id,1)}}},[t._v("发布")]):a("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(a){t.releaseOrcancel(e.row.id,0)}}},[t._v("取消发布")])]}}])})],1),t._v(" "),a("el-pagination",{attrs:{"current-page":t.pageIndex,"page-sizes":[10,20,50,100],"page-size":t.pageSize,total:t.totalPage,layout:"total, sizes, prev, pager, next, jumper"},on:{"size-change":t.sizeChangeHandle,"current-change":t.currentChangeHandle}})],1),t._v(" "),a("dialog-articles",{directives:[{name:"show",rawName:"v-show",value:t.dialogShow,expression:"dialogShow"}],ref:"addOrUpdate",attrs:{option:{positionOptions:t.positionOptions,statusOptions:t.statusOptions}},on:{refreshDataList:t.refreshDataList,return:function(e){t.closeDialog()}}})],1)},staticRenderFns:[]};var d=a("VU/8")(s,l,!1,function(t){a("orye")},null,null);e.default=d.exports},S1zi:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a("sYY+"),o=a.n(i),n=a("csgp"),r={props:{option:{type:Object}},components:{ImgUpload:n.a},data:function(){return{isAdd:!0,editorCon:"",imgSize:100,imgWidth:690,imgHeight:216,positionOptions:this.option.positionOptions,statusOptions:this.option.statusOptions,dataForm:{id:null,type:0,title:"",rate:null,image:"",content:"",status:0,url:""},editor:null,dataRule:{type:[{required:!0,message:"消息类型不能为空",trigger:"blur"}],title:[{required:!0,message:"标题不能为空",trigger:"blur"}],content:[{required:!0,message:"内容不能为空",trigger:"blur"}],url:[{required:!0,message:"URL不能为空",trigger:"blur"}]}}},mounted:function(){var t=this;this.editor=new o.a(this.$refs.editor),this.editor.customConfig.zIndex=1,this.editor.customConfig.menus=["justify","fontSize","foreColor","image","link"],this.editor.customConfig.customUploadImg=function(e,a){if(e.size>=1024)t.$message.error("图片大小超过1M,请按要求重新上传");else{var i=new FormData;i.append("action","UploadVMKImagePath"),i.append("file",e[0]),t.$http({url:t.$http.adornUrl("/file/upload"),method:"post",data:i}).then(function(e){var i=e.data;i&&0===i.code?(a(i.fileUrl),t.$message({message:"上传成功",type:"success",duration:1500})):t.$message.error(i.msg)})}},this.editor.create(),this.editor.txt.html(this.dataForm.content)},methods:{clearValid:function(){this.$refs.type.clearValidate()},chooseImg:function(t){this.dataForm.image=t,this.$refs.dataForm.clearValidate(["image"])},init:function(t){var e=this;this.$nextTick(function(){e.$refs.dataForm.resetFields()}),t?(this.isAdd=!1,this.dataForm=t):(this.isAdd=!0,this.dataForm={id:null,type:0,title:"",rate:null,image:"",content:"",status:0,url:""}),0===this.dataForm.type&&this.editor.txt.html(this.dataForm.content)},dataFormSubmit:function(){var t=this;console.log(""===this.editor.txt.text()),0===this.dataForm.type&&(""===this.editor.txt.text()||null===this.editor.txt.text()?this.dataForm.content="":this.dataForm.content=this.editor.txt.html()),this.$refs.dataForm.validate(function(e){e&&(console.log(t.dataForm),t.$http({headers:{"Content-Type":"application/json; charset=utf-8"},url:t.$http.adornUrl("msg/"+(t.dataForm.id?"update":"save")),method:"post",data:t.$http.adornData(t.dataForm)}).then(function(e){var a=e.data;a&&0===a.code?t.$message({message:"操作成功",type:"success",duration:1500,onClose:function(){t.visible=!1,t.$emit("refreshDataList")}}):t.$message.error(a.msg)}))})},returnList:function(){this.$emit("return")}}},s={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"bannerEdit"},[a("div",{staticClass:"form-title"},[t._v(t._s(t.isAdd?"新增":"修改"))]),t._v(" "),a("el-form",{ref:"dataForm",staticClass:"common-form",attrs:{model:t.dataForm,rules:t.dataRule,"label-width":"80px"}},[a("el-form-item",{ref:"type",attrs:{label:"消息类型",prop:"type"}},[a("el-select",{attrs:{placeholder:"请选择",disabled:!t.isAdd},on:{change:t.clearValid},model:{value:t.dataForm.type,callback:function(e){t.$set(t.dataForm,"type",e)},expression:"dataForm.type"}},t._l(t.positionOptions,function(e){return null!==e.value?a("el-option",{key:e.value,attrs:{label:e.text,value:e.value}}):t._e()}))],1),t._v(" "),a("el-form-item",{attrs:{label:"标题",prop:"title"}},[a("el-input",{attrs:{maxlength:"20"},model:{value:t.dataForm.title,callback:function(e){t.$set(t.dataForm,"title",e)},expression:"dataForm.title"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"图片",prop:"image"}},[a("img-upload",{attrs:{"orgin-img":t.dataForm.image,"img-size":t.imgSize,width:t.imgWidth,height:t.imgHeight},on:{choose:t.chooseImg}})],1),t._v(" "),a("el-form-item",{directives:[{name:"show",rawName:"v-show",value:3!==t.dataForm.type,expression:"dataForm.type!==3"}],attrs:{label:"内容",prop:"content"}},[a("div",{ref:"editor",staticClass:"editor"})]),t._v(" "),3===t.dataForm.type?a("el-form-item",{attrs:{label:"宣传语",prop:"content"}},[a("el-input",{attrs:{maxlength:"50"},model:{value:t.dataForm.content,callback:function(e){t.$set(t.dataForm,"content",e)},expression:"dataForm.content"}})],1):t._e(),t._v(" "),3===t.dataForm.type?a("el-form-item",{attrs:{label:"URL",prop:"url"}},[a("el-input",{model:{value:t.dataForm.url,callback:function(e){t.$set(t.dataForm,"url",e)},expression:"dataForm.url"}})],1):t._e(),t._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.dataFormSubmit()}}},[t._v("发布")]),t._v(" "),a("el-button",{on:{click:function(e){t.returnList()}}},[t._v("返回")])],1)],1)],1)},staticRenderFns:[]},l=a("VU/8")(r,s,!1,null,null,null);e.default=l.exports},orye:function(t,e,a){var i=a("AmgI");"string"==typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);a("rjj0")("e5996eb4",i,!0)}});
|
||
pure_jax.py
|
import io
import jax
import requests
import PIL
from PIL import ImageOps
import numpy as np
import jax.numpy as jnp
from dall_e_jax import get_encoder, get_decoder, map_pixels, unmap_pixels
target_image_size = 256
def download_image(url):
resp = requests.get(url)
resp.raise_for_status()
return PIL.Image.open(io.BytesIO(resp.content))
def
|
(img):
img = ImageOps.fit(img, [target_image_size,] * 2, method=0, bleed=0.0, centering=(0.5, 0.5))
img = np.expand_dims(np.transpose(np.array(img).astype(np.float32)/255, (2, 0, 1)), 0)
return map_pixels(img)
jax_enc_fn, jax_enc_params = get_encoder("encoder.pkl")
jax_dec_fn, jax_dec_params = get_decoder("decoder.pkl")
x = preprocess(download_image('https://assets.bwbx.io/images/users/iqjWHBFdfxIU/iKIWgaiJUtss/v2/1000x-1.jpg'))
z_logits = jax_enc_fn(jax_enc_params, x)
z = jnp.argmax(z_logits, axis=1)
z = jnp.transpose(jax.nn.one_hot(z, num_classes=8192), (0, 3, 1, 2))
x_stats = jax_dec_fn(jax_dec_params, z)
x_rec = unmap_pixels(jax.nn.sigmoid(x_stats[:, :3]))
x_rec = np.transpose((np.array(x_rec[0]) * 255).astype(np.uint8), (1, 2, 0))
PIL.Image.fromarray(x_rec).save('reconstructed.png')
|
preprocess
|
pgpwordlist.go
|
/*
* Copyright (c) 2015-2016 The Hcd developers
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
package pgpwordlist
import (
"fmt"
"strings"
)
// ByteToMnemonic returns the PGP word list encoding of b when found at index.
func ByteToMnemonic(b byte, index int) string {
bb := uint16(b) * 2
if index%2 != 0 {
bb++
}
return wordList[bb]
}
// DecodeMnemonics returns the decoded value that is encoded by words. Any
// words that are whitespace are empty are skipped.
func DecodeMnemonics(words []string) ([]byte, error) {
decoded := make([]byte, len(words))
idx := 0
for _, w := range words {
w = strings.TrimSpace(w)
if w == "" {
continue
}
b, ok := wordIndexes[strings.ToLower(w)]
if !ok {
return nil, fmt.Errorf("word %v is not in the PGP word list", w)
}
if int(b%2) != idx%2
|
decoded[idx] = byte(b / 2)
idx++
}
return decoded[:idx], nil
}
|
{
return nil, fmt.Errorf("word %v is not valid at position %v, "+
"check for missing words", w, idx)
}
|
react-datetime-picker-tests.tsx
|
import * as React from 'react';
import DateTimePicker from 'react-datetime-picker';
// full test of all props available
function Test1() {
const [value, onChange] = React.useState(new Date());
return (
<div>
<DateTimePicker
amPmAriaLabel={'AM / PM Label'}
autoFocus={false}
calendarAriaLabel={'Calendar ARIA Label'}
calendarClassName={['class1', 'class2']}
calendarIcon={<span>some icon</span>}
className={['class1', 'class2']}
clearAriaLabel={'Clear ARIA Label'}
clearIcon={<span>some icon</span>}
clockClassName={['class1', 'class2']}
closeWidgets={false}
dayAriaLabel={'Day ARIA Label'}
dayPlaceholder={'Day Placeholder'}
disabled={false}
disableCalendar={false}
disableClock={false}
format={'y-MM-dd h:mm:ss a'}
hourAriaLabel={'Hour ARIA Label'}
|
locale={'en-US'}
maxDate={new Date()}
maxDetail={'second'}
minDetail={'month'}
minuteAriaLabel={'Minute ARIA Label'}
minutePlaceholder={'Minute Placeholder'}
monthAriaLabel={'Month ARIA Label'}
monthPlaceholder={'Month Placeholder'}
name={'myCustomName'}
nativeInputAriaLabel={'Native input ARIA Label'}
onCalendarClose={() => {
console.log('calendar closed');
}}
onCalendarOpen={() => {
console.log('calendar opened');
}}
onChange={onChange}
onClockClose={() => {
console.log('clock closed');
}}
onClockOpen={() => {
console.log('clock opened');
}}
openWidgetsOnFocus={false}
returnValue={'start'}
required={false}
secondAriaLabel={'Second ARIA Label'}
secondPlaceholder={'Second Placeholder'}
showLeadingZeros={false}
value={[new Date(), new Date()]}
yearAriaLabel={'Year ARIA Label'}
yearPlaceholder={'Year Placeholder'}
/>
</div>
);
}
// simple test from docs:
// https://github.com/wojtekmaj/react-datetime-picker
function Test2() {
const [value, onChange] = React.useState(new Date());
return (
<div>
<DateTimePicker onChange={onChange} value={value} />
</div>
);
}
|
hourPlaceholder={'Hour Placeholder'}
isCalendarOpen={false}
isClockOpen={false}
|
feature_extraction.py
|
import mahotas as mt
from skimage.feature import hog
def
|
(img_gray, img_mask):
zernike = mt.features.zernike_moments(img_gray, 3)
fd = hog(img_mask, orientations=9, pixels_per_cell=(8, 8),
cells_per_block=(2, 2))
return list(zernike)+list(fd)
|
extract_features
|
mod.rs
|
//! Defines the named standard illuminants for both 2 and 10 degree observers
//!
//! White point is used in many situations when dealing with color, as color perception changes
//! depending on the lighting of the object being viewed. A white point is needed to define
//! a color space (and thus go to XYZ) as well as to go from XYZ to Lab and Luv.
//!
//! CIE defines two "standard observers", which are used to construct the XYZ space. The 2 degree
//! observer is the most often used, and corresponds to the perception in the center 2 degree field
//! of view of the eye. A later 10 degree observer was created to model perception in a 10 degree
//! field of view excluding the inner 2 degrees. It is recommended for use when a larger field of view
//! needs to be considered. The 2 degree observer white points are re-exported. Note that the 2 and 10
//! degree standard observers use fundamentally different color-matching functions, which means that
//! they yield different XYZ spaces. It is not valid (without spectrographic data) to convert between
//! a 2 degree standard observer XYZ space and a 10 degree standard observer XYZ space.
//!
//! The standard illuminants are slightly different between the two, so prisma provides two modules
//! containing them `deg_2` and `deg_10`. If you don't know which to use, use `deg_2`.
use crate::xyy::XyY;
use crate::xyz::Xyz;
/// A named standard illuminant, expressed as XYZ coordinates
pub trait WhitePoint<T>: Clone + PartialEq {
/// Return the white point's XYZ coordinates
fn get_xyz(&self) -> Xyz<T>;
/// Return the white point's coordinates expressed in xyY chromaticity space
fn get_xy_chromaticity(&self) -> XyY<T>;
}
/// A `WhitePoint` which carries no data
pub trait UnitWhitePoint<T>: WhitePoint<T> + Default + Copy {}
impl<'a, T, U> WhitePoint<T> for &'a U
where
U: WhitePoint<T>,
{
fn get_xyz(&self) -> Xyz<T> {
<U as WhitePoint<T>>::get_xyz(&self)
}
fn get_xy_chromaticity(&self) -> XyY<T>
|
}
pub mod deg_10;
pub mod deg_2;
pub use self::deg_2::*;
|
{
<U as WhitePoint<T>>::get_xy_chromaticity(&self)
}
|
/*************************** [bundle] ****************************/
// Original file:./examples/svg.html
|
var __etcpack__scope_args__;
__etcpack__scope_bundle__.default= "<!DOCTYPE html>\r\n<html lang=\"zh-cn\">\r\n\r\n<head>\r\n <meta charset=\"UTF-8\">\r\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n <title>HTML / 标签 / SVG</title>\r\n <script src='https://cdn.jsdelivr.net/npm/@hai2007/tool@0'></script>\r\n <style>\r\n svg {\r\n width: 300px;\r\n height: 300px;\r\n }\r\n </style>\r\n</head>\r\n\r\n<body>\r\n <svg>\r\n <circle cx=\"150\" cy=\"150\" r=\"100\" fill=\"red\" />\r\n </svg>\r\n\r\n</body>\r\n\r\n</html>\r\n"
return __etcpack__scope_bundle__;
}
|
/*****************************************************************/
window.__etcpack__bundleSrc__['43']=function(){
var __etcpack__scope_bundle__={};
|
|
sum.js
|
function(head, req) {
var row, out, sum = 0, sep = '\n';
|
if (req.headers.Accept.indexOf('application/json')!=-1)
start({"headers":{"Content-Type" : "application/json"}});
else
start({"headers":{"Content-Type" : "text/plain"}});
if ('callback' in req.query) send(req.query['callback'] + "(");
while (row = getRow()) {
sum += parseFloat(row.value);
}
out = JSON.stringify(sum);
send(out);
if ('callback' in req.query) send(")");
};
|
// Send the same Content-Type as CouchDB would
|
conftest.py
|
# -*- coding: utf-8 -*-
import datetime
import logging
import os
from unittest import mock
import pytest
import elastalert.elastalert
import elastalert.util
from elastalert.util import dt_to_ts
from elastalert.util import ts_to_dt
writeback_index = 'wb'
def pytest_addoption(parser):
parser.addoption(
"--runelasticsearch", action="store_true", default=False, help="run elasticsearch tests"
)
def pytest_collection_modifyitems(config, items):
if config.getoption("--runelasticsearch"):
# --runelasticsearch given in cli: run elasticsearch tests, skip ordinary unit tests
skip_unit_tests = pytest.mark.skip(reason="not running when --runelasticsearch option is used to run")
for item in items:
if "elasticsearch" not in item.keywords:
item.add_marker(skip_unit_tests)
else:
# skip elasticsearch tests
skip_elasticsearch = pytest.mark.skip(reason="need --runelasticsearch option to run")
for item in items:
if "elasticsearch" in item.keywords:
item.add_marker(skip_elasticsearch)
@pytest.fixture(scope='function', autouse=True)
def reset_loggers():
"""Prevent logging handlers from capturing temporary file handles.
For example, a test that uses the `capsys` fixture and calls
`logging.exception()` will initialize logging with a default handler that
captures `sys.stderr`. When the test ends, the file handles will be closed
and `sys.stderr` will be returned to its original handle, but the logging
will have a dangling reference to the temporary handle used in the `capsys`
fixture.
"""
logger = logging.getLogger()
for handler in logger.handlers:
logger.removeHandler(handler)
class mock_es_indices_client(object):
def __init__(self):
self.exists = mock.Mock(return_value=True)
class mock_es_client(object):
def __init__(self, host='es', port=14900):
|
class mock_es_sixsix_client(object):
def __init__(self, host='es', port=14900):
self.host = host
self.port = port
self.return_hits = []
self.search = mock.Mock()
self.deprecated_search = mock.Mock()
self.create = mock.Mock()
self.index = mock.Mock()
self.delete = mock.Mock()
self.info = mock.Mock(return_value={'status': 200, 'name': 'foo', 'version': {'number': '6.6.0'}})
self.ping = mock.Mock(return_value=True)
self.indices = mock_es_indices_client()
self.es_version = mock.Mock(return_value='6.6.0')
self.is_atleastfive = mock.Mock(return_value=True)
self.is_atleastsix = mock.Mock(return_value=True)
self.is_atleastsixtwo = mock.Mock(return_value=False)
self.is_atleastsixsix = mock.Mock(return_value=True)
self.is_atleastseven = mock.Mock(return_value=False)
def writeback_index_side_effect(index, doc_type):
if doc_type == 'silence':
return index + '_silence'
elif doc_type == 'past_elastalert':
return index + '_past'
elif doc_type == 'elastalert_status':
return index + '_status'
elif doc_type == 'elastalert_error':
return index + '_error'
return index
self.resolve_writeback_index = mock.Mock(side_effect=writeback_index_side_effect)
class mock_rule_loader(object):
def __init__(self, conf):
self.base_config = conf
self.load = mock.Mock()
self.get_hashes = mock.Mock()
self.load_configuration = mock.Mock()
class mock_ruletype(object):
def __init__(self):
self.add_data = mock.Mock()
self.add_count_data = mock.Mock()
self.add_terms_data = mock.Mock()
self.matches = []
self.get_match_data = lambda x: x
self.get_match_str = lambda x: "some stuff happened"
self.garbage_collect = mock.Mock()
class mock_alert(object):
def __init__(self):
self.alert = mock.Mock()
def get_info(self):
return {'type': 'mock'}
@pytest.fixture
def ea():
rules = [{'es_host': '',
'es_port': 14900,
'name': 'anytest',
'index': 'idx',
'filter': [],
'include': ['@timestamp'],
'aggregation': datetime.timedelta(0),
'realert': datetime.timedelta(0),
'processed_hits': {},
'timestamp_field': '@timestamp',
'match_enhancements': [],
'rule_file': 'blah.yaml',
'max_query_size': 10000,
'ts_to_dt': ts_to_dt,
'dt_to_ts': dt_to_ts,
'_source_enabled': True,
'run_every': datetime.timedelta(seconds=15)}]
conf = {'rules_folder': 'rules',
'run_every': datetime.timedelta(minutes=10),
'buffer_time': datetime.timedelta(minutes=5),
'alert_time_limit': datetime.timedelta(hours=24),
'es_host': 'es',
'es_port': 14900,
'writeback_index': 'wb',
'rules': rules,
'max_query_size': 10000,
'old_query_limit': datetime.timedelta(weeks=1),
'disable_rules_on_error': False,
'scroll_keepalive': '30s',
'custom_pretty_ts_format': '%Y-%m-%d %H:%M'}
elastalert.util.elasticsearch_client = mock_es_client
conf['rules_loader'] = mock_rule_loader(conf)
elastalert.elastalert.elasticsearch_client = mock_es_client
with mock.patch('elastalert.elastalert.load_conf') as load_conf:
with mock.patch('elastalert.elastalert.BackgroundScheduler'):
load_conf.return_value = conf
conf['rules_loader'].load.return_value = rules
conf['rules_loader'].get_hashes.return_value = {}
ea = elastalert.elastalert.ElastAlerter(['--pin_rules'])
ea.rules[0]['type'] = mock_ruletype()
ea.rules[0]['alert'] = [mock_alert()]
ea.writeback_es = mock_es_client()
ea.writeback_es.search.return_value = {'hits': {'hits': []}, 'total': 0}
ea.writeback_es.deprecated_search.return_value = {'hits': {'hits': []}}
ea.writeback_es.index.return_value = {'_id': 'ABCD', 'created': True}
ea.current_es = mock_es_client('', '')
ea.thread_data.current_es = ea.current_es
ea.thread_data.num_hits = 0
ea.thread_data.num_dupes = 0
return ea
@pytest.fixture
def ea_sixsix():
rules = [{'es_host': '',
'es_port': 14900,
'name': 'anytest',
'index': 'idx',
'filter': [],
'include': ['@timestamp'],
'run_every': datetime.timedelta(seconds=1),
'aggregation': datetime.timedelta(0),
'realert': datetime.timedelta(0),
'processed_hits': {},
'timestamp_field': '@timestamp',
'match_enhancements': [],
'rule_file': 'blah.yaml',
'max_query_size': 10000,
'ts_to_dt': ts_to_dt,
'dt_to_ts': dt_to_ts,
'_source_enabled': True}]
conf = {'rules_folder': 'rules',
'run_every': datetime.timedelta(minutes=10),
'buffer_time': datetime.timedelta(minutes=5),
'alert_time_limit': datetime.timedelta(hours=24),
'es_host': 'es',
'es_port': 14900,
'writeback_index': writeback_index,
'rules': rules,
'max_query_size': 10000,
'old_query_limit': datetime.timedelta(weeks=1),
'disable_rules_on_error': False,
'scroll_keepalive': '30s',
'custom_pretty_ts_format': '%Y-%m-%d %H:%M'}
conf['rules_loader'] = mock_rule_loader(conf)
elastalert.elastalert.elasticsearch_client = mock_es_sixsix_client
elastalert.util.elasticsearch_client = mock_es_sixsix_client
with mock.patch('elastalert.elastalert.load_conf') as load_conf:
with mock.patch('elastalert.elastalert.BackgroundScheduler'):
load_conf.return_value = conf
conf['rules_loader'].load.return_value = rules
conf['rules_loader'].get_hashes.return_value = {}
ea_sixsix = elastalert.elastalert.ElastAlerter(['--pin_rules'])
ea_sixsix.rules[0]['type'] = mock_ruletype()
ea_sixsix.rules[0]['alert'] = [mock_alert()]
ea_sixsix.writeback_es = mock_es_sixsix_client()
ea_sixsix.writeback_es.search.return_value = {'hits': {'hits': []}}
ea_sixsix.writeback_es.deprecated_search.return_value = {'hits': {'hits': []}}
ea_sixsix.writeback_es.index.return_value = {'_id': 'ABCD'}
ea_sixsix.current_es = mock_es_sixsix_client('', -1)
return ea_sixsix
@pytest.fixture(scope='function')
def environ():
"""py.test fixture to get a fresh mutable environment."""
old_env = os.environ
new_env = dict(list(old_env.items()))
os.environ = new_env
yield os.environ
os.environ = old_env
|
self.host = host
self.port = port
self.return_hits = []
self.search = mock.Mock()
self.deprecated_search = mock.Mock()
self.create = mock.Mock()
self.index = mock.Mock()
self.delete = mock.Mock()
self.info = mock.Mock(return_value={'status': 200, 'name': 'foo', 'version': {'number': '2.0'}})
self.ping = mock.Mock(return_value=True)
self.indices = mock_es_indices_client()
self.es_version = mock.Mock(return_value='2.0')
self.is_atleastfive = mock.Mock(return_value=False)
self.is_atleastsix = mock.Mock(return_value=False)
self.is_atleastsixtwo = mock.Mock(return_value=False)
self.is_atleastsixsix = mock.Mock(return_value=False)
self.is_atleastseven = mock.Mock(return_value=False)
self.resolve_writeback_index = mock.Mock(return_value=writeback_index)
|
tests.py
|
from django.urls import reverse
from ietf.group.factories import GroupFactory, GroupEventFactory
from ietf.group.models import Group, GroupEvent
from ietf.person.models import Person
from ietf.utils.test_utils import TestCase
SECR_USER='secretary'
def
|
():
system = Person.objects.get(name="(System)")
area = Group.objects.get(acronym='farfut')
GroupEvent.objects.create(group=area,
type='started',
by=system)
class SecrAreasTestCase(TestCase):
def test_main(self):
"Main Test"
GroupFactory(type_id='area')
url = reverse('ietf.secr.areas.views.list_areas')
self.client.login(username="secretary", password="secretary+password")
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
def test_view(self):
"View Test"
area = GroupEventFactory(type='started',group__type_id='area').group
url = reverse('ietf.secr.areas.views.view', kwargs={'name':area.acronym})
self.client.login(username="secretary", password="secretary+password")
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
|
augment_data
|
test_client.py
|
# coding: utf-8
from django.test import TestCase
rst_markup = """
Sample Header
===============
Blah blah blah
Lower Header
-------------
Blah blah blah
"""
class TestAddForm(TestCase):
fixtures = ["test_tasks.json"]
urls = "tasks.tests.tasks_urls"
|
def setUp(self):
self.client.login(username="admin", password="test")
def tearDown(self):
pass
def test_add_buttons(self):
response = self.client.get("/tasks/add/")
# Check that the response is 200 OK.
self.failUnlessEqual(response.status_code, 200)
# check that there is an add button
self.assertContains(response, '<input type="submit" value="Add task"/>')
# check that there is an add another task button
self.assertContains(response, "add-another-task")
def test_markup(self):
# create some sample form data
form_data = {
"summary": "my simple test",
"detail": rst_markup,
"markup": "rst",
"assignee": "",
"tags": ""
}
# post the form
response = self.client.post("/tasks/add/", form_data)
# display the resultant task
response = self.client.get("/tasks/task/3/")
# test the markup
self.assertContains(response, '<h1 class="title">Sample Header</h1>')
def test_tag_for_rel(self):
# checking for tag
response = self.client.get("/tasks/")
self.assertContains(response, '<a rel="tag" href="/tasks/tag/test/">test</a>')
| |
main.rs
|
// Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
extern crate criterion;
extern crate snapshot;
extern crate versionize;
extern crate versionize_derive;
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use snapshot::Snapshot;
use versionize::{VersionMap, Versionize, VersionizeError, VersionizeResult};
use versionize_derive::Versionize;
mod version_map;
#[derive(Clone, Debug, Default, Versionize)]
struct
|
{
dummy: Vec<Dummy>,
field_x: u64,
field0: u64,
field1: u32,
#[version(start = 2, default_fn = "field2_default")]
field2: u64,
#[version(
start = 3,
default_fn = "field3_default",
ser_fn = "field3_serialize",
de_fn = "field3_deserialize"
)]
field3: String,
#[version(
start = 4,
default_fn = "field4_default",
ser_fn = "field4_serialize",
de_fn = "field4_deserialize"
)]
field4: Vec<u64>,
}
#[derive(Clone, Debug, Default, Versionize)]
struct Dummy {
dummy: u64,
string: String,
}
impl Test {
fn field2_default(_: u16) -> u64 {
20
}
fn field3_default(_: u16) -> String {
"default".to_owned()
}
fn field4_default(_: u16) -> Vec<u64> {
vec![1, 2, 3, 4]
}
fn field4_serialize(&mut self, target_version: u16) -> VersionizeResult<()> {
// Fail if semantic serialization is called for the latest version.
assert_ne!(target_version, Test::version());
self.field0 = self.field4.iter().sum();
if self.field0 == 6666 {
return Err(VersionizeError::Semantic(
"field4 element sum is 6666".to_owned(),
));
}
Ok(())
}
fn field4_deserialize(&mut self, source_version: u16) -> VersionizeResult<()> {
// Fail if semantic deserialization is called for the latest version.
assert_ne!(source_version, Test::version());
self.field4 = vec![self.field0; 4];
Ok(())
}
fn field3_serialize(&mut self, target_version: u16) -> VersionizeResult<()> {
// Fail if semantic serialization is called for the previous versions only.
assert!(target_version < 3);
self.field_x += 1;
Ok(())
}
fn field3_deserialize(&mut self, source_version: u16) -> VersionizeResult<()> {
// Fail if semantic deserialization is called for the latest version.
assert!(source_version < 3);
self.field_x += 1;
if self.field0 == 7777 {
return Err(VersionizeError::Semantic("field0 is 7777".to_owned()));
}
Ok(())
}
}
#[inline]
pub fn bench_restore_v1(mut snapshot_mem: &[u8], vm: VersionMap, crc: bool) {
if crc {
Snapshot::load_with_crc64::<&[u8], Test>(&mut snapshot_mem, vm).unwrap();
} else {
Snapshot::load::<&[u8], Test>(&mut snapshot_mem, vm).unwrap();
}
}
#[inline]
pub fn bench_snapshot_v1<W: std::io::Write>(mut snapshot_mem: &mut W, vm: VersionMap, crc: bool) {
let state = Test {
dummy: vec![
Dummy {
dummy: 123,
string: "xxx".to_owned()
};
100
],
field0: 0,
field1: 1,
field2: 2,
field3: "test".to_owned(),
field4: vec![4; 1024 * 10],
field_x: 0,
};
let mut snapshot = Snapshot::new(vm.clone(), 4);
if crc {
snapshot.save_with_crc64(&mut snapshot_mem, &state).unwrap();
} else {
snapshot.save(&mut snapshot_mem, &state).unwrap();
}
}
pub fn criterion_benchmark(c: &mut Criterion) {
let mut snapshot_mem = vec![0u8; 1024 * 1024 * 128];
let mut vm = VersionMap::new();
vm.new_version()
.set_type_version(Test::type_id(), 2)
.new_version()
.set_type_version(Test::type_id(), 3)
.new_version()
.set_type_version(Test::type_id(), 4);
let mut slice = &mut snapshot_mem.as_mut_slice();
bench_snapshot_v1(&mut slice, vm.clone(), false);
let mut snapshot_len = slice.as_ptr() as usize - snapshot_mem.as_slice().as_ptr() as usize;
println!("Snapshot length: {} bytes", snapshot_len);
c.bench_function("Serialize to v4", |b| {
b.iter(|| {
bench_snapshot_v1(
black_box(&mut snapshot_mem.as_mut_slice()),
black_box(vm.clone()),
black_box(false),
)
})
});
c.bench_function("Deserialize to v4", |b| {
b.iter(|| {
bench_restore_v1(
black_box(&mut snapshot_mem.as_slice()),
black_box(vm.clone()),
black_box(false),
)
})
});
let another_slice = &mut snapshot_mem.as_mut_slice();
bench_snapshot_v1(another_slice, vm.clone(), true);
snapshot_len = another_slice.as_ptr() as usize - snapshot_mem.as_slice().as_ptr() as usize;
println!("Snapshot with crc64 length: {} bytes", snapshot_len);
c.bench_function("Serialize with crc64 to v4", |b| {
b.iter(|| {
bench_snapshot_v1(
black_box(&mut snapshot_mem.as_mut_slice()),
black_box(vm.clone()),
black_box(true),
)
})
});
c.bench_function("Deserialize with crc64 from v4", |b| {
b.iter(|| {
bench_restore_v1(
black_box(&mut snapshot_mem.as_slice()),
black_box(vm.clone()),
black_box(true),
)
})
});
}
criterion_group! {
name = benches;
config = Criterion::default().sample_size(200);
targets = criterion_benchmark
}
criterion_main! {
benches,
version_map::benches,
}
|
Test
|
tests.js
|
/* global describe, it */
import 'babel-polyfill';
import 'should';
import jsonNext from '../src/main';
describe('JsonNext', function() {
const myMap = new Map([['first', 'Benjamin'], ['last', 'Cisco']]);
const mySecondMap = new Map([['first', 'Jake'], ['last', 'Cisco']]);
myMap.set('second', mySecondMap);
const mySet = new Set(['Benjamin', 'Jake']);
const mySecondSet = new Set();
mySecondSet.add('me');
mySecondSet.add('you');
mySet.add(mySecondSet);
const myObj = {
name: 'Benjamin',
age: 37,
map: myMap,
set: mySet
};
describe('stringify', function() {
it('should take a JavaScript data object and return a JSON string', () => {
jsonNext.stringify({name: 'Benjamin', age: 37}).should.be.String();
});
});
describe('parse', function() {
const nestedDataObj = {
something: ['one', 'two', 'three'],
anything: {
someMap: new Map([
[ 'some', new Map([ ['some', 'thing'] ]) ],
[ 'other', new Map([['some', new Set(['some', 'thing']) ]]) ],
[ 'thing', new Set(['any', 'thing', new Map([['some', new Set(['some', 'thing']) ]])]) ],
[ 'another', 'thing' ]
]),
someSet: new Set( [new Set(['Benjamin', 'Jake']), new Set(['Miles', 'Molly'])] )
},
nums: [5435, 542543, 542, 54, 325, 42, 54, 325, 42],
arr: [
[543, 545, 54, 325, 4325, 432, 543, 254, 325, 34],
[159, 154 ,891, 4891, 18593, 1852, 888],
[543, 545, 54, 325, 4325, 432, 543, 254, 325, 34],
{
something: 'here',
too: {here: ['is', 'an', {}]}
}
]
};
|
data.should.be.Object();
data.name.should.be.String();
data.age.should.be.Number();
data.map.get('last').should.be.String();
data.map.get('second').get('first').should.be.String();
data.set.has('Benjamin').should.be.True();
[...[...data.set][2]][1].should.equal('you');
const arrDataObj = ['Ryan', 'Hannah'];
jsonNext.stringify(arrDataObj).should.equal(JSON.stringify({json_next_paths: [], data: arrDataObj}));
const objDataObj = {name: 'Ryan'};
jsonNext.stringify(objDataObj).should.equal(JSON.stringify({json_next_paths: [], data: objDataObj}));
const dataStr = 'something';
jsonNext.stringify(dataStr).should.equal(JSON.stringify({json_next_paths: [], data: dataStr}));
const dataNum = 1000;
jsonNext.stringify(dataNum).should.equal(JSON.stringify({json_next_paths: [], data: dataNum}));
const jsonString = '["one", "two", "three"]';
JSON.stringify(JSON.parse(jsonString)).should.equal(JSON.stringify(jsonNext.parse(jsonString)));
const parentMap = new Map([ ['someKey', 'someValue'], ['anotherKey', 'anotherValue'] ]);
const parentMapJson = jsonNext.stringify(parentMap);
parentMapJson.should.equal(jsonNext.stringify(jsonNext.parse(parentMapJson)));
const parentSet = new Set(['someValue', 'anotherValue']);
const parentSetJson = jsonNext.stringify(parentSet);
parentSetJson.should.equal(jsonNext.stringify(jsonNext.parse(parentSetJson)));
jsonNext.stringify(nestedDataObj).should.equal(jsonNext.stringify(jsonNext.parse(jsonNext.stringify(nestedDataObj))));
jsonNext.parse(jsonNext.stringify(nestedDataObj)).anything.someMap.get('thing').has('any').should.be.True();
});
});
});
|
it('should take a JSON string and return a JavaScript data object', () => {
const jsonStr = jsonNext.stringify(myObj);
const data = jsonNext.parse(jsonStr);
|
fuzz.go
|
// Copyright Istio Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// nolint: golint // Avoid it complaining about the Fuzz function name; it is required
package fuzz
import (
"istio.io/istio/pilot/pkg/config/kube/crd"
)
func FuzzParseInputs(data []byte) int
|
{
_, _, err := crd.ParseInputs(string(data))
if err != nil {
return 0
}
return 1
}
|
|
index.ts
|
export * from './shared-spec-context-with-protractor-keys';
|
||
abstract_markov_staghunt.py
|
from abc import ABC
from gym import Env
from gym_stag_hunt.src.utils import print_matrix
class AbstractMarkovStagHuntEnv(Env, ABC):
metadata = {
'render.modes': ['human', 'array'],
'obs.types': ['image', 'coords']
}
def __init__(self,
grid_size=(5, 5),
obs_type='image',
enable_multiagent=False
):
"""
:param grid_size: A (W, H) tuple corresponding to the grid dimensions. Although W=H is expected, W!=H works also
:param obs_type: Can be 'image' for pixel-array based observations, or 'coords' for just the entity coordinates
"""
total_cells = grid_size[0] * grid_size[1]
if total_cells < 3:
raise AttributeError('Grid is too small. Please specify a larger grid size.')
if obs_type not in self.metadata['obs.types']:
raise AttributeError('Invalid observation type provided. Please specify "image" or "coords"')
if grid_size[0] >= 255 or grid_size[1] >= 255:
raise AttributeError('Grid is too large. Please specify a smaller grid size.')
super(AbstractMarkovStagHuntEnv, self).__init__()
self.obs_type = obs_type
self.done = False
self.enable_multiagent = enable_multiagent
self.seed()
def step(self, actions):
"""
Run one timestep of the environment's dynamics.
:param actions: ints signifying actions for the agents. You can pass one, in which case the second agent does a
random move, or two, in which case each agent takes the specified action.
:return: observation, rewards, is the game done, additional info
"""
return self.game.update(actions)
def reset(self):
"""
Reset the game state
:return: initial observation
"""
self.game.reset_entities()
self.done = False
return self.game.get_observation()
def render(self, mode="human", obs=None):
"""
:param obs: observation data (passed for coord observations so we dont have to run the function twice)
:param mode: rendering mode
:return:
"""
if mode == 'human':
if self.obs_type == 'image':
self.game.RENDERER.render_on_display()
else:
if self.game.RENDERER:
self.game.RENDERER.update()
self.game.RENDERER.render_on_display()
else:
if obs is not None:
print_matrix(obs, self.game_title, self.game.GRID_DIMENSIONS)
else:
print_matrix(self.game.get_observation(), self.game_title, self.game.GRID_DIMENSIONS)
elif mode == 'array':
print_matrix(self.game._coord_observation(), self.game_title, self.game.GRID_DIMENSIONS)
def
|
(self):
"""
Closes all needed resources
:return:
"""
if self.game.RENDERER:
self.game.RENDERER.quit()
|
close
|
auth.controller.ts
|
"use strict";
import * as Hapi from "@hapi/hapi";
import { getDatabase, getClient } from "../helpers/db.helper";
import { getUserAuth, insertUserOne } from "../service/auth.service";
import { Models } from "../helpers/models.helper";
import UserAuth = Models.UserAuth;
import User = Models.User;
import Meta = Models.Meta;
const sanitize = require("mongo-sanitize");
const moment = require("moment");
const Bcrypt = require("bcrypt");
const ObjectId = require("mongodb").ObjectID;
const Jwt = require("jsonwebtoken");
import { decryptJwt } from "../helpers/auth.helper";
/**
* @param req Request object
* @param h Handler of the response
*/
export const login = async (req: any, h: Hapi.ResponseToolkit) => {
//Retrieve user input and set default values
let { email, password } = req.payload;
// Sanitize user input
email = sanitize(email);
password = sanitize(password);
// Get userAuth from DB
const db = await getDatabase(req.server);
let userAuth = await getUserAuth(db, { email: email }, {});
if (!userAuth) return h.response("Incorrect email or password").code(409);
// Check if the password matches
if (!(await Bcrypt.compare(password, userAuth.password))) {
return h.response("Incorrect email or password").code(409);
}
// Set user scope
userAuth.scope = [userAuth.role];
// Create and assign a new access token
const accessToken = Jwt.sign(
{ _id: userAuth._id, browserId: req.info.id, scope: userAuth.scope },
req.server.app.jwtAccessTokenSecret
);
return h
.response({
token: accessToken,
user: userAuth,
})
.code(200);
};
/**
* @param req Request object
* @param h Handler of the response
*/
export const register = async (req: any, h: Hapi.ResponseToolkit) => {
//Retrieve user input and set default values
let { email, password }: UserAuth = req.payload;
let { firstName, lastName }: User = req.payload;
// Sanitize user input
email = sanitize(email).toLowerCase();
password = sanitize(password);
firstName = sanitize(firstName);
lastName = sanitize(lastName);
// Check if the user exists
const db = await getDatabase(req.server);
const client = await getClient(req.server);
let authAccount = await getUserAuth(db, { email: email }, { email: 1 });
if (authAccount) return h.response("Mail is already in use").code(409);
// Hash password
const hashedPassword = Bcrypt.hashSync(password, Bcrypt.genSaltSync(10));
// Add meta information
const meta: Meta = {
|
// Insertion
const userAuth: UserAuth = {
email: email,
password: hashedPassword,
role: "user",
user: "",
meta: meta,
};
const user: User = { firstName: firstName, lastName: lastName, meta: meta };
const data = await insertUserOne(db, client, userAuth, user);
if (!data) {
return h.response("Internal Server Error").code(503);
}
// Return values
return h.response(data).code(201);
};
/**
* @param req Request object
* @param h Handler of the response
*/
export const validate = async (req: any, h: Hapi.ResponseToolkit) => {
//Retrieve user input and set default values
let { token } = req.payload;
let decryptedToken;
// Sanitize user input
token = sanitize(token);
// Check if token is still valid
try {
decryptedToken = decryptJwt(token, req.server.app.jwtAccessTokenSecret);
} catch (err) {
return h
.response("Token is not valid anymore or could not be processed")
.code(409)
.takeover();
}
// Get userAuth from DB
const db = await getDatabase(req.server);
let userAuth = await getUserAuth(
db,
{ _id: ObjectId(decryptedToken._id) },
{}
);
if (!userAuth) return h.response("Could not get user information").code(409);
// Set user scope
userAuth.scope = [userAuth.role];
return h
.response({
token: token,
user: userAuth,
})
.code(200);
};
|
createdAt: moment().utc().format("DD-MM-YYYY HH:mm"),
modifiedAt: moment().utc().format("DD-MM-YYYY HH:mm"),
};
|
interest_model.rs
|
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use cosmwasm_bignumber::{Decimal256, Uint256};
use cosmwasm_std::HumanAddr;
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct InitMsg {
pub owner: HumanAddr,
pub base_rate: Decimal256,
pub interest_multiplier: Decimal256,
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum HandleMsg {
UpdateConfig {
owner: Option<HumanAddr>,
base_rate: Option<Decimal256>,
interest_multiplier: Option<Decimal256>,
},
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
Config {},
BorrowRate {
market_balance: Uint256,
total_liabilities: Decimal256,
total_reserves: Decimal256,
},
}
// We define a custom struct for each query response
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct ConfigResponse {
pub owner: HumanAddr,
pub base_rate: Decimal256,
pub interest_multiplier: Decimal256,
}
// We define a custom struct for each query response
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct
|
{
pub rate: Decimal256,
}
|
BorrowRateResponse
|
reduceMovePlayer.ts
|
import { DiceRoll } from 'rpg-dice-roller';
import { GRID_HEIGHT, GRID_WIDTH, PLAYER_BASE_ATTACK } from '../constants/config';
import { CreatureType } from '../constants/creatures';
import { CREATURES } from '../constants/creatures';
import { getTile, Tile } from '../constants/tiles';
|
import { Position } from '../typings/position';
import { getDijkstraMap } from '../utils/getDijkstraMap';
import { GameState } from './game';
import { initRound } from './initRound';
import { lootItem } from './lootItem';
import { tick } from './tick';
import { updateVisibility } from './updateVisibility';
const getNextPosition = (draft: GameState, moveDirection: MoveDirection): Position => {
let nextTileX: number;
let nextTileY: number;
switch (moveDirection) {
case 'Left':
nextTileX =
draft.playerPosition[0] > 0 ? draft.playerPosition[0] - 1 : draft.playerPosition[0];
nextTileY = draft.playerPosition[1];
break;
case 'Right':
nextTileX =
draft.playerPosition[0] < GRID_WIDTH
? draft.playerPosition[0] + 1
: draft.playerPosition[0];
nextTileY = draft.playerPosition[1];
break;
case 'Up':
nextTileX = draft.playerPosition[0];
nextTileY =
draft.playerPosition[1] > 0 ? draft.playerPosition[1] - 1 : draft.playerPosition[1];
break;
case 'Down':
nextTileX = draft.playerPosition[0];
nextTileY =
draft.playerPosition[1] < GRID_HEIGHT - 1
? draft.playerPosition[1] + 1
: draft.playerPosition[1];
}
return [nextTileX, nextTileY];
};
const getCanWalkToNextPosition = (
draft: GameState,
moveDirection: MoveDirection,
nextTile: Tile | undefined
): boolean => {
switch (moveDirection) {
case 'Left':
return draft.playerPosition[0] > 0 && nextTile?.canWalkThrough === true;
case 'Right':
return draft.playerPosition[0] < GRID_WIDTH - 1 && nextTile?.canWalkThrough === true;
case 'Up':
return draft.playerPosition[1] > 0 && nextTile?.canWalkThrough === true;
case 'Down':
return draft.playerPosition[1] < GRID_HEIGHT - 1 && nextTile?.canWalkThrough === true;
}
};
const moveToNewPosition = (draft: GameState, position: Position) => {
draft.currentMap[draft.playerPosition[1]][draft.playerPosition[0]].content = 0;
lootItem(draft, position);
draft.currentMap[position[1]][position[0]].content = 'Player';
draft.playerPosition = position;
draft.currentMap = updateVisibility(position, draft.currentMap);
draft.dijkstraMap = getDijkstraMap(
draft.currentMap.map((row) => row.map((cellData) => cellData.tile)),
position
);
};
const moveAndStayAtSamePosition = (draft: GameState, tileNameInSentence: string | undefined) => {
draft.interactionText = `You hit ${tileNameInSentence || ''}.`;
};
const attackCreature = (draft: GameState, id: string, type: CreatureType) => {
// Check if the attack hits
const creatureAC = CREATURES[type].baseAC;
const hitRoll = new DiceRoll('d20');
if (hitRoll.total < creatureAC) {
draft.eventLogs.push(`You miss the ${type}.`);
draft.sounds.push('miss');
return;
}
// Deal damage
const isCriticalHit = hitRoll.total === 20;
const dice = isCriticalHit ? `${PLAYER_BASE_ATTACK}*2` : PLAYER_BASE_ATTACK;
const damageRoll = new DiceRoll(dice);
const damage = damageRoll.total;
draft.creatures[id].hp = draft.creatures[id].hp - damage;
draft.hitsLastRound.push({ creatureId: id, damage });
draft.eventLogs.push(
`${isCriticalHit ? '[CRIT] ' : ''}You hit the ${type} for ${damage} damage!`
);
if (isCriticalHit) {
draft.sounds.push('crit');
} else {
draft.sounds.push('attack');
}
if (draft.creatures[id].hp > 0) {
draft.sounds.push(`${type}Pain` as keyof typeof SOUNDS);
}
};
export const reduceMovePlayer = (draft: GameState, moveDirection: MoveDirection): void => {
initRound(draft);
draft.moveDirection = moveDirection;
draft.waitStreak = 0;
const nextPosition = getNextPosition(draft, moveDirection);
const nextTileType = draft.currentMap[nextPosition[1]][nextPosition[0]].tile;
const nextTile = getTile(nextTileType);
const creature = draft.currentMap[nextPosition[1]][nextPosition[0]].creature;
if (creature) {
attackCreature(draft, creature.id, creature.type);
} else if (nextTile?.type === '>') {
draft.eventLogs.push(`You reached depth ${draft.depth + 1}!`);
draft.sounds.push('stairs');
return void draft.depth++;
} else if (getCanWalkToNextPosition(draft, moveDirection, nextTile)) {
moveToNewPosition(draft, nextPosition);
} else {
moveAndStayAtSamePosition(draft, nextTile?.nameInSentence);
}
tick(draft);
};
|
import { SOUNDS } from '../game-ui/hooks/useSoundsManager';
import { MoveDirection } from '../typings/moveDirection';
|
client_impl.go
|
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package pulsar
import (
"errors"
"fmt"
"net/url"
"time"
"github.com/golang/protobuf/proto"
log "github.com/sirupsen/logrus"
"github.com/apache/pulsar-client-go/pulsar/internal"
"github.com/apache/pulsar-client-go/pulsar/internal/auth"
"github.com/apache/pulsar-client-go/pulsar/internal/pb"
)
const (
defaultConnectionTimeout = 30 * time.Second
defaultOperationTimeout = 30 * time.Second
)
type client struct {
cnxPool internal.ConnectionPool
rpcClient internal.RPCClient
handlers internal.ClientHandlers
lookupService internal.LookupService
}
func
|
(options ClientOptions) (Client, error) {
if options.URL == "" {
return nil, newError(ResultInvalidConfiguration, "URL is required for client")
}
url, err := url.Parse(options.URL)
if err != nil {
log.WithError(err).Error("Failed to parse service URL")
return nil, newError(ResultInvalidConfiguration, "Invalid service URL")
}
var tlsConfig *internal.TLSOptions
switch url.Scheme {
case "pulsar":
tlsConfig = nil
case "pulsar+ssl":
tlsConfig = &internal.TLSOptions{
AllowInsecureConnection: options.TLSAllowInsecureConnection,
TrustCertsFilePath: options.TLSTrustCertsFilePath,
ValidateHostname: options.TLSValidateHostname,
}
default:
return nil, newError(ResultInvalidConfiguration, fmt.Sprintf("Invalid URL scheme '%s'", url.Scheme))
}
var authProvider auth.Provider
var ok bool
if options.Authentication == nil {
authProvider = auth.NewAuthDisabled()
} else {
authProvider, ok = options.Authentication.(auth.Provider)
if !ok {
return nil, errors.New("invalid auth provider interface")
}
}
connectionTimeout := options.ConnectionTimeout
if connectionTimeout.Nanoseconds() == 0 {
connectionTimeout = defaultConnectionTimeout
}
operationTimeout := options.OperationTimeout
if operationTimeout.Nanoseconds() == 0 {
operationTimeout = defaultOperationTimeout
}
c := &client{
cnxPool: internal.NewConnectionPool(tlsConfig, authProvider, connectionTimeout),
}
c.rpcClient = internal.NewRPCClient(url, c.cnxPool, operationTimeout)
c.lookupService = internal.NewLookupService(c.rpcClient, url, tlsConfig != nil)
c.handlers = internal.NewClientHandlers()
return c, nil
}
func (c *client) CreateProducer(options ProducerOptions) (Producer, error) {
producer, err := newProducer(c, &options)
if err == nil {
c.handlers.Add(producer)
}
return producer, err
}
func (c *client) Subscribe(options ConsumerOptions) (Consumer, error) {
consumer, err := newConsumer(c, options)
if err != nil {
return nil, err
}
c.handlers.Add(consumer)
return consumer, nil
}
func (c *client) CreateReader(options ReaderOptions) (Reader, error) {
reader, err := newReader(c, options)
if err != nil {
return nil, err
}
c.handlers.Add(reader)
return reader, nil
}
func (c *client) TopicPartitions(topic string) ([]string, error) {
topicName, err := internal.ParseTopicName(topic)
if err != nil {
return nil, err
}
id := c.rpcClient.NewRequestID()
res, err := c.rpcClient.RequestToAnyBroker(id, pb.BaseCommand_PARTITIONED_METADATA,
&pb.CommandPartitionedTopicMetadata{
RequestId: &id,
Topic: &topicName.Name,
})
if err != nil {
return nil, err
}
r := res.Response.PartitionMetadataResponse
if r != nil {
if r.Error != nil {
return nil, newError(ResultLookupError, r.GetError().String())
}
if r.GetPartitions() > 0 {
partitions := make([]string, r.GetPartitions())
for i := 0; i < int(r.GetPartitions()); i++ {
partitions[i] = fmt.Sprintf("%s-partition-%d", topic, i)
}
return partitions, nil
}
}
// Non-partitioned topic
return []string{topicName.Name}, nil
}
func (c *client) Close() {
c.handlers.Close()
}
func (c *client) namespaceTopics(namespace string) ([]string, error) {
id := c.rpcClient.NewRequestID()
req := &pb.CommandGetTopicsOfNamespace{
RequestId: proto.Uint64(id),
Namespace: proto.String(namespace),
Mode: pb.CommandGetTopicsOfNamespace_PERSISTENT.Enum(),
}
res, err := c.rpcClient.RequestToAnyBroker(id, pb.BaseCommand_GET_TOPICS_OF_NAMESPACE, req)
if err != nil {
return nil, err
}
if res.Response.Error != nil {
return []string{}, newError(ResultLookupError, res.Response.GetError().String())
}
return res.Response.GetTopicsOfNamespaceResponse.GetTopics(), nil
}
|
newClient
|
main_test.go
|
package main
import (
"testing"
)
func TestAbs(t *testing.T) {
got := welcomeMessage()
if got != "Hi" {
t.Errorf("welcomeMessage() = %s; want Hi", got)
}
}
func TestReadAuthors(t *testing.T)
|
{
authors := readAuthors("resources/authors_test.csv")
var author = authors[0]
if len(authors) != 1 {
t.Errorf("readAuthors is not removing the first line of the file (header)")
}
if author.firstName != "Paul" {
t.Errorf("Read firstName incorretly")
}
if author.lastName != "Walter" {
t.Errorf("Read lastName incorretly")
}
if author.email != "[email protected]" {
t.Errorf("Read email incorretly")
}
}
|
|
documentkeys.py
|
# -*- coding: utf-8 -*-
from basetestcase import BaseTestCase
from couchbase_helper.documentgenerator import doc_generator
from membase.api.rest_client import RestConnection
from couchbase_helper.document import View
class DocumentKeysTests(BaseTestCase):
def setUp(self):
super(DocumentKeysTests, self).setUp()
nodes_init = self.cluster.servers[1:self.nodes_init] \
if self.nodes_init != 1 else []
self.task.rebalance([self.cluster.master], nodes_init, [])
self.cluster.nodes_in_cluster.extend([self.cluster.master]+nodes_init)
self.bucket_util.create_default_bucket(
bucket_type=self.bucket_type,
replica=self.num_replicas,
storage=self.bucket_storage,
eviction_policy=self.bucket_eviction_policy)
self.bucket_util.add_rbac_user()
self.cluster_util.print_cluster_stats()
self.bucket_util.print_bucket_stats()
self.log.info("====== DocumentKeysTests setUp complete ======")
def tearDown(self):
super(DocumentKeysTests, self).tearDown()
def _persist_and_verify(self):
"""
Helper function to wait for persistence and
then verify data/stats on all buckets
"""
self.bucket_util._wait_for_stats_all_buckets()
self.bucket_util.verify_stats_all_buckets(self.num_items)
"""Helper function to verify the data using view query"""
def _verify_with_views(self, expected_rows):
for bucket in self.bucket_util.buckets:
default_map_func = 'function (doc, meta) { emit(meta.id, null);}'
default_view = View("View", default_map_func, None, False)
|
ddoc_name = "key_ddoc"
self.bucket_util.create_views(
self.cluster.master, ddoc_name, [default_view], bucket.name)
query = {"stale": "false", "connection_timeout": 60000}
self.bucket_util.query_view(self.cluster.master, ddoc_name,
default_view.name, query,
expected_rows, bucket=bucket.name)
"""
Perform create/update/delete data ops on the input document key and verify
"""
def _dockey_data_ops(self, dockey="dockey"):
target_vb = None
if self.target_vbucket is not None:
target_vb = [self.target_vbucket]
gen_load = doc_generator(dockey, 0, self.num_items,
key_size=self.key_size,
doc_size=self.doc_size,
doc_type=self.doc_type,
vbuckets=self.cluster_util.vbuckets,
target_vbucket=target_vb)
bucket = self.bucket_util.get_all_buckets()[0]
for op_type in ["create", "update", "delete"]:
task = self.task.async_load_gen_docs(
self.cluster, bucket, gen_load, op_type, 0, batch_size=20,
persist_to=self.persist_to, replicate_to=self.replicate_to,
durability=self.durability_level,
timeout_secs=self.sdk_timeout,
sdk_client_pool=self.sdk_client_pool)
self.task.jython_task_manager.get_task_result(task)
if op_type == "delete":
self.num_items = 0
self._persist_and_verify()
"""Perform verification with views after loading data"""
def _dockey_views(self, dockey="dockey"):
gen_load = doc_generator(dockey, 0, self.num_items,
key_size=self.key_size,
doc_size=self.doc_size,
doc_type=self.doc_type,
vbuckets=self.cluster_util.vbuckets)
bucket = self.bucket_util.get_all_buckets()[0]
task = self.task.async_load_gen_docs(self.cluster, bucket,
gen_load, "create", 0,
batch_size=20,
persist_to=self.persist_to,
replicate_to=self.replicate_to,
durability=self.durability_level,
timeout_secs=self.sdk_timeout,
sdk_client_pool=self.sdk_client_pool)
self.task.jython_task_manager.get_task_result(task)
self._persist_and_verify()
self._verify_with_views(self.num_items)
"""
This function loads data in bucket and waits for persistence.
One node is failed over after that and it is verified,
data can be retrieved
"""
def _dockey_dcp(self, dockey="dockey"):
gen_load = doc_generator(dockey, 0, self.num_items,
key_size=self.key_size,
doc_size=self.doc_size,
doc_type=self.doc_type,
vbuckets=self.cluster_util.vbuckets)
bucket = self.bucket_util.get_all_buckets()[0]
task = self.task.async_load_gen_docs(self.cluster, bucket,
gen_load, "create", 0,
batch_size=20,
persist_to=self.persist_to,
replicate_to=self.replicate_to,
durability=self.durability_level,
timeout_secs=self.sdk_timeout,
sdk_client_pool=self.sdk_client_pool)
self.task.jython_task_manager.get_task_result(task)
self._persist_and_verify()
# assert if there are not enough nodes to failover
rest = RestConnection(self.cluster.master)
num_nodes = len(rest.node_statuses())
self.assertTrue(num_nodes > 1,
"ERROR: Not enough nodes to do failover")
# failover 1 node(we have 1 replica) and verify the keys
rest = RestConnection(self.cluster.master)
node_status = rest.node_statuses()
for node_to_failover in self.servers[(num_nodes - 1):num_nodes]:
for node in node_status:
if node_to_failover.ip == node.ip \
and int(node_to_failover.port) == int(node.port):
rest.fail_over(node.id, graceful=False)
self.cluster.nodes_in_cluster = \
list(set(self.cluster.nodes_in_cluster)
- set(self.servers[(num_nodes - 1):num_nodes]))
self._persist_and_verify()
def test_dockey_whitespace_data_ops(self):
generic_key = "d o c k e y"
if self.key_size:
self.key_size = self.key_size-len(generic_key)
generic_key = generic_key + "_" * self.key_size
self._dockey_data_ops(generic_key)
def test_dockey_binary_data_ops(self):
generic_key = "d\ro\nckey"
if self.key_size:
self.key_size = self.key_size-len(generic_key)
generic_key = generic_key + "\n" * self.key_size
self._dockey_data_ops(generic_key)
def test_dockey_unicode_data_ops(self):
generic_key = "\u00CA"
if self.key_size:
self.key_size = self.key_size-len(generic_key)
generic_key = generic_key + "é" * self.key_size
self._dockey_data_ops(generic_key)
def test_dockey_whitespace_views(self):
self._dockey_views("doc key ")
def test_dockey_binary_views(self):
self._dockey_views("docke\0y\n")
def test_dockey_unicode_views(self):
self._dockey_views("México")
def test_dockey_whitespace_dcp(self):
self._dockey_dcp("d o c k e y")
def test_dockey_binary_dcp(self):
self._dockey_dcp("d\rocke\0y")
def test_dockey_unicode_dcp(self):
self._dockey_dcp("привет")
| |
cqrs_consume.py
|
# Copyright © 2021 Ingram Micro Inc. All rights reserved.
from multiprocessing import Process
from dj_cqrs.registries import ReplicaRegistry
from dj_cqrs.transport import current_transport
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
help = 'Starts CQRS worker, which consumes messages from message queue.'
def add_arguments(self, parser):
parser.add_argument('--workers', '-w', help='Number of workers', type=int, default=0)
parser.add_argument(
'--cqrs-id',
'-cid',
nargs='*',
type=str,
help='Choose model(s) by CQRS_ID for consuming',
)
def handle(self, *args, **options):
consume_kwargs = {}
|
if options.get('cqrs_id'):
cqrs_ids = set()
for cqrs_id in options['cqrs_id']:
model = ReplicaRegistry.get_model_by_cqrs_id(cqrs_id)
if not model:
raise CommandError('Wrong CQRS ID: {0}!'.format(cqrs_id))
cqrs_ids.add(cqrs_id)
consume_kwargs['cqrs_ids'] = cqrs_ids
if options['workers'] <= 1:
current_transport.consume(**consume_kwargs)
return
pool = []
for _ in range(options['workers']):
p = Process(target=current_transport.consume, kwargs=consume_kwargs)
pool.append(p)
p.start()
for p in pool:
p.join()
| |
label_image_flask.py
|
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
from flask import Flask, escape, request, jsonify
import argparse
import sys
import time
import numpy as np
import requests
import tensorflow as tf
app = Flask(__name__)
@app.route('/')
def
|
():
file_name = "tf_files/flower_photos/daisy/3475870145_685a19116d.jpg"
model_file = "../tf_files/retrained_graph.pb"#add ../ at beginning if running from scripts folder. If running from classiefier folder
#e.g.python -m scripts.label_image_flask --graph=tf_files/retrained_graph.pb --image=caterCard.png
label_file = "tf_files/retrained_labels.txt"
input_height = 224
input_width = 224
input_mean = 128
input_std = 128
input_layer = "input"
output_layer = "final_result"
parser = argparse.ArgumentParser()
parser.add_argument("--image", help="image to be processed")
# parser.add_argument(request.args.get('image'))
parser.add_argument("--graph", help="graph/model to be executed")
parser.add_argument("--labels", help="name of file containing labels")
parser.add_argument("--input_height", type=int, help="input height")
parser.add_argument("--input_width", type=int, help="input width")
parser.add_argument("--input_mean", type=int, help="input mean")
parser.add_argument("--input_std", type=int, help="input std")
parser.add_argument("--input_layer", help="name of input layer")
parser.add_argument("--output_layer", help="name of output layer")
# testString = request.args.get('str')
# graph = "../tf_files/retrained_graph.pb"
args = parser.parse_args()
if args.graph:
model_file = args.graph
# if args.image:
# file_name = args.image
file_name = request.args.get('img')
if args.labels:
label_file = args.labels
if args.input_height:
input_height = args.input_height
if args.input_width:
input_width = args.input_width
if args.input_mean:
input_mean = args.input_mean
if args.input_std:
input_std = args.input_std
if args.input_layer:
input_layer = args.input_layer
if args.output_layer:
output_layer = args.output_layer
graph = load_graph(model_file)
t = read_tensor_from_image_url(file_name,
input_height=input_height,
input_width=input_width,
input_mean=input_mean,
input_std=input_std)
input_name = "import/" + input_layer
output_name = "import/" + output_layer
input_operation = graph.get_operation_by_name(input_name);
output_operation = graph.get_operation_by_name(output_name);
with tf.Session(graph=graph) as sess:
start = time.time()
results = sess.run(output_operation.outputs[0],
{input_operation.outputs[0]: t})
end=time.time()
results = np.squeeze(results)
top_k = results.argsort()[-5:][::-1]
labels = load_labels(label_file)
print('\nEvaluation time (1-image): {:.3f}s\n'.format(end-start))
template = '"name":"{}", "score":"{:0.5f}"'
stringToReturn = '{"possible_pokemon": ['
listOfPossiblePokes = []
for i in top_k:
listOfPossiblePokes.append({'name':labels[i],'score':str(results[i])})
# print(template.format(labels[i], results[i]))
stringToReturn += "{" + template.format(labels[i], results[i])+"},"
stringToReturn = stringToReturn[:-1]#THIS REMOVES THE LAST COMMA
stringToReturn += ']}'
# print(jsonify(listOfPossiblePokes))
return jsonify({'possible_pokemon':listOfPossiblePokes})
# return (stringToReturn)
# return "<h1>Label Image Server!</h1>" + "\n<h2>enter</h2>"
def load_graph(model_file):
graph = tf.Graph()
graph_def = tf.GraphDef()
with open(model_file, "rb") as f:
graph_def.ParseFromString(f.read())
with graph.as_default():
tf.import_graph_def(graph_def)
return graph
def read_tensor_from_image_file(file_name, input_height=299, input_width=299,
input_mean=0, input_std=255):
input_name = "file_reader"
output_name = "normalized"
file_reader = tf.read_file(file_name, input_name)
if file_name.endswith(".png"):
image_reader = tf.image.decode_png(file_reader, channels = 3,
name='png_reader')
elif file_name.endswith(".gif"):
image_reader = tf.squeeze(tf.image.decode_gif(file_reader,
name='gif_reader'))
elif file_name.endswith(".bmp"):
image_reader = tf.image.decode_bmp(file_reader, name='bmp_reader')
else:
image_reader = tf.image.decode_jpeg(file_reader, channels = 3,
name='jpeg_reader')
# image_reader = tf.image.decode_jpeg(
# requests.get(file_name).content, channels=3, name="jpeg_reader")
float_caster = tf.cast(image_reader, tf.float32)
dims_expander = tf.expand_dims(float_caster, 0);
resized = tf.image.resize_bilinear(dims_expander, [input_height, input_width])
normalized = tf.divide(tf.subtract(resized, [input_mean]), [input_std])
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
sess = tf.Session(config=config)
# sess = tf.Session()
result = sess.run(normalized)
return result
def read_tensor_from_image_url(url, input_height=299, input_width=299,
input_mean=0, input_std=255):
input_name = "file_reader"
output_name = "normalized"
file_reader = tf.read_file(url, input_name)
if url.endswith(".png"):
image_reader = tf.image.decode_png(requests.get(url).content, channels = 3,
name='png_reader')
elif url.endswith(".gif"):
image_reader = tf.squeeze(tf.image.decode_gif(requests.get(url).content,
name='gif_reader'))
elif url.endswith(".bmp"):
image_reader = tf.image.decode_bmp(requests.get(url).content, name='bmp_reader')
else:
image_reader = tf.image.decode_jpeg(
requests.get(url).content, channels=3, name="jpeg_reader")
float_caster = tf.cast(image_reader, tf.float32)
dims_expander = tf.expand_dims(float_caster, 0);
resized = tf.image.resize_bilinear(dims_expander, [input_height, input_width])
normalized = tf.divide(tf.subtract(resized, [input_mean]), [input_std])
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
sess = tf.Session(config=config)
# sess = tf.Session()
result = sess.run(normalized)
return result
def load_labels(label_file):
label = []
proto_as_ascii_lines = tf.io.gfile.GFile(label_file).readlines()
for l in proto_as_ascii_lines:
label.append(l.rstrip())
return label
if __name__ == "__main__":
app.run(debug=True, port=3008, host='0.0.0.0')
# file_name = "tf_files/flower_photos/daisy/3475870145_685a19116d.jpg"
# model_file = "tf_files/retrained_graph.pb"
# label_file = "tf_files/retrained_labels.txt"
# input_height = 224
# input_width = 224
# input_mean = 128
# input_std = 128
# input_layer = "input"
# output_layer = "final_result"
#
# parser = argparse.ArgumentParser()
# parser.add_argument("--image", help="image to be processed")
# parser.add_argument("--graph", help="graph/model to be executed")
# parser.add_argument("--labels", help="name of file containing labels")
# parser.add_argument("--input_height", type=int, help="input height")
# parser.add_argument("--input_width", type=int, help="input width")
# parser.add_argument("--input_mean", type=int, help="input mean")
# parser.add_argument("--input_std", type=int, help="input std")
# parser.add_argument("--input_layer", help="name of input layer")
# parser.add_argument("--output_layer", help="name of output layer")
# mainServer(parser)
|
mainServer
|
__init__.py
|
from .mode_actions_sampler import ModeActionSampler
|
from .disentangling_test import DisentanglingTester
|
|
upload_druglabels.py
|
import os
import biothings, config
biothings.config_for_app(config)
import biothings.hub.dataload.uploader
from .parser import load_druglabels
class DrugLabelsUploader(biothings.hub.dataload.uploader.BaseSourceUploader):
|
main_source = "pharmgkb"
name = "druglabels"
__metadata__ = {"src_meta": {}}
idconverter = None
storage_class = biothings.hub.dataload.storage.BasicStorage
def load_data(self, data_folder):
self.logger.info("Load data from directory: '%s'" % data_folder)
return load_druglabels(data_folder)
@classmethod
def get_mapping(klass):
return {}
|
|
export_windows_test.go
|
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Export guts for testing.
package runtime
import "unsafe"
var TestingWER = &testingWER
func NumberOfProcessors() int32
|
{
var info systeminfo
stdcall1(_GetSystemInfo, uintptr(unsafe.Pointer(&info)))
return int32(info.dwnumberofprocessors)
}
|
|
product.test.ts
|
import Product from '../../src/models/Product'
import ProductService from '../../src/services/product'
import * as dbHelper from '../db-helper'
// const nonExistingProductId = '5e57b77b5744fa0b461c7906'
const nonExistingProductId = '5ee1337ba4538021340e7d97'
async function
|
() {
const product = new Product({
name: 'T-Shirt',
category: { gender: ['boy'], categoryOfClothes: ['T-Shirt'] },
variant: { size: ['5 years old'], color: ['white'] },
})
return await ProductService.createProduct(product)
}
describe('product service', () => {
beforeEach(async () => {
await dbHelper.connect()
})
afterEach(async () => {
await dbHelper.clearDatabase()
})
afterAll(async () => {
await dbHelper.closeDatabase()
})
it('should create a product', async () => {
const product = await createProduct()
expect(product).toHaveProperty('id')
expect(product).toHaveProperty('name', 'T-Shirt')
expect(product).toHaveProperty(
'category',
expect.objectContaining({
gender: expect.arrayContaining(['boy']),
categoryOfClothes: expect.arrayContaining(['T-Shirt']),
})
)
expect(product).toHaveProperty(
'variant',
expect.objectContaining({
size: expect.arrayContaining(['5 years old']),
color: expect.arrayContaining(['white']),
})
)
})
it('should get all products', async () => {
const product = await createProduct()
const foundProduct = await ProductService.findAll()
expect(foundProduct).toEqual(
expect.arrayContaining([
expect.objectContaining({
__v: product.__v,
_id: product._id,
name: product.name,
variant: expect.objectContaining({
color: expect.arrayContaining(['white']),
size: expect.arrayContaining(['5 years old']),
}),
category: expect.objectContaining({
categoryOfClothes: expect.arrayContaining(['T-Shirt']),
gender: expect.arrayContaining(['boy']),
}),
}),
])
)
})
it('should get products by query', async () => {
const product = await createProduct()
const foundProduct = await ProductService.findByQuery({ name: 'T-Shirt' })
expect(foundProduct).toEqual(
expect.arrayContaining([
expect.objectContaining({
__v: product.__v,
_id: product._id,
name: 'T-Shirt',
variant: expect.objectContaining({
color: expect.arrayContaining(['white']),
size: expect.arrayContaining(['5 years old']),
}),
category: expect.objectContaining({
categoryOfClothes: expect.arrayContaining(['T-Shirt']),
gender: expect.arrayContaining(['boy']),
}),
}),
])
)
})
it('should not get a non-existing product query', async () => {
expect.assertions(1)
return ProductService.findByQuery({ name: 'T-Shirt1' }).catch((e) => {
expect(e.message).toMatch('Product not found')
})
})
it('should get a product with id', async () => {
const product = await createProduct()
const foundProduct = await ProductService.findById(product._id)
expect(foundProduct._id).toEqual(product._id)
})
// Check https://jestjs.io/docs/en/asynchronous for more info about
// how to test async code, especially with error
it('should not get a non-existing product', async () => {
expect.assertions(1)
return ProductService.findById(nonExistingProductId).catch((e) => {
expect(e.message).toMatch('Product not found')
})
})
it('should update an existing product', async () => {
const product = await createProduct()
const update = {
name: 'T-Shirt',
category: { gender: ['girl'], categoryOfClothes: ['T-Shirt1'] },
variant: { color: ['red'], size: ['S'] },
}
const updated = await ProductService.updateProduct(product._id, update)
expect(updated).toHaveProperty('_id', product._id)
expect(updated.category.gender).toContain('girl')
expect(updated.name).toBe(update.name)
expect(updated.variant.size).toContain('S')
expect(updated.variant.color).toContain('red')
})
it('should not update a non-existing product', async () => {
expect.assertions(1)
const update = {
name: 'Shrek',
publishedYear: 2001,
}
return ProductService.updateProduct(nonExistingProductId, update).catch(
(e) => {
expect(e.message).toMatch('Product not found')
}
)
})
it('should delete an existing movie', async () => {
expect.assertions(1)
const product = await createProduct()
await ProductService.deleteProduct(product.id)
return ProductService.findById(product.id).catch((e) => {
expect(e.message).toBe('Product not found')
})
})
})
|
createProduct
|
contextManagerSubclass.py
|
class C(object):
def __enter__(self):
return self
|
class D(C):
def foo(self):
pass
with D() as cm:
cm.foo() # pass
| |
package_metadata_crd_rest.go
|
// Copyright 2021 VMware, Inc.
// SPDX-License-Identifier: Apache-2.0
package datapackaging
import (
"context"
"fmt"
"strings"
"time"
"github.com/vmware-tanzu/carvel-kapp-controller/pkg/apiserver/apis/datapackaging"
"github.com/vmware-tanzu/carvel-kapp-controller/pkg/apiserver/apis/datapackaging/validation"
installclient "github.com/vmware-tanzu/carvel-kapp-controller/pkg/client/clientset/versioned"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/apis/meta/internalversion"
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/apiserver/pkg/endpoints/request"
"k8s.io/apiserver/pkg/registry/rest"
"k8s.io/client-go/kubernetes"
)
const excludeGlobalPackagesAnn = "kapp-controller.carvel.dev/exclude-global-packages"
// PackageMetadataCRDREST is a rest implementation that proxies the rest endpoints provided by
// CRDs. This will allow us to introduce the api server without the
// complexities associated with custom storage options for now.
type PackageMetadataCRDREST struct {
crdClient installclient.Interface
nsClient kubernetes.Interface
globalNamespace string
}
var (
_ rest.StandardStorage = &PackageMetadataCRDREST{}
_ rest.ShortNamesProvider = &PackageMetadataCRDREST{}
)
func
|
(crdClient installclient.Interface, nsClient kubernetes.Interface, globalNS string) *PackageMetadataCRDREST {
return &PackageMetadataCRDREST{crdClient, nsClient, globalNS}
}
func (r *PackageMetadataCRDREST) ShortNames() []string {
return []string{"pkgm"}
}
func (r *PackageMetadataCRDREST) New() runtime.Object {
return &datapackaging.PackageMetadata{}
}
func (r *PackageMetadataCRDREST) NewList() runtime.Object {
return &datapackaging.PackageMetadataList{}
}
func (r *PackageMetadataCRDREST) NamespaceScoped() bool {
return true
}
func (r *PackageMetadataCRDREST) Create(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions) (runtime.Object, error) {
namespace := request.NamespaceValue(ctx)
client := NewPackageMetadataStorageClient(r.crdClient, NewPackageMetadataTranslator(namespace))
// Run Validations
if createValidation != nil {
if err := createValidation(ctx, obj); err != nil {
return nil, err
}
}
pkg := obj.(*datapackaging.PackageMetadata)
errs := validation.ValidatePackageMetadata(*pkg)
if len(errs) != 0 {
return nil, errors.NewInvalid(pkg.GroupVersionKind().GroupKind(), pkg.Name, errs)
}
// Update the data store
return client.Create(ctx, namespace, pkg, *options)
}
func (r *PackageMetadataCRDREST) shouldFetchGlobal(ctx context.Context, namespace string) bool {
ns, err := r.nsClient.CoreV1().Namespaces().Get(ctx, namespace, metav1.GetOptions{})
if err != nil {
return false
}
_, exclude := ns.ObjectMeta.Annotations[excludeGlobalPackagesAnn]
return namespace != r.globalNamespace && namespace != "" && !exclude
}
func (r *PackageMetadataCRDREST) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error) {
namespace := request.NamespaceValue(ctx)
client := NewPackageMetadataStorageClient(r.crdClient, NewPackageMetadataTranslator(namespace))
// Check targeted namespace
pkg, err := client.Get(ctx, namespace, name, *options)
if errors.IsNotFound(err) && r.shouldFetchGlobal(ctx, namespace) {
// check global namespace
pkg, err = client.Get(ctx, r.globalNamespace, name, *options)
}
return pkg, err
}
func (r *PackageMetadataCRDREST) List(ctx context.Context, options *internalversion.ListOptions) (runtime.Object, error) {
namespace := request.NamespaceValue(ctx)
client := NewPackageMetadataStorageClient(r.crdClient, NewPackageMetadataTranslator(namespace))
var pkgMetas []datapackaging.PackageMetadata
if r.shouldFetchGlobal(ctx, namespace) {
globalPackagesList, err := client.List(ctx, r.globalNamespace, r.internalToMetaListOpts(*options))
if err != nil {
return nil, err
}
pkgMetas = globalPackagesList.Items
}
// fetch list of namespaced packages (ns could be "")
namespacedPackageMetaList, err := client.List(ctx, namespace, r.internalToMetaListOpts(*options))
if err != nil {
return nil, err
}
namespacedPackageMetas := namespacedPackageMetaList.Items
pkgMetaIndex := make(map[string]int)
for i, pkgMeta := range pkgMetas {
// identifier for package will be namespace/name
identifier := pkgMeta.Namespace + "/" + pkgMeta.Name
pkgMetaIndex[identifier] = i
}
for _, pkgMeta := range namespacedPackageMetas {
// identifier for package will be namespace/name
identifier := pkgMeta.Namespace + "/" + pkgMeta.Name
if index, found := pkgMetaIndex[identifier]; found {
pkgMetas[index] = pkgMeta
} else {
pkgMetas = append(pkgMetas, pkgMeta)
}
}
packageList := &datapackaging.PackageMetadataList{
TypeMeta: namespacedPackageMetaList.TypeMeta,
ListMeta: namespacedPackageMetaList.ListMeta,
Items: pkgMetas,
}
return packageList, err
}
func (r *PackageMetadataCRDREST) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error) {
namespace := request.NamespaceValue(ctx)
client := NewPackageMetadataStorageClient(r.crdClient, NewPackageMetadataTranslator(namespace))
pkg, err := client.Get(ctx, namespace, name, metav1.GetOptions{})
if errors.IsNotFound(err) {
// Because kubetl does a get before sending an update, the presence
// of a global package may cause it to send a patch request, even though
// the package doesn't exist in the namespace. To service this, we must check
// if the package exists globally and then patch that instead of patching an empty
// package. If we try patching an empty obj the patch UpdatedObjectInfo will blow up.
patchingGlobal := true
pkg, err := client.Get(ctx, r.globalNamespace, name, metav1.GetOptions{})
if errors.IsNotFound(err) {
pkg = &datapackaging.PackageMetadata{}
patchingGlobal = false
}
updatedObj, err := objInfo.UpdatedObject(ctx, pkg)
if err != nil {
return nil, false, err
}
if createValidation != nil {
if err := createValidation(ctx, updatedObj); err != nil {
return nil, false, err
}
}
updatedPkg := updatedObj.(*datapackaging.PackageMetadata)
if patchingGlobal {
// we have to do this in case we are "patching" a global package
annotations := updatedPkg.ObjectMeta.Annotations
labels := updatedPkg.ObjectMeta.Labels
updatedPkg.ObjectMeta = metav1.ObjectMeta{}
updatedPkg.ObjectMeta.Name = name
updatedPkg.ObjectMeta.Namespace = namespace
updatedPkg.ObjectMeta.Annotations = annotations
updatedPkg.ObjectMeta.Labels = labels
}
obj, err := r.Create(ctx, updatedPkg, createValidation, &metav1.CreateOptions{TypeMeta: options.TypeMeta, DryRun: options.DryRun, FieldManager: options.FieldManager})
if err != nil {
return nil, true, err
}
return obj, true, nil
}
if err != nil {
return nil, false, err
}
updatedObj, err := objInfo.UpdatedObject(ctx, pkg)
if err != nil {
return nil, false, err
}
updatedPkg := updatedObj.(*datapackaging.PackageMetadata)
errList := validation.ValidatePackageMetadata(*updatedPkg)
if len(errList) != 0 {
return nil, false, errors.NewInvalid(updatedPkg.GroupVersionKind().GroupKind(), updatedPkg.Name, errList)
}
updatedPkg, err = client.Update(ctx, namespace, updatedPkg, *options)
return updatedPkg, false, err
}
func (r *PackageMetadataCRDREST) Delete(ctx context.Context, name string, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions) (runtime.Object, bool, error) {
namespace := request.NamespaceValue(ctx)
client := NewPackageMetadataStorageClient(r.crdClient, NewPackageMetadataTranslator(namespace))
pkg, err := client.Get(ctx, namespace, name, metav1.GetOptions{})
if errors.IsNotFound(err) {
return nil, true, err
}
if err != nil {
return nil, false, err
}
if deleteValidation != nil {
if err := deleteValidation(ctx, pkg); err != nil {
return nil, true, err
}
}
err = client.Delete(ctx, namespace, name, *options)
if err != nil {
return nil, false, err
}
return pkg, true, nil
}
func (r *PackageMetadataCRDREST) DeleteCollection(ctx context.Context, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions, listOptions *metainternalversion.ListOptions) (runtime.Object, error) {
namespace := request.NamespaceValue(ctx)
client := NewPackageMetadataStorageClient(r.crdClient, NewPackageMetadataTranslator(namespace))
list, err := client.List(ctx, namespace, r.internalToMetaListOpts(*listOptions))
if err != nil {
return nil, err
}
// check to see if we are deleting all the global packages. This isnt a great way to do this
deleteAllGlobal := false
{
filteredList, err := client.List(ctx, r.globalNamespace, r.internalToMetaListOpts(*listOptions))
if err != nil {
return nil, err
}
regularList, err := client.List(ctx, r.globalNamespace, metav1.ListOptions{})
if err != nil {
return nil, err
}
deleteAllGlobal = len(regularList.Items) == len(filteredList.Items)
}
if deleteAllGlobal {
err := r.deleteGlobalPackagesFromNS(ctx, namespace)
if err != nil {
return nil, errors.NewInternalError(fmt.Errorf("Removing global packages: %v", err))
}
}
var deletedPackages []datapackaging.PackageMetadata
for _, pkg := range list.Items {
// use crd delete for validations
_, _, err := r.Delete(ctx, pkg.Name, deleteValidation, options)
if err != nil && !errors.IsNotFound(err) {
break
}
deletedPackages = append(deletedPackages, pkg)
}
return &datapackaging.PackageMetadataList{Items: deletedPackages}, err
}
func (r *PackageMetadataCRDREST) Watch(ctx context.Context, options *internalversion.ListOptions) (watch.Interface, error) {
namespace := request.NamespaceValue(ctx)
client := NewPackageMetadataStorageClient(r.crdClient, NewPackageMetadataTranslator(namespace))
watcher, err := client.Watch(ctx, namespace, r.internalToMetaListOpts(*options))
if errors.IsNotFound(err) && r.shouldFetchGlobal(ctx, namespace) {
watcher, err = client.Watch(ctx, r.globalNamespace, r.internalToMetaListOpts(*options))
}
return watcher, err
}
func (r *PackageMetadataCRDREST) ConvertToTable(ctx context.Context, obj runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) {
var table metav1.Table
fn := func(obj runtime.Object) error {
pkg := obj.(*datapackaging.PackageMetadata)
table.Rows = append(table.Rows, metav1.TableRow{
Cells: []interface{}{
pkg.Name, pkg.Spec.DisplayName,
r.format(strings.Join(pkg.Spec.Categories, ",")),
r.format(pkg.Spec.ShortDescription),
time.Since(pkg.ObjectMeta.CreationTimestamp.Time).Round(1 * time.Second).String(),
},
Object: runtime.RawExtension{Object: obj},
})
return nil
}
switch {
case meta.IsListType(obj):
if err := meta.EachListItem(obj, fn); err != nil {
return nil, err
}
default:
if err := fn(obj); err != nil {
return nil, err
}
}
if m, err := meta.ListAccessor(obj); err == nil {
table.ResourceVersion = m.GetResourceVersion()
table.SelfLink = m.GetSelfLink()
table.Continue = m.GetContinue()
table.RemainingItemCount = m.GetRemainingItemCount()
} else {
if m, err := meta.CommonAccessor(obj); err == nil {
table.ResourceVersion = m.GetResourceVersion()
table.SelfLink = m.GetSelfLink()
}
}
if opt, ok := tableOptions.(*metav1.TableOptions); !ok || !opt.NoHeaders {
table.ColumnDefinitions = []metav1.TableColumnDefinition{
{Name: "Name", Type: "string", Format: "name", Description: "PackageMetadata resource name"},
{Name: "Display Name", Type: "string", Description: "User facing package name"},
{Name: "Categories", Type: "string", Description: "PackageMetadata description"},
{Name: "Short Description", Type: "array", Description: "PackageMetadata categories"},
{Name: "Age", Type: "date", Description: "Time since resource creation"},
}
}
return &table, nil
}
func (r *PackageMetadataCRDREST) internalToMetaListOpts(options internalversion.ListOptions) metav1.ListOptions {
lo := metav1.ListOptions{
TypeMeta: options.TypeMeta,
Watch: options.Watch,
AllowWatchBookmarks: options.AllowWatchBookmarks,
ResourceVersion: options.ResourceVersion,
ResourceVersionMatch: options.ResourceVersionMatch,
TimeoutSeconds: options.TimeoutSeconds,
Limit: options.Limit,
Continue: options.Continue,
}
if options.LabelSelector != nil {
lo.LabelSelector = options.LabelSelector.String()
}
if options.FieldSelector != nil {
lo.FieldSelector = options.FieldSelector.String()
}
return lo
}
func (r *PackageMetadataCRDREST) deleteGlobalPackagesFromNS(ctx context.Context, ns string) error {
namespace, err := r.nsClient.CoreV1().Namespaces().Get(ctx, ns, metav1.GetOptions{})
if err != nil {
return err
}
if namespace.ObjectMeta.Annotations == nil {
namespace.ObjectMeta.Annotations = make(map[string]string)
}
namespace.ObjectMeta.Annotations[excludeGlobalPackagesAnn] = ""
_, err = r.nsClient.CoreV1().Namespaces().Update(ctx, namespace, metav1.UpdateOptions{})
return err
}
func (r *PackageMetadataCRDREST) format(in string) string {
if len(in) > 50 {
return in[:47] + "..."
}
return in
}
|
NewPackageMetadataCRDREST
|
_variation_adding_mixin.py
|
# Copyright 2009-2017 Ram Rachum.
# This program is distributed under the MIT license.
from python_toolbox import caching
from python_toolbox import sequence_tools
# (`PermSpace` exported to here from `perm_space.py` to avoid import loop.)
class _VariationAddingMixin:
'''Mixin for `PermSpace` to add variations to a perm space.'''
def get_rapplied(self, sequence):
'''Get a version of this `PermSpace` that has a range of `sequence`.'''
if self.is_rapplied:
raise TypeError('This space is already rapplied, to rapply it to a '
'different sequence please use `.unrapplied` '
'first.')
sequence = \
sequence_tools.ensure_iterable_is_immutable_sequence(sequence)
if len(sequence) != self.sequence_length:
raise Exception
return PermSpace(
sequence, n_elements=self.n_elements, domain=self.domain,
fixed_map={key: sequence[value] for key, value in
self.fixed_map.items()},
degrees=self.degrees, slice_=self.canonical_slice,
is_combination=self.is_combination,
perm_type=self.perm_type
)
# There's no `.get_recurrented` because we can't know which sequence you'd
# want. If you want a recurrent perm space you need to use `.get_rapplied`
# with a recurrent sequence.
def get_partialled(self, n_elements):
'''Get a partialled version of this `PermSpace`.'''
if self.is_sliced:
raise TypeError(
"Can't get partial of sliced `PermSpace` directly, because "
"the number of items would be different. Use `.unsliced` "
"first."
)
return PermSpace(
self.sequence, n_elements=n_elements, domain=self.domain,
fixed_map=self.fixed_map, degrees=self.degrees, slice_=None,
is_combination=self.is_combination,
perm_type=self.perm_type
)
@caching.CachedProperty
def combinationed(self):
'''Get a combination version of this perm space.'''
from .comb import Comb
if self.is_sliced:
raise TypeError(
"Can't get a combinationed version of a sliced `PermSpace`"
"directly, because the number of items would be different. "
"Use `.unsliced` first."
)
if self.is_typed:
raise TypeError(
"Can't convert typed `PermSpace` directly to "
"combinationed, because the perm class would not be a "
"subclass of `Comb`."
)
if self.is_degreed:
raise TypeError("Can't use degrees with combination spaces.")
return PermSpace(
self.sequence, n_elements=self.n_elements, domain=self.domain,
fixed_map=self.fixed_map, is_combination=True,
perm_type=Comb
)
def get_dapplied(self, domain):
'''Get a version of this `PermSpace` that has a domain of `domain`.'''
from . import variations
if self.is_combination:
raise variations.UnallowedVariationSelectionException(
{variations.Variation.DAPPLIED: True,
variations.Variation.COMBINATION: True,}
)
domain = sequence_tools.ensure_iterable_is_immutable_sequence(domain)
if len(domain) != self.n_elements:
raise Exception
return PermSpace(
self.sequence, n_elements=self.n_elements, domain=domain,
fixed_map={domain[key]: value for key, value in
self._undapplied_fixed_map},
degrees=self.degrees, slice_=self.canonical_slice,
is_combination=self.is_combination,
perm_type=self.perm_type
)
def get_fixed(self, fixed_map):
'''Get a fixed version of this `PermSpace`.'''
if self.is_sliced:
raise TypeError(
"Can't be used on sliced perm spaces. Try "
"`perm_space.unsliced.get_fixed(...)`. You may then re-slice "
"the resulting space."
)
combined_fixed_map = dict(self.fixed_map)
for key, value in fixed_map.items():
if key in self.fixed_map:
|
return PermSpace(
self.sequence, n_elements=self.n_elements, domain=self.domain,
fixed_map=combined_fixed_map, degrees=self.degrees, slice_=None,
is_combination=self.is_combination, perm_type=self.perm_type
)
def get_degreed(self, degrees):
'''Get a version of this `PermSpace` restricted to certain degrees.'''
from . import variations
if self.is_sliced:
raise TypeError(
"Can't be used on sliced perm spaces. Try "
"`perm_space.unsliced.get_degreed(...)`. You may then "
"re-slice the resulting space."
)
if self.is_combination:
raise variations.UnallowedVariationSelectionException(
{variations.Variation.DEGREED: True,
variations.Variation.COMBINATION: True,}
)
degrees = sequence_tools.to_tuple(degrees, item_type=int)
if not degrees:
return self
degrees_to_use = \
degrees if not self.is_degreed else set(degrees) & set(self.degrees)
return PermSpace(
self.sequence, n_elements=self.n_elements, domain=self.domain,
fixed_map=self.fixed_map, degrees=degrees_to_use,
is_combination=self.is_combination, perm_type=self.perm_type
)
# There's no `get_sliced` because slicing is done using Python's normal
# slice notation, e.g. perm_space[4:-7].
def get_typed(self, perm_type):
'''
Get a version of this `PermSpace` where perms are of a custom type.
'''
return PermSpace(
self.sequence, n_elements=self.n_elements, domain=self.domain,
fixed_map=self.fixed_map, degrees=self.degrees,
slice_=self.canonical_slice, is_combination=self.is_combination,
perm_type=perm_type
)
|
assert self.fixed_map[key] == value
combined_fixed_map[key] = value
|
helpers.go
|
package helpers
import (
"log"
"os"
"path/filepath"
"reflect"
"regexp"
"sort"
"strings"
"github.com/fatih/color"
"github.com/xtgo/set"
)
const (
GomeetDefaultPrefixes = "svc-,gomeet-svc-"
GomeetRetoolRev = "64982169262e2ced1b9d0e9e328fe5fdd7a336f9"
)
type Empty struct{}
type PkgNfo struct {
goPkg string
name string
path string
shortName string
prefix string
defaultPrefixes string
projectGroupGoPkg string
projectGroupName string
}
type LogType int
const (
LogError LogType = iota - 1 // -1
LogDangerous // 0
LogSkipping // 1
LogReplacing // 2
LogCreating // 3
LogInfo // 4
)
func Log(t LogType, msg string) {
var p, head string
switch t {
case LogError:
p, head = "%s - %s\n", color.RedString("[Error]")
case LogDangerous:
p, head = "%s - %s\n", color.RedString("[Dangerous]")
case LogSkipping:
p, head = "%s - %s\n", color.YellowString("[Skipping]")
case LogReplacing:
p, head = "%s - %s\n", color.YellowString("[Replacing]")
case LogCreating:
p, head = "%s - %s\n", color.GreenString("[Creating]")
case LogInfo:
p, head = "%s - %s\n", color.CyanString("[Info]")
default:
p, head = "%s - %s\n", "[Unknow]"
}
log.Printf(p, head, msg)
}
func NewPkgNfo(goPkg, defaultPrefixes string) (*PkgNfo, error)
|
func (pNfo *PkgNfo) setGoPkg(goPkg string) (err error) {
if pNfo.path, err = Path(goPkg); err != nil {
return err
}
pNfo.goPkg = goPkg
pNfo.name = strings.ToLower(LastFromSplit(pNfo.GoPkg(), "/"))
if err = pNfo.SetDefaultPrefixes(pNfo.DefaultPrefixes()); err != nil {
return err
}
pNfo.projectGroupGoPkg = filepath.Dir(pNfo.GoPkg())
splitProjectGoPkg := strings.Split(pNfo.projectGroupGoPkg, string(filepath.Separator))
pNfo.projectGroupName = pNfo.name
if l := len(splitProjectGoPkg); l > 1 {
switch len(splitProjectGoPkg) {
case 1:
pNfo.projectGroupName = splitProjectGoPkg[0]
case 2:
pNfo.projectGroupName = splitProjectGoPkg[1]
default:
pNfo.projectGroupName = splitProjectGoPkg[l-1]
}
}
remplacer := strings.NewReplacer(".", "", "-", "")
pNfo.projectGroupName = remplacer.Replace(pNfo.projectGroupName)
return nil
}
func (pNfo *PkgNfo) setShortNameAndPrefix() {
pNfo.prefix, pNfo.shortName = ExtractPrefix(pNfo.Name(), pNfo.DefaultPrefixes())
}
func (pNfo *PkgNfo) SetDefaultPrefixes(s string) error {
pNfo.defaultPrefixes = NormalizeDefaultPrefixes(s)
pNfo.setShortNameAndPrefix()
return nil
}
func (pNfo PkgNfo) DefaultPrefixes() string { return pNfo.defaultPrefixes }
func (pNfo PkgNfo) Prefix() string { return pNfo.prefix }
func (pNfo PkgNfo) Name() string { return pNfo.name }
func (pNfo PkgNfo) ShortName() string { return pNfo.shortName }
func (pNfo PkgNfo) GoPkg() string { return pNfo.goPkg }
func (pNfo PkgNfo) ProjectGroupGoPkg() string { return pNfo.projectGroupGoPkg }
func (pNfo PkgNfo) ProjectGroupName() string { return pNfo.projectGroupName }
func (pNfo PkgNfo) Path() string { return pNfo.path }
// Copied and re-worked from
// https://github.com/spf13/cobra/bl ob/master/cobra/cmd/helpers.go
func Path(inputPath string) (string, error) {
// if no path is provided... assume CWD.
if inputPath == "" {
x, err := os.Getwd()
if err != nil {
return "", err
}
return x, nil
}
var projectPath string
var projectBase string
srcPath := SrcPath()
// if provided, inspect for logical locations
if strings.ContainsRune(inputPath, os.PathSeparator) {
if filepath.IsAbs(inputPath) || filepath.HasPrefix(inputPath, string(os.PathSeparator)) {
// if Absolute, use it
projectPath = filepath.Clean(inputPath)
return projectPath, nil
}
// If not absolute but contains slashes,
// assuming it means create it from $GOPATH
count := strings.Count(inputPath, string(os.PathSeparator))
if count == 1 {
projectPath = filepath.Join(srcPath, "github.com", inputPath)
} else {
projectPath = filepath.Join(srcPath, inputPath)
}
return projectPath, nil
}
// hardest case.. just a word.
if projectBase == "" {
x, err := os.Getwd()
if err == nil {
projectPath = filepath.Join(x, inputPath)
return projectPath, nil
}
return "", err
}
projectPath = filepath.Join(srcPath, projectBase, inputPath)
return projectPath, nil
}
func NormalizeDefaultPrefixes(s string) string {
if s != "" {
prefixes := strings.Split(GomeetDefaultPrefixes+","+s, ",")
data := sort.StringSlice(prefixes)
sort.Sort(data)
n := set.Uniq(data)
prefixes = data[:n]
return strings.Join(prefixes, ",")
}
return GomeetDefaultPrefixes
}
func GomeetPkg() string {
return strings.TrimSuffix(reflect.TypeOf(Empty{}).PkgPath(), "/utils/project/helpers")
}
func ParseCmd(s string) []string {
r := regexp.MustCompile(`'.*?'|".*?"|\S+`)
res := r.FindAllString(s, -1)
for k, v := range res {
mod := strings.Trim(v, " ")
mod = strings.Trim(mod, "'")
mod = strings.Trim(mod, `"`)
mod = strings.Trim(mod, " ")
res[k] = mod
}
return res
}
func Base(absPath string) string {
rel, err := filepath.Rel(SrcPath(), absPath)
if err != nil {
return filepath.ToSlash(absPath)
}
return filepath.ToSlash(rel)
}
func ExtractPrefix(name, prefix string) (string, string) {
prefix = NormalizeDefaultPrefixes(prefix)
if prefix != "" {
prefixes := strings.Split(prefix, ",")
tv := false
for _, v := range prefixes {
v = strings.Trim(v, " ")
if strings.HasPrefix(name, v) {
name = strings.Replace(name, v, "", -1)
prefix = v
tv = true
break
}
}
if !tv {
prefix = ""
}
}
return prefix, name
}
func LastFromSplit(input, split string) string {
rel := strings.Split(input, split)
return rel[len(rel)-1]
}
func SrcPath() string {
return filepath.Join(os.Getenv("GOPATH"), "src") + string(os.PathSeparator)
}
|
{
pNfo := &PkgNfo{}
if err := pNfo.setGoPkg(goPkg); err != nil {
return nil, err
}
if err := pNfo.SetDefaultPrefixes(defaultPrefixes); err != nil {
return nil, err
}
return pNfo, nil
}
|
getDatabaseVulnerabilityAssessment.ts
|
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
import * as pulumi from "@pulumi/pulumi";
import { input as inputs, output as outputs, enums } from "../../types";
import * as utilities from "../../utilities";
/**
* A database vulnerability assessment.
*/
|
export function getDatabaseVulnerabilityAssessment(args: GetDatabaseVulnerabilityAssessmentArgs, opts?: pulumi.InvokeOptions): Promise<GetDatabaseVulnerabilityAssessmentResult> {
if (!opts) {
opts = {}
}
if (!opts.version) {
opts.version = utilities.getVersion();
}
return pulumi.runtime.invoke("azure-native:sql/v20200801preview:getDatabaseVulnerabilityAssessment", {
"databaseName": args.databaseName,
"resourceGroupName": args.resourceGroupName,
"serverName": args.serverName,
"vulnerabilityAssessmentName": args.vulnerabilityAssessmentName,
}, opts);
}
export interface GetDatabaseVulnerabilityAssessmentArgs {
/**
* The name of the database for which the vulnerability assessment is defined.
*/
readonly databaseName: string;
/**
* The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
*/
readonly resourceGroupName: string;
/**
* The name of the server.
*/
readonly serverName: string;
/**
* The name of the vulnerability assessment.
*/
readonly vulnerabilityAssessmentName: string;
}
/**
* A database vulnerability assessment.
*/
export interface GetDatabaseVulnerabilityAssessmentResult {
/**
* Resource ID.
*/
readonly id: string;
/**
* Resource name.
*/
readonly name: string;
/**
* The recurring scans settings
*/
readonly recurringScans?: outputs.sql.v20200801preview.VulnerabilityAssessmentRecurringScansPropertiesResponse;
/**
* Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required.
*/
readonly storageAccountAccessKey?: string;
/**
* A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/). It is required if server level vulnerability assessment policy doesn't set
*/
readonly storageContainerPath?: string;
/**
* A shared access signature (SAS Key) that has write access to the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required.
*/
readonly storageContainerSasKey?: string;
/**
* Resource type.
*/
readonly type: string;
}
| |
blocking_state.rs
|
use crate::task::CanBlock;
use std::fmt;
use std::sync::atomic::{AtomicU32, Ordering};
/// State tracking task level state to support `blocking`.
///
/// This tracks two separate flags.
///
/// a) If the task is queued in the pending blocking channel. This prevents
/// double queuing (which would break the linked list).
///
/// b) If the task has been allocated capacity to block.
#[derive(Eq, PartialEq)]
pub(crate) struct BlockingState(u32);
const QUEUED: u32 = 0b01;
const ALLOCATED: u32 = 0b10;
impl BlockingState {
/// Create a new, default, `BlockingState`.
pub fn new() -> BlockingState {
BlockingState(0)
}
/// Returns `true` if the state represents the associated task being queued
/// in the pending blocking capacity channel
pub fn is_queued(&self) -> bool {
self.0 & QUEUED == QUEUED
}
/// Toggle the queued flag
///
/// Returns the state before the flag has been toggled.
pub fn toggle_queued(state: &AtomicU32, ordering: Ordering) -> BlockingState {
state.fetch_xor(QUEUED, ordering).into()
}
/// Returns `true` if the state represents the associated task having been
/// allocated capacity to block.
pub fn is_allocated(&self) -> bool {
self.0 & ALLOCATED == ALLOCATED
}
/// Atomically consume the capacity allocation and return if the allocation
/// was present.
///
/// If this returns `true`, then the task has the ability to block for the
/// duration of the `poll`.
pub fn consume_allocation(state: &AtomicU32, ordering: Ordering) -> CanBlock {
let state: Self = state.fetch_and(!ALLOCATED, ordering).into();
if state.is_allocated() {
CanBlock::Allocated
} else if state.is_queued() {
CanBlock::NoCapacity
} else {
CanBlock::CanRequest
}
}
pub fn notify_blocking(state: &AtomicU32, ordering: Ordering) {
let prev: Self = state.fetch_xor(ALLOCATED | QUEUED, ordering).into();
debug_assert!(prev.is_queued());
debug_assert!(!prev.is_allocated());
}
}
impl From<u32> for BlockingState {
fn from(src: u32) -> BlockingState {
BlockingState(src)
}
}
impl From<BlockingState> for u32 {
fn from(src: BlockingState) -> u32 {
src.0
}
}
impl fmt::Debug for BlockingState {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("BlockingState")
.field("is_queued", &self.is_queued())
|
.finish()
}
}
|
.field("is_allocated", &self.is_allocated())
|
cells.rs
|
// cells.rs
//
// Copyright (c) 2020 Douglas P Lau
//
use crate::layout::{BBox, Pos};
use crate::text::{Glyph, TextStyle, Theme};
use crate::{Result, Screen};
use textwrap::wrap;
/// Cells of text on a [Screen]
///
/// The cells are in a rectangular area of the screen.
pub struct Cells<'a> {
/// Screen containing cells
screen: &'a mut Screen,
/// Bounding box of cells
|
bbox: BBox,
/// Bounding box of clip area
clip: BBox,
}
impl<'a> Cells<'a> {
/// Create cells
pub fn new(screen: &'a mut Screen, bbox: BBox) -> Self {
let clip = bbox;
Self { screen, bbox, clip }
}
/// Get the width
pub fn width(&self) -> u16 {
self.clip.width()
}
/// Get the height
pub fn height(&self) -> u16 {
self.clip.height()
}
/// Clip to bounding box
pub fn clip(&mut self, inset: Option<BBox>) {
if let Some(inset) = inset {
let col = self.bbox.left() + inset.left();
let row = self.bbox.top() + inset.top();
let width = inset.width();
let height = inset.height();
self.clip = self.bbox.clip(BBox::new(col, row, width, height));
} else {
self.clip = self.bbox;
}
}
/// Fill the cells with a glyph
pub fn fill(&mut self, glyph: &Glyph) -> Result<()> {
let bbox = self.clip;
let fill_width = bbox.width() / glyph.width() as u16;
if bbox.height() > 0 && fill_width > 0 {
self.move_to(0, 0)?;
for row in 0..bbox.height() {
self.move_to(0, row)?;
for _ in 0..fill_width {
glyph.print(&mut self.screen)?;
}
}
}
Ok(())
}
/// Get the screen theme
pub fn theme(&self) -> &Theme {
&self.screen.theme()
}
/// Set the text style
pub fn set_style(&mut self, st: TextStyle) -> Result<()> {
self.screen.set_style(st)
}
/// Move cursor to a cell
pub fn move_to(&mut self, col: u16, row: u16) -> Result<()> {
let col = self.clip.left() + col;
let row = self.clip.top() + row;
self.screen.move_to(col, row)
}
/// Move cursor right by a number of columns
pub fn move_right(&mut self, col: u16) -> Result<()> {
self.screen.move_right(col)
}
/// Print a char at the cursor location
pub fn print_char(&mut self, ch: char) -> Result<()> {
// FIXME: check width first
self.screen.print_char(ch)
}
/// Print a str at the cursor location
pub fn print_str(&mut self, st: &str) -> Result<()> {
// FIXME: check width first
self.screen.print_str(st)
}
/// Print some text
///
/// Inline styling using Markdown:
///
/// Text Style | Markdown
/// ------------------|---------
/// Normal | `Normal`
/// _Italic_ | `*Italic*` or `_Italic_`
/// **Bold** | `**Bold**` or `__Bold__`
/// ~~Strikethrough~~ | `~~Strikethrough~~`
/// <u>Underline</u> | `<u>Underline</u>`
/// `Reverse` | `` `Reverse` ``
pub fn print_text(&mut self, text: &str, offset: Pos) -> Result<()> {
assert_eq!(offset.col, 0, "FIXME");
let top = usize::from(offset.row);
let width = usize::from(self.width());
let height = usize::from(self.height());
for (row, txt) in
wrap(&text, width).iter().skip(top).take(height).enumerate()
{
let row = row as u16; // limited to u16 by take(height)
self.move_to(0, row)?;
self.print_str(&txt)?;
}
Ok(())
}
}
| |
keyframes.py
|
from common import SushiError, read_all_text
def
|
(text):
return [i-3 for i,line in enumerate(text.splitlines()) if line and line[0] == 'i']
def parse_keyframes(path):
text = read_all_text(path)
if '# XviD 2pass stat file' in text:
frames = parse_scxvid_keyframes(text)
else:
raise SushiError('Unsupported keyframes type')
if 0 not in frames:
frames.insert(0, 0)
return frames
|
parse_scxvid_keyframes
|
redis_cluster.pb.go
|
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.23.0
// protoc v3.14.0
// source: envoy/extensions/clusters/redis/v3/redis_cluster.proto
package envoy_extensions_clusters_redis_v3
import (
_ "github.com/cncf/udpa/go/udpa/annotations"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
durationpb "google.golang.org/protobuf/types/known/durationpb"
wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
// [#next-free-field: 7]
type RedisClusterConfig struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Interval between successive topology refresh requests. If not set, this defaults to 5s.
ClusterRefreshRate *durationpb.Duration `protobuf:"bytes,1,opt,name=cluster_refresh_rate,json=clusterRefreshRate,proto3" json:"cluster_refresh_rate,omitempty"`
// Timeout for topology refresh request. If not set, this defaults to 3s.
ClusterRefreshTimeout *durationpb.Duration `protobuf:"bytes,2,opt,name=cluster_refresh_timeout,json=clusterRefreshTimeout,proto3" json:"cluster_refresh_timeout,omitempty"`
// The minimum interval that must pass after triggering a topology refresh request before a new
// request can possibly be triggered again. Any errors received during one of these
// time intervals are ignored. If not set, this defaults to 5s.
RedirectRefreshInterval *durationpb.Duration `protobuf:"bytes,3,opt,name=redirect_refresh_interval,json=redirectRefreshInterval,proto3" json:"redirect_refresh_interval,omitempty"`
// The number of redirection errors that must be received before
// triggering a topology refresh request. If not set, this defaults to 5.
// If this is set to 0, topology refresh after redirect is disabled.
RedirectRefreshThreshold *wrapperspb.UInt32Value `protobuf:"bytes,4,opt,name=redirect_refresh_threshold,json=redirectRefreshThreshold,proto3" json:"redirect_refresh_threshold,omitempty"`
// The number of failures that must be received before triggering a topology refresh request.
// If not set, this defaults to 0, which disables the topology refresh due to failure.
FailureRefreshThreshold uint32 `protobuf:"varint,5,opt,name=failure_refresh_threshold,json=failureRefreshThreshold,proto3" json:"failure_refresh_threshold,omitempty"`
// The number of hosts became degraded or unhealthy before triggering a topology refresh request.
// If not set, this defaults to 0, which disables the topology refresh due to degraded or
// unhealthy host.
HostDegradedRefreshThreshold uint32 `protobuf:"varint,6,opt,name=host_degraded_refresh_threshold,json=hostDegradedRefreshThreshold,proto3" json:"host_degraded_refresh_threshold,omitempty"`
}
func (x *RedisClusterConfig) Reset() {
*x = RedisClusterConfig{}
if protoimpl.UnsafeEnabled {
mi := &file_envoy_extensions_clusters_redis_v3_redis_cluster_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RedisClusterConfig) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RedisClusterConfig) ProtoMessage() {}
func (x *RedisClusterConfig) ProtoReflect() protoreflect.Message {
mi := &file_envoy_extensions_clusters_redis_v3_redis_cluster_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RedisClusterConfig.ProtoReflect.Descriptor instead.
func (*RedisClusterConfig) Descriptor() ([]byte, []int) {
return file_envoy_extensions_clusters_redis_v3_redis_cluster_proto_rawDescGZIP(), []int{0}
}
func (x *RedisClusterConfig) GetClusterRefreshRate() *durationpb.Duration {
if x != nil {
return x.ClusterRefreshRate
}
return nil
}
func (x *RedisClusterConfig) GetClusterRefreshTimeout() *durationpb.Duration {
if x != nil {
return x.ClusterRefreshTimeout
}
return nil
}
func (x *RedisClusterConfig) GetRedirectRefreshInterval() *durationpb.Duration {
if x != nil {
return x.RedirectRefreshInterval
}
return nil
}
func (x *RedisClusterConfig) GetRedirectRefreshThreshold() *wrapperspb.UInt32Value {
if x != nil {
return x.RedirectRefreshThreshold
}
return nil
}
func (x *RedisClusterConfig) GetFailureRefreshThreshold() uint32 {
if x != nil {
return x.FailureRefreshThreshold
}
return 0
}
func (x *RedisClusterConfig) GetHostDegradedRefreshThreshold() uint32 {
if x != nil {
return x.HostDegradedRefreshThreshold
}
return 0
}
var File_envoy_extensions_clusters_redis_v3_redis_cluster_proto protoreflect.FileDescriptor
var file_envoy_extensions_clusters_redis_v3_redis_cluster_proto_rawDesc = []byte{
0x0a, 0x36, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
0x6e, 0x73, 0x2f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x2f, 0x72, 0x65, 0x64, 0x69,
0x73, 0x2f, 0x76, 0x33, 0x2f, 0x72, 0x65, 0x64, 0x69, 0x73, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74,
0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x22, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e,
0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x63, 0x6c, 0x75, 0x73, 0x74,
0x65, 0x72, 0x73, 0x2e, 0x72, 0x65, 0x64, 0x69, 0x73, 0x2e, 0x76, 0x33, 0x1a, 0x1e, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75,
0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72,
0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x75, 0x64,
0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73,
0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x75, 0x64, 0x70,
0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x65,
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17,
0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74,
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb4, 0x04, 0x0a, 0x12, 0x52, 0x65, 0x64, 0x69,
0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x55,
0x0a, 0x14, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73,
0x68, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44,
0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xfa, 0x42, 0x05, 0xaa, 0x01, 0x02, 0x2a,
0x00, 0x52, 0x12, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73,
0x68, 0x52, 0x61, 0x74, 0x65, 0x12, 0x5b, 0x0a, 0x17, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72,
0x5f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x42, 0x08, 0xfa, 0x42, 0x05, 0xaa, 0x01, 0x02, 0x2a, 0x00, 0x52, 0x15, 0x63, 0x6c, 0x75,
0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x6f,
0x75, 0x74, 0x12, 0x55, 0x0a, 0x19, 0x72, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x5f, 0x72,
0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18,
0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x52, 0x17, 0x72, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73,
0x68, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x5a, 0x0a, 0x1a, 0x72, 0x65, 0x64,
0x69, 0x72, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x68,
0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x18, 0x72, 0x65, 0x64,
0x69, 0x72, 0x65, 0x63, 0x74, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x68, 0x72, 0x65,
0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x3a, 0x0a, 0x19, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65,
0x5f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f,
0x6c, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x17, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72,
0x65, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c,
0x64, 0x12, 0x45, 0x0a, 0x1f, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x64, 0x65, 0x67, 0x72, 0x61, 0x64,
0x65, 0x64, 0x5f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73,
0x68, 0x6f, 0x6c, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x1c, 0x68, 0x6f, 0x73, 0x74,
0x44, 0x65, 0x67, 0x72, 0x61, 0x64, 0x65, 0x64, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54,
0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x3a, 0x34, 0x9a, 0xc5, 0x88, 0x1e, 0x2f, 0x0a,
0x2d, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6c,
0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x72, 0x65, 0x64, 0x69, 0x73, 0x2e, 0x52, 0x65, 0x64, 0x69,
0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x4f,
0x0a, 0x30, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e,
0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73,
0x2e, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x72, 0x65, 0x64, 0x69, 0x73, 0x2e,
0x76, 0x33, 0x42, 0x11, 0x52, 0x65, 0x64, 0x69, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72,
0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0xba, 0x80, 0xc8, 0xd1, 0x06, 0x02, 0x10, 0x02, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_envoy_extensions_clusters_redis_v3_redis_cluster_proto_rawDescOnce sync.Once
file_envoy_extensions_clusters_redis_v3_redis_cluster_proto_rawDescData = file_envoy_extensions_clusters_redis_v3_redis_cluster_proto_rawDesc
)
func file_envoy_extensions_clusters_redis_v3_redis_cluster_proto_rawDescGZIP() []byte {
file_envoy_extensions_clusters_redis_v3_redis_cluster_proto_rawDescOnce.Do(func() {
file_envoy_extensions_clusters_redis_v3_redis_cluster_proto_rawDescData = protoimpl.X.CompressGZIP(file_envoy_extensions_clusters_redis_v3_redis_cluster_proto_rawDescData)
})
return file_envoy_extensions_clusters_redis_v3_redis_cluster_proto_rawDescData
}
var file_envoy_extensions_clusters_redis_v3_redis_cluster_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_envoy_extensions_clusters_redis_v3_redis_cluster_proto_goTypes = []interface{}{
(*RedisClusterConfig)(nil), // 0: envoy.extensions.clusters.redis.v3.RedisClusterConfig
(*durationpb.Duration)(nil), // 1: google.protobuf.Duration
(*wrapperspb.UInt32Value)(nil), // 2: google.protobuf.UInt32Value
}
var file_envoy_extensions_clusters_redis_v3_redis_cluster_proto_depIdxs = []int32{
1, // 0: envoy.extensions.clusters.redis.v3.RedisClusterConfig.cluster_refresh_rate:type_name -> google.protobuf.Duration
1, // 1: envoy.extensions.clusters.redis.v3.RedisClusterConfig.cluster_refresh_timeout:type_name -> google.protobuf.Duration
1, // 2: envoy.extensions.clusters.redis.v3.RedisClusterConfig.redirect_refresh_interval:type_name -> google.protobuf.Duration
2, // 3: envoy.extensions.clusters.redis.v3.RedisClusterConfig.redirect_refresh_threshold:type_name -> google.protobuf.UInt32Value
4, // [4:4] is the sub-list for method output_type
4, // [4:4] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
}
func init() { file_envoy_extensions_clusters_redis_v3_redis_cluster_proto_init() }
func file_envoy_extensions_clusters_redis_v3_redis_cluster_proto_init() {
if File_envoy_extensions_clusters_redis_v3_redis_cluster_proto != nil
|
if !protoimpl.UnsafeEnabled {
file_envoy_extensions_clusters_redis_v3_redis_cluster_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RedisClusterConfig); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_envoy_extensions_clusters_redis_v3_redis_cluster_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_envoy_extensions_clusters_redis_v3_redis_cluster_proto_goTypes,
DependencyIndexes: file_envoy_extensions_clusters_redis_v3_redis_cluster_proto_depIdxs,
MessageInfos: file_envoy_extensions_clusters_redis_v3_redis_cluster_proto_msgTypes,
}.Build()
File_envoy_extensions_clusters_redis_v3_redis_cluster_proto = out.File
file_envoy_extensions_clusters_redis_v3_redis_cluster_proto_rawDesc = nil
file_envoy_extensions_clusters_redis_v3_redis_cluster_proto_goTypes = nil
file_envoy_extensions_clusters_redis_v3_redis_cluster_proto_depIdxs = nil
}
|
{
return
}
|
leveling.py
|
import discord
from discord.ext import commands, tasks
import datetime
import random
from prettytable import PrettyTable
import random
from random import randint
data = ['Water', 'Air', 'Earth', 'Fire', 'Destruction',
'Illusion', 'Time', 'Space', 'Karma', 'Chaos']
paths = random.choice(data)
luck = random.randint(1, 100)
data1 = ['Demon', 'Human', 'Dragon', 'Beast',
'Phoenix', 'Spirit', 'Giant', 'Fey']
color = 0xa100f2
guild = 757098499836739594
class vein8(commands.Cog, name='leveling'):
def __init__(self, Bot):
self.Bot = Bot
self.Bot.scholar_chat = self.Bot.get_channel(757108786497585172)
async def ModLog(self,ctx,commandname =None ,mod= None, target = None, amount :3 =None, Reason =None,
channel=None, content = None, jump = None):
guild = self.Bot.get_guild(self.Bot.guild_id)
log_channel= self.Bot.get_channel(759583119396700180)
embed = discord.Embed(color = random.choice(self.Bot.color_list),timestamp = datetime.datetime.utcnow())
embed.set_author(name=f"{commandname}",icon_url=ctx.author.avatar_url)
if mod !=None:
embed.add_field(name = "Mod", value = f"{mod.display_name} | {mod.mention}")
if target != None:
embed.add_field(name = "Target", value = f"{target.display_name} | {target.mention}")
if amount != None:
embed.add_field(name= "Amount", value= f'``{amount}``', inline=False)
if channel!= None:
embed.add_field(name = "On channel", value=f"{channel}")
if content!= None:
embed.add_field(name = "Content", value= f"```css\n{content}```", inline=False)
if jump != None:
embed.add_field(name = "Jump", value = f"[Here]({jump})")
if Reason !=None:
embed.add_field(name= "Reason ", value= f"```css\n{Reason}```", inline=False)
embed.set_thumbnail(url = guild.icon_url)
embed.set_footer(icon_url = mod.avatar_url)
await log_channel.send(embed=embed)
return self.ModLog
@commands.Cog.listener()
@commands.guild_only()
async def on_message(self, message):
# remove the unnecessay things
if isinstance(message.channel, discord.channel.DMChannel):
return
if message.guild.id != 757098499836739594:
return
if message.author.id == 759784064361299989:
return
if message.author.bot:
return
if self.Bot.DEFAULT_PREFIX == '&':
return
race = random.choice(data1)
strength = random.randint(1, 10)
speed = random.randint(1, 10)
defense = random.randint(1, 10)
soul = random.randint(1, 10)
Hp = random.randint(50, 350)
#My server memers ain't lower than 50, that's for sure :)
wisdom = random.randint(50, 100)
bot1 = message.guild.get_channel(781535649843904562)
bot2 = message.guild.get_channel(757136943149613076)
music = message.guild.get_channel(768684108770574366)
testing = message.guild.get_channel(757941959796195484)
if message.channel.id == bot1.id:
return
if message.channel.id == (music.id) or message.channel.id == (testing.id):
return
author_id = str(message.author.id)
db = self.Bot.cluster1['AbodeDB']
collection = db['Levels']
user_id = {"_id": author_id}
# checks if user is in the db or not
if (collection.find_one({"_id": author_id}) == None):
leauge = "Novice scholar"
Realm = "Mortal"
Path = paths
lol = "No aliases"
user_data = {"_id": author_id, "points": 1, "Leauge": leauge, "Qi": 0, "Daos": 0, "Path": Path, "Realm": Realm, "Luck": luck,
"Species": race, "Strength": strength, "Speed": speed, "Defense": defense, "Soul": soul, "Health": Hp, "Name": lol
, "Wisdom": wisdom}
collection.insert_one(user_data)
else:
query = {"_id": author_id}
level = collection.find(query)
for lvl in level:
cur_p = lvl['points']
new_p = cur_p + 1
# this is a mess
cur_q = lvl['Qi']
new_q = cur_q + 0.25
Leauge = lvl['Leauge']
dao = lvl['Daos']
stre = lvl['Strength']
sped = lvl['Speed']
defen = lvl['Defense']
sol = lvl['Soul']
health = lvl['Health']
if (new_q % 200) == 0:
await message.channel.send(f'<:Cuppedfist:757112296094040104> Congragulations! {message.author.mention}, your Qi just reached **{new_q}**.')
elif (new_q % 600) == 0:
await message.channel.send(f'{message.author}, you now have comprehendded ``{dao}`` heavenly dao(s).')
collection.update_one({"_id": author_id}, {
"$set": {"Daos": +1}})
if (new_q == 500):
ok = 'Star'
collection.update_one({"_id": author_id}, {
"$set": {"Realm": ok}})
await message.channel.send(f'<:Cuppedfist:757112296094040104> {message.author.mention} Congragulations! you just brokethrough to become a ``Star realm`` expert.\nAnd also, you earned the ``intermediate scholar`` medal.')
new_medal1 = 'Intermediate scholar'
collection.update_one({"_id": author_id}, {
"$set": {"Leauge": new_medal1}})
elif (new_q == 1500):
await message.channel.send(f'<:Cuppedfist:757112296094040104> {member.author.mention}, Congragulations you earned the ``Expert scholar`` medal.')
new_medal2 = 'Expert scholar'
collection.upate_one({"_id": author_id}, {
"$set": {"Leauge": new_medal2}})
elif (new_q % 10) == 0:
strength1 = random.randint(1, 15)
speed1 = random.randint(1, 10)
defense1 = random.randint(1, 25)
soul1 = random.randint(1, 5)
Hp1 = random.randint(1, 20)
collection.update_one({"_id": author_id}, {
"$set": {"Strength": stre + strength1}})
collection.update_one({"_id": author_id}, {
"$set": {"Speed": sped + speed1}})
collection.update_one({"_id": author_id}, {
"$set": {"Defense": defen + defense1}})
collection.update_one({"_id": author_id}, {
"$set": {"Soul": sol + soul1}})
collection.update_one({"_id": author_id}, {
"$set": {"Health": health + Hp1}})
if (new_q == 1100):
ok = 'Transcendent'
collection.update_one({"_id": author_id}, {
"$set": {"Realm": ok}})
await message.channel.send(f'{message.author.mention},<:Cuppedfist:757112296094040104> Congragulations! you just brokethrough to become a ``Transcendent realm`` expert.')
if (new_q == 2500):
ok = 'Saint'
collection.update_one({"_id": author_id}, {
"$set": {"Realm": ok}})
await message.channel.send(f'<:Cuppedfist:757112296094040104> {message.author.mention} Congragulations! you just brokethrough to become a ``Saint realm`` expert.')
if (new_q == 5100):
ok = 'God'
collection.update_one({"_id": author_id}, {
"$set": {"Realm": ok}})
await message.channel.send(f'<:Cuppedfist:757112296094040104> {message.author.mention} Congragulations! you just brokethrough to become a ``God realm``expert.')
if (new_q == 10001):
ok = 'Chaotic'
collection.update_one({"_id": author_id}, {
"$set": {"Realm": ok}})
await message.channel.send(f'<:Cuppedfist:757112296094040104> {message.author.mention} Congragulations! you just brokethrough to become a ``Chaotic realm`` expert.')
collection.update_one({"_id": author_id}, {
"$set": {'points': new_p}})
collection.update_one({"_id": author_id}, {
"$set": {"Qi": new_q}})
@commands.command(aliases=['apoints'], hidden=True)
@commands.guild_only()
@commands.has_permissions(manage_roles=True)
async def addpoints(self, ctx, member: discord.Member, amount, *, reason=None):
channel = ctx.guild.get_channel(780785741101137926)
if ctx.guild.id != (guild):
return await ctx.send('<:WeirdChamp:757112297096216627> Come to the main server if you dare.')
if int(amount) <= 2000:
memeber_id = str(member.id)
db = self.Bot.cluster1['AbodeDB']
collection = db['Levels']
user_id = {"_id": memeber_id}
query = {"_id": memeber_id}
points = collection.find(query)
if collection.find_one({"_id": memeber_id} == None):
await ctx.send(f"{ctx.author.name}, No such user by the name {member.name} exists. ")
for point in points:
old_p = point['points']
amount_n = int(amount)
new_p = (int(old_p) + int(amount_n))
collection.update_one({"_id": memeber_id}, {
"$set": {"points": new_p}})
await ctx.send(f"Sucessfully added ``{amount}`` points to {member.name}. Now {member.name} has ``{new_p}`` in total.")
await self.ModLog(ctx = ctx, mod= ctx.author, target=member, commandname="Points Given!", channel=ctx.channel.mention
, amount = amount, jump= ctx.message.jump_url, Reason=reason)
elif int(amount) >= 2000:
await ctx.send(f"<:WeirdChamp:757112297096216627> {ctx.author.name}, 2000 is the limit for now.")
@commands.command(aliases=['rpoints'], hidden=True)
@commands.guild_only()
@commands.has_permissions(manage_roles=True)
async def removepoints(self, ctx, member: discord.Member, amount, *, Reason):
channel = ctx.guild.get_channel(780785741101137926)
if ctx.guild.id != 757098499836739594:
return await ctx.send('<:WeirdChamp:757112297096216627> Come to the main server if you dare.')
if ctx.author.top_role < member.top_role:
return await ctx.send("You can't remove points of someone higher than you.")
if int(amount) <= 2000:
memeber_id = str(member.id)
db = self.Bot.cluster1['AbodeDB']
collection = db['Levels']
user_id = {"_id": memeber_id}
query = {"_id": memeber_id}
points = collection.find(query)
if collection.find_one({"_id": memeber_id} == None):
await ctx.send(f"{ctx.author.name}, No such user by the name {member.name} exists. ")
for point in points:
old_p = point['points']
amount_n = int(amount)
new_p = (int(old_p) - int(amount_n))
collection.update_one({"_id": memeber_id}, {
"$set": {"points": new_p}})
await ctx.send(f"Sucessfully removed ``{amount}`` points from {member.name}. Now {member.name} has ``{new_p}`` in total.")
await self.ModLog(ctx = ctx, mod= ctx.author, target=member, commandname="Points Removed!", channel=ctx.channel.mention
, amount = amount, jump= ctx.message.jump_url, Reason=reason)
else:
await ctx.send(f"{ctx.author.name}, you can't remove more than 2000 points. <:WeirdChamp:757112297096216627>")
@commands.command(aliases=["points", "qi", "p", 'stats'], description=f'Show your stats and general info.')
@commands.guild_only()
async def point(self, ctx):
if ctx.message.channel.id == 757108786497585172:
return
try:
member = ctx.author
member_id = str(member.id)
db = self.Bot.cluster1['AbodeDB']
collection = db['Levels']
qurey = {"_id": member_id}
users = collection.find(qurey)
total = collection.count()
hm = collection.find().sort("Qi", -1)
a = 0
for x in hm:
idd = x["_id"]
if idd == member_id:
break
else:
a += 1
for lvl in users:
_id = lvl['_id']
points = lvl['points']
medal = lvl['Leauge']
dao = lvl['Daos']
stre = lvl['Strength']
sped = lvl['Speed']
defen = lvl['Defense']
sol = lvl['Soul']
health = lvl['Health']
luk = lvl['Luck']
qi = lvl['Qi']
realm = lvl['Realm']
speci = lvl['Species']
pth = lvl['Path']
nme = lvl['Name']
try:
wisdom = lvl['Wisdom']
except:
wisdom = "Use .update to see your wisom"
embed = discord.Embed(
color=color, timestamp=datetime.datetime.utcnow())
embed.set_thumbnail(url=f'{ctx.guild.icon_url}')
embed.set_author(name=f'{member.name} ',
icon_url=f'{member.avatar_url}')
embed.add_field(name=f'__#{int(a) +1}/{total}__', value=f'**Aliases** :{nme} \n'
f'**Realm** : {str(realm)}\n'
f'**Species** : {str(speci)}')
embed.add_field(name="__Legacy__", value=f'**Path** : {str(pth)}\n'
f'**Medals** : {str(medal)}\n'
f'**Daos** : {str(dao)}')
embed.add_field(name='__Accomplishments__', value=f'**Qi : ** {str(qi)}\n'
f'**Points : ** {str(points)}\n'
f' **Luck : ** {str(luk)}'
)
embed.add_field(name='__Stats__', value=f'**Strength :** {str(stre)}\n'
f'**Defense :** {str(defen)}\n'
f'**Speed** : {str(sped)}\n'
f'**Soul : **{str(sol)}\n'
f'**Health : ** {str(health)}\n'
f'**Wisdom : ** {str(wisdom)}')
embed.set_footer(text=f"Abode of Scholars")
await ctx.send(embed=embed)
except:
await ctx.send(f'Your data probably isn\'nt saved on the database.')
@commands.command(aliases=["puser", "statsu"], description=f'Shows shats on another user, be sure to use the user id.')
@commands.guild_only()
async def pu(self, ctx, member_id: int):
if ctx.guild.id != (guild):
return
member = ctx.guild.get_member(member_id)
member_id = str(member_id)
db = self.Bot.cluster1['AbodeDB']
collection = db['Levels']
qurey = {"_id": member_id}
users = collection.find(qurey)
total = collection.count()
hm = collection.find().sort("Qi", -1)
a = 0
for x in hm:
idd = x["_id"]
if idd == member_id:
break
else:
a += 1
for lvl in users:
_id = lvl['_id']
points = lvl['points']
medal = lvl['Leauge']
dao = lvl['Daos']
stre = lvl['Strength']
sped = lvl['Speed']
defen = lvl['Defense']
sol = lvl['Soul']
health = lvl['Health']
luk = lvl['Luck']
qi = lvl['Qi']
realm = lvl['Realm']
speci = lvl['Species']
pth = lvl['Path']
try:
wisdom = lvl['wisdom']
except:
wisdom = "Use .update to see your wisom"
embed = discord.Embed(
color=color, timestamp=datetime.datetime.utcnow())
embed.set_thumbnail(url=f'{ctx.guild.icon_url}')
embed.set_author(name=f'{member.name} ',
icon_url=f'{member.avatar_url}')
embed.add_field(name=f'__Main__', value=f'**Rank** : #{int(a) +1}/{total}\n'
f'**Realm** : {str(realm)}\n'
f'**Species** : {str(speci)}')
embed.add_field(name="__Legacy__", value=f'**Path** : {str(pth)}\n'
f'**Medals** : {str(medal)}\n'
f'**Daos** : {str(dao)}')
embed.add_field(name='__Accomplishments__', value=f'**Qi : ** {str(qi)}\n'
f'**Points : ** {str(points)}\n'
f' **Luck : ** {str(luk)}', inline=False)
embed.add_field(name='__Stats__', value=f'**Strength :** {str(stre)}\n'
f'**Defense :** {str(defen)}\n'
f'**Speed** : {str(sped)}\n'
f'**Soul : **{str(sol)}\n'
f'**Health : ** {str(health)}\n'
f'**Wisdom :** {str(wisdom)} ')
embed.set_footer(text=f"Abode of Scholars")
await ctx.send(embed=embed)
@commands.command(aliases=['aliases', 'cname'], description=f'Add your cultivator name.')
@commands.guild_only()
async def nickname(self, ctx, *, arg):
if len(arg) > 10:
return await ctx.send('Bruh you can\'t go over 10 characthers.')
if ctx.guild.id != (guild):
return
db = self.Bot.cluster1['AbodeDB']
collection = db['Levels']
user_id = str(ctx.author.id)
name = str(arg)
name = str(arg)
collection.update_one({"_id": user_id}, {"$set": {"Name": name}})
await ctx.send(f'{ctx.author.mention} Your cultivator name was sucessfully set to {arg}.')
@commands.command(aliases=["lb"], description='Shows the top 10 cultivators on the server.')
@commands.guild_only()
async def
|
(self, ctx):
if ctx.channel.id == self.Bot.scholar_chat:
return
member = discord.Member or ctx.author
memeber_id = str(member.id)
db = self.Bot.cluster1['AbodeDB']
collection = db['Levels']
collection2 = db['Levels1']
users = collection.find().sort("Qi", -1).limit(10)
names = collection2.find().sort("Name", 1)
a2 = []
nme1 = []
name2 = []
pts1 = []
pth1 = []
table = PrettyTable()
table1 = PrettyTable()
a = 0
table.field_names = ["Rank", "Aliases", "Qi", "Points", "Path"]
table1.field_names = ["Rank", "Aliases", "Qi", "Points"]
table.align = "c"
for u in users:
user_id = u['_id']
qi = u['Qi']
pts = u['points']
pth = u['Path']
nme = u['Name']
a += 1
hm = str(pts)
hm1 = str(qi)
pts1.append(hm)
nme1.append(nme)
name2.append(hm1)
pth1.append(pth)
'''embed.add_field(name='Aliases', value=f"\n\n".join(nme1))
embed.add_field(name='Qi', value="\n\n".join(name2))
embed.add_field(name="Points", value=" \n\n ".join(pts1))
#embed.add_field(name=f"{a}", value=f'**Aliases : {nme}** \n**Qi : ** {qi}\n**Points : ** {pts} \n**Path : **{pth}')
embed.set_footer(text=f'To remove the \'None\' from your name, add your Cultivator name through .aliases')
await ctx.send(embed=embed)'''
table.add_row([a, f'{nme}', qi, pts, f'{pth}'])
table1.add_row([a, f'{nme}', qi, pts])
if ctx.author.is_on_mobile():
await ctx.send(f'```prolog\n{table}```')
else:
embed = discord.Embed(
title="Leaderboard \n``You can add your aliases by [.aliases <yourname>]``", color=color, description=f'```prolog\n{table1}```')
embed.set_thumbnail(url=f'{ctx.guild.icon_url}')
embed.set_footer(text=f'Requested by {ctx.author.name}')
await ctx.send(embed=embed)
def setup(Bot):
Bot.add_cog(vein8(Bot))
print("Leveling cog is working.")
|
leaderboard
|
routes.ts
|
const routes: RouteConfig[] = [
{
|
key: 'AlertModal',
windowOptions: {
title: 'Alert',
width: 460,
height: 240,
resizable: false,
},
createConfig: {
showTitlebar: false,
hideMenus: true,
},
},
]
export default routes
|
path: '/alert-modal',
|
widget.py
|
# coding: utf-8
"""
LogicMonitor REST API
LogicMonitor is a SaaS-based performance monitoring platform that provides full visibility into complex, hybrid infrastructures, offering granular performance monitoring and actionable data and insights. logicmonitor_sdk enables you to manage your LogicMonitor account programmatically. # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Widget(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'last_updated_by': 'str',
'user_permission': 'str',
'dashboard_id': 'int',
'name': 'str',
'description': 'str',
'last_updated_on': 'int',
'theme': 'str',
'interval': 'int',
'id': 'int',
'type': 'str',
'timescale': 'str'
}
attribute_map = {
'last_updated_by': 'lastUpdatedBy',
'user_permission': 'userPermission',
'dashboard_id': 'dashboardId',
'name': 'name',
'description': 'description',
'last_updated_on': 'lastUpdatedOn',
'theme': 'theme',
'interval': 'interval',
'id': 'id',
'type': 'type',
'timescale': 'timescale'
}
discriminator_value_class_map = {
'batchjob': 'BatchJobWidget',
'netflow': 'NetflowWidget',
'html': 'HtmlWidget',
'sgraph': 'WebsiteGraphWidget',
'devicesla': 'DeviceSLAWidget',
'groupnetflowgraph': 'NetflowGroupGraphWidget',
'gauge': 'GaugeWidget',
'ograph': 'OverviewGraphWidget',
'statsd': 'StatsDWidget',
'netflowgraph': 'NetflowGraphWidget',
'devicestatus': 'DeviceStatus',
'text': 'TextWidget',
'flash': 'FlashWidget',
'ngraph': 'NormalGraphWidget',
'groupnetflow': 'NetflowGroupWidget',
'bignumber': 'BigNumberWidget',
'cgraph': 'CustomerGraphWidget',
'dynamictable': 'DynamicTableWidget',
'table': 'TableWidget',
'gmap': 'GoogleMapWidget',
'noc': 'NOCWidget',
'': 'ServiceAlert',
'alert': 'AlertWidget',
'websiteindividualstatus': 'WebsiteIndividualsStatusWidget',
'websiteoverallstatus': 'WebsiteOverallStatusWidget',
'piechart': 'PieChartWidget',
'websiteoverview': 'WebsiteOverviewWidget',
'websitesla': 'WebsiteSLAWidget'
}
def __init__(self, last_updated_by=None, user_permission=None, dashboard_id=None, name=None, description=None, last_updated_on=None, theme=None, interval=None, id=None, type=None, timescale=None): # noqa: E501
"""Widget - a model defined in Swagger""" # noqa: E501
self._last_updated_by = None
self._user_permission = None
self._dashboard_id = None
self._name = None
self._description = None
self._last_updated_on = None
self._theme = None
self._interval = None
self._id = None
self._type = None
self._timescale = None
self.discriminator = 'type'
if last_updated_by is not None:
self.last_updated_by = last_updated_by
if user_permission is not None:
self.user_permission = user_permission
self.dashboard_id = dashboard_id
self.name = name
if description is not None:
self.description = description
if last_updated_on is not None:
self.last_updated_on = last_updated_on
if theme is not None:
self.theme = theme
if interval is not None:
self.interval = interval
if id is not None:
self.id = id
self.type = type
if timescale is not None:
self.timescale = timescale
@property
def last_updated_by(self):
"""Gets the last_updated_by of this Widget. # noqa: E501
The user that last updated the widget # noqa: E501
:return: The last_updated_by of this Widget. # noqa: E501
:rtype: str
"""
return self._last_updated_by
@last_updated_by.setter
def last_updated_by(self, last_updated_by):
"""Sets the last_updated_by of this Widget.
The user that last updated the widget # noqa: E501
:param last_updated_by: The last_updated_by of this Widget. # noqa: E501
:type: str
"""
self._last_updated_by = last_updated_by
@property
def user_permission(self):
"""Gets the user_permission of this Widget. # noqa: E501
The permission level of the user who last modified the widget # noqa: E501
:return: The user_permission of this Widget. # noqa: E501
:rtype: str
"""
return self._user_permission
@user_permission.setter
def user_permission(self, user_permission):
"""Sets the user_permission of this Widget.
The permission level of the user who last modified the widget # noqa: E501
:param user_permission: The user_permission of this Widget. # noqa: E501
:type: str
"""
self._user_permission = user_permission
@property
def dashboard_id(self):
"""Gets the dashboard_id of this Widget. # noqa: E501
The id of the dashboard the widget belongs to # noqa: E501
:return: The dashboard_id of this Widget. # noqa: E501
:rtype: int
"""
return self._dashboard_id
@dashboard_id.setter
def dashboard_id(self, dashboard_id):
"""Sets the dashboard_id of this Widget.
The id of the dashboard the widget belongs to # noqa: E501
:param dashboard_id: The dashboard_id of this Widget. # noqa: E501
:type: int
"""
if dashboard_id is None:
raise ValueError("Invalid value for `dashboard_id`, must not be `None`") # noqa: E501
self._dashboard_id = dashboard_id
@property
def name(self):
"""Gets the name of this Widget. # noqa: E501
The name of the widget # noqa: E501
:return: The name of this Widget. # noqa: E501
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""Sets the name of this Widget.
The name of the widget # noqa: E501
:param name: The name of this Widget. # noqa: E501
:type: str
"""
if name is None:
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
self._name = name
@property
def description(self):
"""Gets the description of this Widget. # noqa: E501
The description of the widget # noqa: E501
:return: The description of this Widget. # noqa: E501
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""Sets the description of this Widget.
The description of the widget # noqa: E501
:param description: The description of this Widget. # noqa: E501
:type: str
"""
self._description = description
@property
def last_updated_on(self):
"""Gets the last_updated_on of this Widget. # noqa: E501
The time that corresponds to when the widget was last updated, in epoch format # noqa: E501
:return: The last_updated_on of this Widget. # noqa: E501
:rtype: int
"""
return self._last_updated_on
@last_updated_on.setter
def last_updated_on(self, last_updated_on):
"""Sets the last_updated_on of this Widget.
The time that corresponds to when the widget was last updated, in epoch format # noqa: E501
:param last_updated_on: The last_updated_on of this Widget. # noqa: E501
:type: int
"""
self._last_updated_on = last_updated_on
@property
def theme(self):
"""Gets the theme of this Widget. # noqa: E501
The color scheme of the widget. Options are: borderPurple | borderGray | borderBlue | solidPurple | solidGray | solidBlue | simplePurple | simpleBlue | simpleGray | newBorderGray | newBorderBlue | newBorderDarkBlue | newSolidGray | newSolidBlue | newSolidDarkBlue | newSimpleGray | newSimpleBlue |newSimpleDarkBlue # noqa: E501
:return: The theme of this Widget. # noqa: E501
:rtype: str
"""
return self._theme
@theme.setter
def theme(self, theme):
"""Sets the theme of this Widget.
The color scheme of the widget. Options are: borderPurple | borderGray | borderBlue | solidPurple | solidGray | solidBlue | simplePurple | simpleBlue | simpleGray | newBorderGray | newBorderBlue | newBorderDarkBlue | newSolidGray | newSolidBlue | newSolidDarkBlue | newSimpleGray | newSimpleBlue |newSimpleDarkBlue # noqa: E501
:param theme: The theme of this Widget. # noqa: E501
:type: str
"""
self._theme = theme
@property
def interval(self):
"""Gets the interval of this Widget. # noqa: E501
The refresh interval of the widget, in minutes # noqa: E501
:return: The interval of this Widget. # noqa: E501
:rtype: int
"""
return self._interval
@interval.setter
def interval(self, interval):
"""Sets the interval of this Widget.
The refresh interval of the widget, in minutes # noqa: E501
:param interval: The interval of this Widget. # noqa: E501
:type: int
"""
self._interval = interval
@property
def id(self):
"""Gets the id of this Widget. # noqa: E501
The Id of the widget # noqa: E501
:return: The id of this Widget. # noqa: E501
:rtype: int
"""
return self._id
@id.setter
def id(self, id):
"""Sets the id of this Widget.
The Id of the widget # noqa: E501
:param id: The id of this Widget. # noqa: E501
:type: int
"""
self._id = id
@property
def type(self):
"""Gets the type of this Widget. # noqa: E501
alert | deviceNOC | html | serviceOverallStatus | sgraph | ngraph | serviceNOC | serviceSLA | bigNumber | gmap | serviceIndividualStatus | gauge | pieChart | ngraph | batchjob # noqa: E501
:return: The type of this Widget. # noqa: E501
:rtype: str
"""
return self._type
@type.setter
def type(self, type):
"""Sets the type of this Widget.
alert | deviceNOC | html | serviceOverallStatus | sgraph | ngraph | serviceNOC | serviceSLA | bigNumber | gmap | serviceIndividualStatus | gauge | pieChart | ngraph | batchjob # noqa: E501
:param type: The type of this Widget. # noqa: E501
:type: str
"""
if type is None:
raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501
self._type = type
@property
def timescale(self):
"""Gets the timescale of this Widget. # noqa: E501
The default timescale of the widget # noqa: E501
:return: The timescale of this Widget. # noqa: E501
:rtype: str
"""
return self._timescale
@timescale.setter
def timescale(self, timescale):
"""Sets the timescale of this Widget.
The default timescale of the widget # noqa: E501
:param timescale: The timescale of this Widget. # noqa: E501
:type: str
"""
self._timescale = timescale
def get_real_child_model(self, data):
"""Returns the real base class specified by the discriminator"""
discriminator_value = data[self.discriminator].lower()
return self.discriminator_value_class_map.get(discriminator_value)
def
|
(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(Widget, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, Widget):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
|
to_dict
|
observer.go
|
package main
import (
"fmt"
"os"
"sync"
"time"
"github.com/fsnotify/fsnotify"
)
type (
Event struct {
data int
filename string
fileop fsnotify.Op
}
Observer interface {
NotifyCallback(Event)
}
Subject interface {
AddListener(Observer)
RemoveListener(Observer)
Notify(Event)
}
eventObserver struct {
id int
// time time.Time
}
eventSubject struct {
observers sync.Map
}
)
func (e *eventObserver) NotifyCallback(event Event) {
fmt.Printf(" - Observer %d event number: %d\n", e.id, event.data)
fmt.Printf(" - File: %s changed with file operation: %d\n", event.filename, event.fileop)
}
func (s *eventSubject) AddListener(obs Observer) {
fmt.Printf("Added: %v\n", obs)
s.observers.Store(obs, struct{}{})
}
func (s *eventSubject) RemoveListener(obs Observer) {
fmt.Printf("REMOVE: %v\n", obs)
s.observers.Delete(obs)
}
func (s *eventSubject) Notify(event Event) {
s.observers.Range(func(key interface{}, value interface{}) bool {
if key == nil || value == nil {
return false
}
key.(Observer).NotifyCallback(event)
return true
})
}
func watch(n *eventSubject, filename string) {
// creates a new file watcher
watcher, err := fsnotify.NewWatcher()
if err != nil {
fmt.Println("ERROR:", err)
}
defer watcher.Close()
done := make(chan bool)
go func() {
x := 0
for {
select {
// watch for events
case event := <-watcher.Events:
fmt.Printf("EVENT: %#v\n", event)
n.Notify(Event{data: x, filename: event.Name, fileop: event.Op})
x++
// watch for errors
case err := <-watcher.Errors:
fmt.Println("ERROR:", err)
}
}
}()
if err := watcher.Add(filename); err != nil
|
<-done
}
func main() {
filename := "./"
if len(os.Args) > 1 {
filename = os.Args[1]
}
fmt.Println("WATCHING:", filename)
n := eventSubject{
observers: sync.Map{},
}
var obs1 = eventObserver{id: 1}
var obs2 = eventObserver{id: 2}
n.AddListener(&obs1)
n.AddListener(&obs2)
//Remove observer 2 after 10 seconds
go func() {
select {
case <-time.After(time.Second * 10):
n.RemoveListener(&obs2)
}
}()
watch(&n, filename)
}
|
{
fmt.Println("ERROR:", err)
}
|
mod.rs
|
//! API client for calling Algorithmia algorithms
//!
//! # Examples
//!
//! ```no_run
//! use algorithmia::Algorithmia;
//!
//! // Initialize with an API key
//! let client = Algorithmia::client("111112222233333444445555566")?;
//! let moving_avg = client.algo("timeseries/SimpleMovingAverage/0.1");
//!
//! // Run the algorithm using a type safe decoding of the output to Vec<int>
//! // since this algorithm outputs results as a JSON array of integers
//! let input = (vec![0,1,2,3,15,4,5,6,7], 3);
//! let result: Vec<f64> = moving_avg.pipe(&input)?.decode()?;
//! println!("Completed with result: {:?}", result);
//! # Ok::<(), Box<std::error::Error>>(())
//! ```
use crate::client::HttpClient;
use crate::error::{ApiErrorResponse, Error, ResultExt};
use crate::Body;
mod bytevec;
pub use bytevec::ByteVec;
use serde::de::DeserializeOwned;
use serde::de::Error as SerdeError;
use serde::{Deserialize, Serialize};
use serde_json::{self, json, Value};
use base64;
use headers_ext::ContentType;
use mime::{self, Mime};
#[doc(hidden)]
pub use reqwest::Response;
use reqwest::Url;
use headers_ext::HeaderMapExt;
use http::header::HeaderMap;
use std::collections::HashMap;
use std::fmt;
use std::io::{self, Read, Write};
use std::ops::{Deref, DerefMut};
use std::str::FromStr;
static ALGORITHM_BASE_PATH: &'static str = "v1/algo";
/// Types that store either input or ouput to an algorithm
#[derive(Debug, Clone)]
pub struct AlgoIo {
pub(crate) data: AlgoData,
}
#[derive(Debug, Clone)]
pub(crate) enum AlgoData {
/// Text input or output
Text(String),
/// Binary input or output
Binary(Vec<u8>),
/// JSON input or output
Json(Value),
}
/// Algorithmia algorithm - intialized from the `Algorithmia` builder
pub struct Algorithm {
algo_uri: AlgoUri,
options: AlgoOptions,
client: HttpClient,
}
/// Options used to alter the algorithm call, e.g. configuring the timeout
pub struct AlgoOptions {
opts: HashMap<String, String>,
}
/// URI of an Algorithmia algorithm
#[derive(Clone)]
pub struct AlgoUri {
path: String,
}
/// Metadata returned from the API
#[derive(Debug, Deserialize)]
pub struct AlgoMetadata {
/// Algorithm execution duration
pub duration: f32,
/// Stdout from the algorithm (must enable stdout on request and be the algorithm author)
pub stdout: Option<String>,
/// API alerts (e.g. low balance warning)
pub alerts: Option<Vec<String>>,
/// Describes how the ouput's `result` field should be parsed (`text`, `json`, or `binary`)
pub content_type: String,
// Placeholder for API stability if additional fields are added later
#[serde(skip_deserializing)]
_dummy: (),
}
/// Successful API response that wraps the `AlgoIo` and its Metadata
pub struct AlgoResponse {
/// Any metadata associated with the API response
pub metadata: AlgoMetadata,
/// The algorithm output decoded into an `AlgoIo` enum
pub result: AlgoIo,
// Placeholder for API stability if additional fields are added later
_dummy: (),
}
impl Algorithm {
#[doc(hidden)]
pub fn new(client: HttpClient, algo_uri: AlgoUri) -> Algorithm {
Algorithm {
client: client,
algo_uri: algo_uri,
options: AlgoOptions::default(),
}
}
/// Get the API Endpoint URL for this Algorithm
pub fn to_url(&self) -> Result<Url, Error> {
let path = format!("{}/{}", ALGORITHM_BASE_PATH, self.algo_uri.path);
self.client
.base_url
.join(&path)
.with_context(|| format!("invalid algorithm URI {}", path))
}
/// Get the Algorithmia algo URI for this Algorithm
pub fn to_algo_uri(&self) -> &AlgoUri {
&self.algo_uri
}
/// Execute an algorithm with the specified `input_data`.
///
/// `input_data` can be any type which converts into `AlgoIo`,
/// including strings, byte slices, and any serializable type.
/// To create serializable objects for complex input, annotate your type
/// with `#[derive(Serialize)]` (see [serde.rs](http://serde.rs) for details).
/// If you want to send a raw, unparsed JSON string, use the `pipe_json` method instead.
///
/// # Examples
///
/// ```no_run
/// # use algorithmia::Algorithmia;
/// let client = Algorithmia::client("111112222233333444445555566").unwrap();
/// let moving_avg = client.algo("timeseries/SimpleMovingAverage/0.1");
/// let input = (vec![0,1,2,3,15,4,5,6,7], 3);
/// let res: Vec<f32> = moving_avg.pipe(&input)?.decode()?;
/// # Ok::<(), Box<std::error::Error>>(())
/// ```
pub fn pipe<I>(&self, input_data: I) -> Result<AlgoResponse, Error>
where
I: Into<AlgoIo>,
{
let mut res = match input_data.into().data {
AlgoData::Text(text) => self.pipe_as(text, mime::TEXT_PLAIN)?,
AlgoData::Json(json) => {
let encoded = serde_json::to_vec(&json)
.context("failed to encode algorithm input as JSON")?;
self.pipe_as(encoded, mime::APPLICATION_JSON)?
}
AlgoData::Binary(bytes) => self.pipe_as(bytes, mime::APPLICATION_OCTET_STREAM)?,
};
let mut res_json = String::new();
res.read_to_string(&mut res_json)
.context("failed to read algorithm response")?;
res_json.parse()
}
/// Execute an algorithm with a raw JSON string as input.
///
/// While the `pipe` method is more flexible in accepting different types
/// of input, and inferring the content type when making an API call,
/// `pipe_json` explicitly sends the provided string with
/// `Content-Type: application/json` making no attempt to verify that
/// the input is valid JSON. By contrast, calling `pipe` with a string
/// would send it with `Content-Type: text/plain`.
///
/// # Examples
///
/// ```no_run
/// # use algorithmia::Algorithmia;
/// let client = Algorithmia::client("111112222233333444445555566")?;
/// let minmax = client.algo("codeb34v3r/FindMinMax/0.1");
///
/// let output: Vec<u8> = minmax.pipe_json("[2,3,4]")?.decode()?;
/// # Ok::<(), Box<std::error::Error>>(())
pub fn pipe_json(&self, json_input: &str) -> Result<AlgoResponse, Error> {
let mut res = self.pipe_as(json_input.to_owned(), mime::APPLICATION_JSON)?;
let mut res_json = String::new();
res.read_to_string(&mut res_json)
.context("failed to read algorithm response")?;
res_json.parse()
}
#[doc(hidden)]
pub fn pipe_as<B>(&self, input_data: B, content_type: Mime) -> Result<Response, Error>
where
B: Into<Body>,
{
// Append options to URL as query parameters
let mut url = self.to_url()?;
if !self.options.is_empty() {
let mut query_params = url.query_pairs_mut();
for (k, v) in self.options.iter() {
query_params.append_pair(&*k, &*v);
}
}
// We just need the path and query string
let mut headers = HeaderMap::new();
headers.typed_insert(ContentType::from(content_type));
self.client
.post(url)
.headers(headers)
.body(input_data)
.send()
.with_context(|| format!("calling algorithm '{}'", self.algo_uri))
}
/// Builder method to explicitly configure options
pub fn set_options(&mut self, options: AlgoOptions) -> &mut Algorithm {
self.options = options;
self
}
/// Builder method to configure the timeout in seconds
///
/// # Examples
///
/// ```no_run
/// # use algorithmia::Algorithmia;
///
/// let client = Algorithmia::client("111112222233333444445555566")?;
/// client.algo("codeb34v3r/FindMinMax/0.1")
/// .timeout(3)
/// .pipe(vec![2,3,4])?;
/// # Ok::<(), Box<std::error::Error>>(())
/// ```
pub fn timeout(&mut self, timeout: u32) -> &mut Algorithm {
self.options.timeout(timeout);
self
}
/// Builder method to enabled or disable stdout in the response metadata
///
/// This has no affect unless authenticated as the owner of the algorithm
pub fn stdout(&mut self, stdout: bool) -> &mut Algorithm {
self.options.stdout(stdout);
self
}
}
impl AlgoUri {
/// Returns the algorithm's URI path
pub fn path(&self) -> &str {
&self.path
}
}
impl AlgoIo {
/// If the `AlgoIo` is text (or a valid JSON string), returns the associated text
pub fn as_string(&self) -> Option<&str> {
match &self.data {
AlgoData::Text(text) => Some(text),
AlgoData::Json(json) => json.as_str(),
AlgoData::Binary(_) => None,
}
}
/// If the `AlgoIo` is binary, returns the associated byte slice
pub fn as_bytes(&self) -> Option<&[u8]> {
match &self.data {
AlgoData::Text(_) | AlgoData::Json(_) => None,
AlgoData::Binary(bytes) => Some(bytes),
}
}
/// If the `AlgoIo` is Json (or JSON encodable text), returns the associated JSON string
pub fn to_json(&self) -> Option<String> {
match &self.data {
AlgoData::Text(text) => Some(json!(text).to_string()),
AlgoData::Json(json) => Some(json.to_string()),
AlgoData::Binary(_) => None,
}
}
/// If the `AlgoIo` is valid JSON, decode it to a particular type
///
pub fn decode<D: DeserializeOwned>(self) -> Result<D, Error> {
let res_json = match self.data {
AlgoData::Text(text) => json!(text),
AlgoData::Json(json) => json,
AlgoData::Binary(_) => bail!("cannot decode binary data as JSON"),
};
serde_json::from_value(res_json).context("failed to decode algorithm I/O to specified type")
}
}
impl Deref for AlgoResponse {
type Target = AlgoIo;
fn deref(&self) -> &AlgoIo {
&self.result
}
}
// We need our own TryFrom trait because we can't implement
// the conversions from AlgoIo to any generic DeserializeOwned type until specialization
#[doc(hidden)]
pub trait TryFrom<T>: Sized {
type Error;
fn try_from(val: AlgoIo) -> Result<Self, Self::Error>;
}
impl TryFrom<AlgoIo> for AlgoIo {
type Error = std::convert::Infallible;
fn try_from(val: AlgoIo) -> Result<Self, Self::Error> {
Ok(val)
}
}
impl<D: DeserializeOwned> TryFrom<AlgoIo> for D {
type Error = Error;
fn try_from(val: AlgoIo) -> Result<Self, Self::Error> {
val.decode()
}
}
impl TryFrom<AlgoIo> for ByteVec {
type Error = Error;
fn try_from(val: AlgoIo) -> Result<Self, Self::Error> {
match val.data {
AlgoData::Text(_) => bail!("Cannot convert text to byte vector"),
AlgoData::Json(_) => bail!("Cannot convert JSON to byte vector"),
AlgoData::Binary(bytes) => Ok(ByteVec::from(bytes)),
}
}
}
impl AlgoResponse {
/// If the algorithm output is JSON, decode it into a particular type
pub fn decode<D>(self) -> Result<D, Error>
where
for<'de> D: Deserialize<'de>,
{
self.result.decode()
}
}
impl AlgoOptions {
/// Configure timeout in seconds
pub fn timeout(&mut self, timeout: u32) {
self.opts.insert("timeout".into(), timeout.to_string());
}
/// Enable or disable stdout retrieval
///
/// This has no affect unless authenticated as the owner of the algorithm
pub fn stdout(&mut self, stdout: bool) {
self.opts.insert("stdout".into(), stdout.to_string());
}
}
impl Default for AlgoOptions {
fn default() -> AlgoOptions {
AlgoOptions {
opts: HashMap::new(),
}
}
}
impl Deref for AlgoOptions {
type Target = HashMap<String, String>;
fn deref(&self) -> &HashMap<String, String> {
&self.opts
}
}
impl DerefMut for AlgoOptions {
|
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.opts
}
}
impl FromStr for AlgoResponse {
type Err = Error;
fn from_str(json_str: &str) -> ::std::result::Result<Self, Self::Err> {
// Early return if the response decodes into ApiErrorResponse
if let Ok(err_res) = serde_json::from_str::<ApiErrorResponse>(json_str) {
return Err(err_res.error.into());
}
// Parse into Json object
let mut data =
Value::from_str(json_str).context("failed to decode JSON as algorithm response")?;
let metadata_value = data
.as_object_mut()
.and_then(|o| o.remove("metadata"))
.ok_or_else(|| serde_json::Error::missing_field("metadata"))
.context("failed to decode JSON as algorithm response")?;
let result_value = data
.as_object_mut()
.and_then(|o| o.remove("result"))
.ok_or_else(|| serde_json::Error::missing_field("result"))
.context("failed to decode JSON as algorithm response")?;
// Construct the AlgoIo object
let metadata = serde_json::from_value::<AlgoMetadata>(metadata_value)
.context("failed to decode JSON as algorithm response metadata")?;
let data = match (&*metadata.content_type, result_value) {
("void", _) => AlgoData::Json(Value::Null),
("json", value) => AlgoData::Json(value),
("text", value) => match value.as_str() {
Some(text) => AlgoData::Text(text.into()),
None => bail!("content did not match content type 'text'"),
},
("binary", value) => match value.as_str() {
Some(text) => {
let binary = base64::decode(text)
.context("failed to decode base64 as algorithm response")?;
AlgoData::Binary(binary)
}
None => bail!("content did not match content type 'binary'"),
},
(content_type, _) => bail!("content did not match content type '{}'", content_type),
};
// Construct the AlgoResponse object
Ok(AlgoResponse {
metadata: metadata,
result: AlgoIo { data },
_dummy: (),
})
}
}
impl fmt::Display for AlgoUri {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(&self.path)
}
}
impl fmt::Display for AlgoResponse {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match &self.result.data {
AlgoData::Text(s) => f.write_str(s),
AlgoData::Json(s) => f.write_str(&s.to_string()),
AlgoData::Binary(bytes) => f.write_str(&String::from_utf8_lossy(bytes)),
}
}
}
impl Read for AlgoResponse {
fn read(&mut self, mut buf: &mut [u8]) -> io::Result<usize> {
match &self.result.data {
AlgoData::Text(s) => buf.write(s.as_bytes()),
AlgoData::Json(s) => buf.write(s.to_string().as_bytes()),
AlgoData::Binary(bytes) => buf.write(bytes),
}
}
}
impl<'a> From<&'a str> for AlgoUri {
fn from(path: &'a str) -> Self {
let path = match path {
p if p.starts_with("algo://") => &p[7..],
p if p.starts_with('/') => &p[1..],
p => p,
};
AlgoUri {
path: path.to_owned(),
}
}
}
impl From<String> for AlgoUri {
fn from(path: String) -> Self {
let path = match path {
ref p if p.starts_with("algo://") => p[7..].to_owned(),
ref p if p.starts_with('/') => p[1..].to_owned(),
p => p,
};
AlgoUri { path: path }
}
}
// AlgoIo Conversions
impl<S: Serialize> From<S> for AlgoIo {
fn from(object: S) -> Self {
let data = AlgoData::Json(serde_json::to_value(object).expect("Failed to serialize"));
AlgoIo { data }
}
}
impl From<ByteVec> for AlgoIo {
fn from(bytes: ByteVec) -> Self {
let data = AlgoData::Binary(bytes.into());
AlgoIo { data }
}
}
impl From<AlgoResponse> for AlgoIo {
fn from(resp: AlgoResponse) -> Self {
resp.result
}
}
#[cfg(test)]
mod tests {
use super::*;
use crate::Algorithmia;
fn mock_client() -> Algorithmia {
Algorithmia::client("").unwrap()
}
#[test]
fn test_algo_without_version_to_url() {
let mock_client = mock_client();
let algorithm = mock_client.algo("/anowell/Pinky");
assert_eq!(algorithm.to_url().unwrap().path(), "/v1/algo/anowell/Pinky");
}
#[test]
fn test_algo_without_prefix_to_url() {
let mock_client = mock_client();
let algorithm = mock_client.algo("anowell/Pinky/0.1.0");
assert_eq!(
algorithm.to_url().unwrap().path(),
"/v1/algo/anowell/Pinky/0.1.0"
);
}
#[test]
fn test_algo_with_prefix_to_url() {
let mock_client = mock_client();
let algorithm = mock_client.algo("algo://anowell/Pinky/0.1");
assert_eq!(
algorithm.to_url().unwrap().path(),
"/v1/algo/anowell/Pinky/0.1"
);
}
#[test]
fn test_algo_with_sha_to_url() {
let mock_client = mock_client();
let algorithm = mock_client.algo("anowell/Pinky/abcdef123456");
assert_eq!(
algorithm.to_url().unwrap().path(),
"/v1/algo/anowell/Pinky/abcdef123456"
);
}
#[test]
fn test_json_decoding() {
let json_output =
r#"{"metadata":{"duration":0.46739511,"content_type":"json"},"result":[5,41]}"#;
let expected_result = [5, 41];
let decoded = json_output.parse::<AlgoResponse>().unwrap();
assert_eq!(0.46739511f32, decoded.metadata.duration);
assert_eq!(expected_result, &*decoded.decode::<Vec<i32>>().unwrap());
}
}
| |
backend-application-module.d.ts
|
/********************************************************************************
* Copyright (C) 2017 TypeFox and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
|
* Licenses when the conditions for such availability set forth in the Eclipse
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
* with the GNU Classpath Exception which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { ContainerModule } from 'inversify';
export declare const backendApplicationModule: ContainerModule;
//# sourceMappingURL=backend-application-module.d.ts.map
|
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
|
api.indices.get_alias.go
|
// Code generated from specification version 7.1.0 (8dc8fc507d9): DO NOT EDIT
package esapi
import (
"context"
|
)
func newIndicesGetAliasFunc(t Transport) IndicesGetAlias {
return func(o ...func(*IndicesGetAliasRequest)) (*Response, error) {
var r = IndicesGetAliasRequest{}
for _, f := range o {
f(&r)
}
return r.Do(r.ctx, t)
}
}
// ----- API Definition -------------------------------------------------------
// IndicesGetAlias returns an alias.
//
// See full documentation at http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html.
//
type IndicesGetAlias func(o ...func(*IndicesGetAliasRequest)) (*Response, error)
// IndicesGetAliasRequest configures the Indices Get Alias API request.
//
type IndicesGetAliasRequest struct {
Index []string
Name []string
AllowNoIndices *bool
ExpandWildcards string
IgnoreUnavailable *bool
Local *bool
Pretty bool
Human bool
ErrorTrace bool
FilterPath []string
ctx context.Context
}
// Do executes the request and returns response or error.
//
func (r IndicesGetAliasRequest) Do(ctx context.Context, transport Transport) (*Response, error) {
var (
method string
path strings.Builder
params map[string]string
)
method = "GET"
path.Grow(1 + len(strings.Join(r.Index, ",")) + 1 + len("_alias") + 1 + len(strings.Join(r.Name, ",")))
if len(r.Index) > 0 {
path.WriteString("/")
path.WriteString(strings.Join(r.Index, ","))
}
path.WriteString("/")
path.WriteString("_alias")
if len(r.Name) > 0 {
path.WriteString("/")
path.WriteString(strings.Join(r.Name, ","))
}
params = make(map[string]string)
if r.AllowNoIndices != nil {
params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices)
}
if r.ExpandWildcards != "" {
params["expand_wildcards"] = r.ExpandWildcards
}
if r.IgnoreUnavailable != nil {
params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable)
}
if r.Local != nil {
params["local"] = strconv.FormatBool(*r.Local)
}
if r.Pretty {
params["pretty"] = "true"
}
if r.Human {
params["human"] = "true"
}
if r.ErrorTrace {
params["error_trace"] = "true"
}
if len(r.FilterPath) > 0 {
params["filter_path"] = strings.Join(r.FilterPath, ",")
}
req, _ := newRequest(method, path.String(), nil)
if len(params) > 0 {
q := req.URL.Query()
for k, v := range params {
q.Set(k, v)
}
req.URL.RawQuery = q.Encode()
}
if ctx != nil {
req = req.WithContext(ctx)
}
res, err := transport.Perform(req)
if err != nil {
return nil, err
}
response := Response{
StatusCode: res.StatusCode,
Body: res.Body,
Header: res.Header,
}
return &response, nil
}
// WithContext sets the request context.
//
func (f IndicesGetAlias) WithContext(v context.Context) func(*IndicesGetAliasRequest) {
return func(r *IndicesGetAliasRequest) {
r.ctx = v
}
}
// WithIndex - a list of index names to filter aliases.
//
func (f IndicesGetAlias) WithIndex(v ...string) func(*IndicesGetAliasRequest) {
return func(r *IndicesGetAliasRequest) {
r.Index = v
}
}
// WithName - a list of alias names to return.
//
func (f IndicesGetAlias) WithName(v ...string) func(*IndicesGetAliasRequest) {
return func(r *IndicesGetAliasRequest) {
r.Name = v
}
}
// WithAllowNoIndices - whether to ignore if a wildcard indices expression resolves into no concrete indices. (this includes `_all` string or when no indices have been specified).
//
func (f IndicesGetAlias) WithAllowNoIndices(v bool) func(*IndicesGetAliasRequest) {
return func(r *IndicesGetAliasRequest) {
r.AllowNoIndices = &v
}
}
// WithExpandWildcards - whether to expand wildcard expression to concrete indices that are open, closed or both..
//
func (f IndicesGetAlias) WithExpandWildcards(v string) func(*IndicesGetAliasRequest) {
return func(r *IndicesGetAliasRequest) {
r.ExpandWildcards = v
}
}
// WithIgnoreUnavailable - whether specified concrete indices should be ignored when unavailable (missing or closed).
//
func (f IndicesGetAlias) WithIgnoreUnavailable(v bool) func(*IndicesGetAliasRequest) {
return func(r *IndicesGetAliasRequest) {
r.IgnoreUnavailable = &v
}
}
// WithLocal - return local information, do not retrieve the state from master node (default: false).
//
func (f IndicesGetAlias) WithLocal(v bool) func(*IndicesGetAliasRequest) {
return func(r *IndicesGetAliasRequest) {
r.Local = &v
}
}
// WithPretty makes the response body pretty-printed.
//
func (f IndicesGetAlias) WithPretty() func(*IndicesGetAliasRequest) {
return func(r *IndicesGetAliasRequest) {
r.Pretty = true
}
}
// WithHuman makes statistical values human-readable.
//
func (f IndicesGetAlias) WithHuman() func(*IndicesGetAliasRequest) {
return func(r *IndicesGetAliasRequest) {
r.Human = true
}
}
// WithErrorTrace includes the stack trace for errors in the response body.
//
func (f IndicesGetAlias) WithErrorTrace() func(*IndicesGetAliasRequest) {
return func(r *IndicesGetAliasRequest) {
r.ErrorTrace = true
}
}
// WithFilterPath filters the properties of the response body.
//
func (f IndicesGetAlias) WithFilterPath(v ...string) func(*IndicesGetAliasRequest) {
return func(r *IndicesGetAliasRequest) {
r.FilterPath = v
}
}
|
"strconv"
"strings"
|
webviewCollection.ts
|
/*
* File: /src/webviewCollection.ts
* Project: vscode-pass
* File Created: 06-07-2021 15:27:46
* Author: Clay Risser <[email protected]>
* -----
* Last Modified: 06-07-2021 16:41:24
* Modified By: Clay Risser <[email protected]>
* -----
* Silicon Hills LLC (c) Copyright 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import vscode from 'vscode';
export default class
|
{
private readonly _webviews = new Set<{
readonly resource: string;
readonly webviewPanel: vscode.WebviewPanel;
}>();
public *get(uri: vscode.Uri): Iterable<vscode.WebviewPanel> {
const key = uri.toString();
// eslint-disable-next-line no-restricted-syntax
for (const entry of this._webviews) {
if (entry.resource === key) {
yield entry.webviewPanel;
}
}
}
public add(uri: vscode.Uri, webviewPanel: vscode.WebviewPanel) {
const entry = { resource: uri.toString(), webviewPanel };
this._webviews.add(entry);
webviewPanel.onDidDispose(() => {
this._webviews.delete(entry);
});
}
}
|
WebviewCollection
|
surround.test.ts
|
import { setupWorkspace, cleanUpWorkspace } from './../testUtils';
import { ModeName } from '../../src/mode/mode';
import { ModeHandler } from '../../src/mode/modeHandler';
import { getTestingFunctions } from '../testSimplifier';
import { getAndUpdateModeHandler } from '../../extension';
suite('surround plugin', () => {
let modeHandler: ModeHandler;
let { newTest, newTestOnly } = getTestingFunctions();
setup(async () => {
await setupWorkspace('.js');
modeHandler = await getAndUpdateModeHandler();
});
teardown(cleanUpWorkspace);
newTest({
title: 'ysiw) surrounds word',
start: ['first li|ne test'],
keysPressed: 'ysiw)',
end: ['first (|line) test'],
});
newTest({
title: 'ysiw< surrounds word with tags',
start: ['first li|ne test'],
keysPressed: 'ysiw<123>',
end: ['first <123>|line</123> test'],
});
newTest({
title: 'ysiw< surrounds word with tags and attributes',
start: ['first li|ne test'],
keysPressed: 'ysiw<abc attr1 attr2="test">',
end: ['first <abc attr1 attr2="test">|line</abc> test'],
});
newTest({
title: 'yss) surrounds entire line respecting whitespace',
start: ['foo', ' foob|ar '],
keysPressed: 'yss)',
end: ['foo', ' (|foobar) '],
});
newTest({
title: 'change surround',
start: ["first 'li|ne' test"],
keysPressed: "cs')",
end: ['first (li|ne) test'],
});
newTest({
title: 'change surround to tags',
start: ['first [li|ne] test'],
keysPressed: 'cs]tabc>',
|
end: ['first <abc>li|ne</abc> test'],
});
newTest({
title: 'delete surround',
start: ["first 'li|ne' test"],
keysPressed: "ds'",
end: ['first li|ne test'],
});
newTest({
title: 'delete surround with tags',
start: ['first <test>li|ne</test> test'],
keysPressed: 'dst',
end: ['first li|ne test'],
});
});
| |
helm.go
|
package runner
import (
"bytes"
"fmt"
"os"
"os/exec"
)
type Helm struct {
Cmd string
}
type ChartParams struct {
Name string
Namespace string
ImageTag string
ChartPath string
}
func NewHelm() (*Helm, error) {
path, err := exec.LookPath("helm")
if err != nil {
return &Helm{},
fmt.Errorf("helm command not found %s", err)
}
return &Helm{Cmd: path}, nil
}
func NewHelmWithPath(path string) (*Helm, error) {
if _, err := os.Stat(path); os.IsNotExist(err) {
return &Helm{},
fmt.Errorf("helm command %s does not exist %s", path, err)
}
return &Helm{Cmd: path}, nil
}
func (h *Helm) InstallChart(args *ChartParams) error {
//nolint:gosec
cmd := exec.Command(
h.Cmd,
"install",
"--name",
args.Name,
"--namespace",
args.Namespace,
"--set",
fmt.Sprintf("image.tag=%s", args.ImageTag),
args.ChartPath,
)
if err := cmd.Run(); err != nil {
return fmt.Errorf("error %s in installing helm chart %s", err, cmd.String())
}
return nil
}
func (h *Helm) UpgradeChart(args *ChartParams) error {
//nolint:gosec
cmd := exec.Command(
h.Cmd,
"upgrade",
args.Name,
"--namespace",
args.Namespace,
"--set",
fmt.Sprintf("image.tag=%s", args.ImageTag),
args.ChartPath,
)
if err := cmd.Run(); err != nil
|
return nil
}
func (h *Helm) IsChartDeployed(name string) (bool, error) {
//nolint:gosec
cmd := exec.Command(
h.Cmd,
"ls",
fmt.Sprintf("^%s$", name),
"--short",
)
output, err := cmd.Output()
if err != nil {
return false,
fmt.Errorf("error %s in running command %s", err, cmd.String())
}
trimmed := bytes.TrimSpace(output)
if name == string(trimmed) {
return true, nil
}
return false, nil
}
func (h *Helm) IsConnected() error {
_, err := h.ServerVersion()
return err
}
func (h *Helm) ServerVersion() (string, error) {
//nolint:gosec
cmd := exec.Command(
h.Cmd,
"version",
"--server",
"--short",
)
var out bytes.Buffer
cmd.Stdout = &out
if err := cmd.Run(); err != nil {
return "", fmt.Errorf("error in getting helm version %s", err)
}
return out.String(), nil
}
|
{
return fmt.Errorf("error %s in upgrading helm chart %s", err, cmd.String())
}
|
junit.rs
|
// Copyright (c) 2018-2022 Brendan Molloy <[email protected]>,
// Ilya Solovyiov <[email protected]>,
// Kai Ren <[email protected]>
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
//! [JUnit XML report][1] [`Writer`] implementation.
//!
//! [1]: https://llg.cubic.org/docs/junit
use std::{fmt::Debug, io, mem, path::Path, time::SystemTime};
use async_trait::async_trait;
use junit_report::{
Duration, Report, TestCase, TestCaseBuilder, TestSuite, TestSuiteBuilder,
};
use crate::{
event, parser,
writer::{
self,
basic::{coerce_error, Coloring},
discard,
out::WritableString,
Ext as _, Verbosity,
},
Event, World, Writer,
};
/// Advice phrase to use in panic messages of incorrect [events][1] ordering.
///
/// [1]: event::Scenario
const WRAP_ADVICE: &str = "Consider wrapping `Writer` into `writer::Normalize`";
/// CLI options of a [`JUnit`] [`Writer`].
#[derive(clap::Args, Clone, Copy, Debug)]
pub struct Cli {
/// Verbosity of JUnit XML report output.
///
/// `0` is default verbosity, `1` additionally outputs world on failed
/// steps.
#[clap(long = "junit-v", name = "0|1")]
pub verbose: Option<u8>,
}
/// [JUnit XML report][1] [`Writer`] implementation outputting XML to an
/// [`io::Write`] implementor.
///
/// # Ordering
///
/// This [`Writer`] isn't [`Normalized`] by itself, so should be wrapped into
/// a [`writer::Normalize`], otherwise will panic in runtime as won't be able to
/// form correct [JUnit `testsuite`s][1].
///
/// [`Normalized`]: writer::Normalized
/// [1]: https://llg.cubic.org/docs/junit
#[derive(Debug)]
pub struct JUnit<W, Out: io::Write> {
/// [`io::Write`] implementor to output XML report into.
output: Out,
/// [JUnit XML report][1].
///
/// [1]: https://llg.cubic.org/docs/junit
report: Report,
/// Current [JUnit `testsuite`][1].
///
/// [1]: https://llg.cubic.org/docs/junit
suit: Option<TestSuite>,
/// [`SystemTime`] when the current [`Scenario`] has started.
///
/// [`Scenario`]: gherkin::Scenario
scenario_started_at: Option<SystemTime>,
/// Current [`Scenario`] [events][1].
///
/// [`Scenario`]: gherkin::Scenario
/// [1]: event::Scenario
events: Vec<event::Scenario<W>>,
/// [`Verbosity`] of this [`Writer`].
verbosity: Verbosity,
}
#[async_trait(?Send)]
impl<W, Out> Writer<W> for JUnit<W, Out>
where
W: World + Debug,
Out: io::Write,
{
type Cli = Cli;
#[allow(clippy::unused_async)] // false positive: #[async_trait]
async fn handle_event(
&mut self,
ev: parser::Result<Event<event::Cucumber<W>>>,
opts: &Self::Cli,
) {
use event::{Cucumber, Feature, Rule};
self.apply_cli(*opts);
match ev.map(Event::split) {
Err(err) => self.handle_error(&err),
Ok((Cucumber::Started, _)) => {}
Ok((Cucumber::Feature(feat, ev), meta)) => match ev {
Feature::Started => {
self.suit = Some(
TestSuiteBuilder::new(&format!(
"Feature: {}{}",
&feat.name,
// TODO: Use "{path}" syntax once MSRV bumps above
// 1.58.
feat.path
.as_deref()
.and_then(Path::to_str)
.map(|path| format!(": {}", path))
.unwrap_or_default(),
))
.set_timestamp(meta.at.into())
.build(),
);
}
Feature::Rule(_, Rule::Started | Rule::Finished) => {}
Feature::Rule(r, Rule::Scenario(sc, ev)) => {
self.handle_scenario_event(&feat, Some(&r), &sc, ev, meta);
}
Feature::Scenario(sc, ev) => {
self.handle_scenario_event(&feat, None, &sc, ev, meta);
}
Feature::Finished => {
let suite = self.suit.take().unwrap_or_else(|| {
// TODO: Use "{WRAP_ADVICE}" syntax once MSRV bumps
// above 1.58.
panic!(
"No `TestSuit` for `Feature` \"{}\"\n{}",
feat.name, WRAP_ADVICE,
)
});
self.report.add_testsuite(suite);
}
},
Ok((Cucumber::Finished, _)) => {
// TODO: Use "{e}" syntax once MSRV bumps above 1.58.
self.report
.write_xml(&mut self.output)
.unwrap_or_else(|e| panic!("Failed to write XML: {}", e));
}
}
}
}
impl<W, O: io::Write> writer::NonTransforming for JUnit<W, O> {}
impl<W: Debug, Out: io::Write> JUnit<W, Out> {
/// Creates a new [`Normalized`] [`JUnit`] [`Writer`] outputting XML report
/// into the given `output`.
///
/// [`Normalized`]: writer::Normalized
#[must_use]
pub fn new(
output: Out,
verbosity: impl Into<Verbosity>,
) -> writer::Normalize<W, Self> {
Self::raw(output, verbosity).normalized()
}
/// Creates a new non-[`Normalized`] [`JUnit`] [`Writer`] outputting XML
/// report into the given `output`, and suitable for feeding into [`tee()`].
///
/// [`Normalized`]: writer::Normalized
/// [`tee()`]: crate::WriterExt::tee
/// [1]: https://llg.cubic.org/docs/junit
/// [2]: crate::event::Cucumber
#[must_use]
pub fn for_tee(
output: Out,
verbosity: impl Into<Verbosity>,
) -> discard::Arbitrary<discard::Failure<Self>> {
Self::raw(output, verbosity)
.discard_failure_writes()
.discard_arbitrary_writes()
}
/// Creates a new raw and non-[`Normalized`] [`JUnit`] [`Writer`] outputting
/// XML report into the given `output`.
///
/// Use it only if you know what you're doing. Otherwise, consider using
/// [`JUnit::new()`] which creates an already [`Normalized`] version of
/// [`JUnit`] [`Writer`].
///
/// [`Normalized`]: writer::Normalized
/// [1]: https://llg.cubic.org/docs/junit
/// [2]: crate::event::Cucumber
#[must_use]
pub fn raw(output: Out, verbosity: impl Into<Verbosity>) -> Self {
Self {
output,
report: Report::new(),
suit: None,
scenario_started_at: None,
events: Vec::new(),
verbosity: verbosity.into(),
}
}
/// Applies the given [`Cli`] options to this [`JUnit`] [`Writer`].
pub fn apply_cli(&mut self, cli: Cli)
|
/// Handles the given [`parser::Error`].
fn handle_error(&mut self, err: &parser::Error) {
let (name, ty) = match err {
parser::Error::Parsing(err) => {
let path = match err.as_ref() {
gherkin::ParseFileError::Reading { path, .. }
| gherkin::ParseFileError::Parsing { path, .. } => path,
};
(
format!(
"Feature{}",
// TODO: Use "{p}" syntax once MSRV bumps above 1.58.
path.to_str()
.map(|p| format!(": {}", p))
.unwrap_or_default(),
),
"Parser Error",
)
}
parser::Error::ExampleExpansion(err) => (
format!(
"Feature: {}{}:{}",
// TODO: Use "{p}" syntax once MSRV bumps above 1.58.
err.path
.as_deref()
.and_then(Path::to_str)
.map(|p| format!("{}:", p))
.unwrap_or_default(),
err.pos.line,
err.pos.col,
),
"Example Expansion Error",
),
};
self.report.add_testsuite(
TestSuiteBuilder::new("Errors")
.add_testcase(TestCase::failure(
&name,
Duration::ZERO,
ty,
&err.to_string(),
))
.build(),
);
}
/// Handles the given [`event::Scenario`].
fn handle_scenario_event(
&mut self,
feat: &gherkin::Feature,
rule: Option<&gherkin::Rule>,
sc: &gherkin::Scenario,
ev: event::Scenario<W>,
meta: Event<()>,
) {
use event::Scenario;
match ev {
Scenario::Started => {
self.scenario_started_at = Some(meta.at);
self.events.push(Scenario::Started);
}
Scenario::Hook(..)
| Scenario::Background(..)
| Scenario::Step(..) => {
self.events.push(ev);
}
Scenario::Finished => {
let dur = self.scenario_duration(meta.at, sc);
let events = mem::take(&mut self.events);
let case = self.test_case(feat, rule, sc, &events, dur);
self.suit
.as_mut()
.unwrap_or_else(|| {
// TODO: Use "{WRAP_ADVICE}" syntax once MSRV bumps
// above 1.58.
panic!(
"No `TestSuit` for `Scenario` \"{}\"\n{}",
sc.name, WRAP_ADVICE,
)
})
.add_testcase(case);
}
}
}
/// Forms a [`TestCase`] on [`event::Scenario::Finished`].
fn test_case(
&self,
feat: &gherkin::Feature,
rule: Option<&gherkin::Rule>,
sc: &gherkin::Scenario,
events: &[event::Scenario<W>],
duration: Duration,
) -> TestCase {
use event::{Hook, HookType, Scenario, Step};
let last_event = events
.iter()
.rev()
.find(|ev| {
!matches!(
ev,
Scenario::Hook(
HookType::After,
Hook::Passed | Hook::Started,
),
)
})
.unwrap_or_else(|| {
// TODO: Use "{WRAP_ADVICE}" syntax once MSRV bumps above 1.58.
panic!(
"No events for `Scenario` \"{}\"\n{}",
sc.name, WRAP_ADVICE,
)
});
let case_name = format!(
"{}Scenario: {}: {}{}:{}",
rule.map(|r| format!("Rule: {}: ", r.name))
.unwrap_or_default(),
sc.name,
// TODO: Use "{path}" syntax once MSRV bumps above 1.58.
feat.path
.as_ref()
.and_then(|p| p.to_str())
.map(|path| format!("{}:", path))
.unwrap_or_default(),
sc.position.line,
sc.position.col,
);
let mut case = match last_event {
Scenario::Started
| Scenario::Hook(_, Hook::Started | Hook::Passed)
| Scenario::Background(_, Step::Started | Step::Passed(_))
| Scenario::Step(_, Step::Started | Step::Passed(_)) => {
TestCaseBuilder::success(&case_name, duration).build()
}
Scenario::Background(_, Step::Skipped)
| Scenario::Step(_, Step::Skipped) => {
TestCaseBuilder::skipped(&case_name).build()
}
Scenario::Hook(_, Hook::Failed(_, e)) => TestCaseBuilder::failure(
&case_name,
duration,
"Hook Panicked",
coerce_error(e).as_ref(),
)
.build(),
Scenario::Background(_, Step::Failed(_, _, e))
| Scenario::Step(_, Step::Failed(_, _, e)) => {
TestCaseBuilder::failure(
&case_name,
duration,
"Step Panicked",
&e.to_string(),
)
.build()
}
Scenario::Finished => {
// TODO: Use "{WRAP_ADVICE}" syntax once MSRV bumps above 1.58.
panic!(
"Duplicated `Finished` event for `Scenario`: \"{}\"\n{}",
sc.name, WRAP_ADVICE,
);
}
};
// We should be passing normalized events here,
// so using `writer::Basic::raw()` is OK.
let mut basic_wr = writer::Basic::raw(
WritableString(String::new()),
Coloring::Never,
self.verbosity,
);
let output = events
.iter()
.map(|ev| {
basic_wr.scenario(feat, sc, ev)?;
Ok(mem::take(&mut **basic_wr))
})
.collect::<io::Result<String>>()
.unwrap_or_else(|e| {
// TODO: Use "{e}" syntax once MSRV bumps above 1.58.
panic!("Failed to write with `writer::Basic`: {}", e)
});
case.set_system_out(&output);
case
}
/// Returns [`Scenario`]'s [`Duration`] on [`event::Scenario::Finished`].
///
/// [`Scenario`]: gherkin::Scenario
fn scenario_duration(
&mut self,
ended: SystemTime,
sc: &gherkin::Scenario,
) -> Duration {
let started_at = self.scenario_started_at.take().unwrap_or_else(|| {
// TODO: Use "{WRAP_ADVICE}" syntax once MSRV bumps above 1.58.
panic!(
"No `Started` event for `Scenario` \"{}\"\n{}",
sc.name, WRAP_ADVICE,
)
});
Duration::try_from(ended.duration_since(started_at).unwrap_or_else(
|e| {
// TODO: Use "{e}" syntax once MSRV bumps above 1.58.
panic!(
"Failed to compute duration between {:?} and {:?}: {}",
ended, started_at, e,
)
},
))
.unwrap_or_else(|e| {
// TODO: Use "{e}" syntax once MSRV bumps above 1.58.
panic!(
"Cannot covert `std::time::Duration` to `time::Duration`: {}",
e,
)
})
}
}
|
{
match cli.verbose {
None => {}
Some(0) => self.verbosity = Verbosity::Default,
_ => self.verbosity = Verbosity::ShowWorld,
};
}
|
navigation_base.js
|
/*
* mobile navigation base tag unit tests
*/
(function($){
var baseDir = $.mobile.path.parseUrl($("base").attr("href")).directory,
contentDir = $.mobile.path.makePathAbsolute("../content/", baseDir),
home = location.pathname + location.search,
baseTagEnabled = $.mobile.dynamicBaseTagEnabled,
baseTagSupported = $.support.dynamicBaseTag;
module('jquery.mobile.navigation.js - base tag', {
setup: function(){
$.mobile.navigate.history.stack = [];
$.mobile.navigate.history.activeIndex = 0;
$.testHelper.navReset( home );
}
});
asyncTest( "can navigate between internal and external pages", function(){
$.testHelper.pageSequence([
function(){
// Navigate from default internal page to another internal page.
$.testHelper.openPage( "#internal-page-2" );
},
function(){
// Verify that we are on the 2nd internal page.
$.testHelper.assertUrlLocation({
push: home + "#internal-page-2",
hash: "internal-page-2",
report: "navigate to internal page"
});
// Navigate to a page that is in the base directory. Note that the application
// document and this new page are *NOT* in the same directory.
$("#internal-page-2 .bp1").click();
},
function(){
// Verify that we are on the expected page.
$.testHelper.assertUrlLocation({
hashOrPush: baseDir + "base-page-1.html",
report: "navigate from internal page to page in base directory"
});
// Navigate to another page in the same directory as the current page.
$("#base-page-1 .bp2").click();
},
function(){
// Verify that we are on the expected page.
$.testHelper.assertUrlLocation({
hashOrPush: baseDir + "base-page-2.html",
report: "navigate from base directory page to another base directory page"
});
// Navigate to another page in a directory that is the sibling of the base.
$("#base-page-2 .cp1").click();
},
function(){
// Verify that we are on the expected page.
$.testHelper.assertUrlLocation({
hashOrPush: contentDir + "content-page-1.html",
report: "navigate from base directory page to a page in a different directory hierarchy"
});
// Navigate to another page in a directory that is the sibling of the base.
$("#content-page-1 .cp2").click();
},
function(){
// Verify that we are on the expected page.
$.testHelper.assertUrlLocation({
hashOrPush: contentDir + "content-page-2.html",
report: "navigate to another page within the same non-base directory hierarchy"
});
// Navigate to an internal page.
$("#content-page-2 .ip1").click();
},
function(){
// Verify that we are on the expected page.
|
// is the original root page element
$.testHelper.assertUrlLocation({
hashOrPush: home,
report: "navigate from a page in a non-base directory to an internal page"
});
// Try calling changePage() directly with a relative path.
$.mobile.changePage("base-page-1.html");
},
function(){
// Verify that we are on the expected page.
$.testHelper.assertUrlLocation({
hashOrPush: baseDir + "base-page-1.html",
report: "call changePage() with a filename (no path)"
});
// Try calling changePage() directly with a relative path.
$.mobile.changePage("../content/content-page-1.html");
},
function(){
// Verify that we are on the expected page.
$.testHelper.assertUrlLocation({
hashOrPush: contentDir + "content-page-1.html",
report: "call changePage() with a relative path containing up-level references"
});
// Try calling changePage() with an id
$.mobile.changePage("content-page-2.html");
},
function(){
// Verify that we are on the expected page.
$.testHelper.assertUrlLocation({
hashOrPush: contentDir + "content-page-2.html",
report: "call changePage() with a relative path should resolve relative to current page"
});
// test that an internal page works
$("a.ip2").click();
},
function(){
// Verify that we are on the expected page.
$.testHelper.assertUrlLocation({
hash: "internal-page-2",
push: home + "#internal-page-2",
report: "call changePage() with a page id"
});
// Try calling changePage() with an id
$.mobile.changePage("internal-page-1");
},
function(){
// Verify that we are on the expected page.
$.testHelper.assertUrlLocation({
hash: "internal-page-2",
push: home + "#internal-page-2",
report: "calling changePage() with a page id that is not prefixed with '#' should not change page"
});
// Previous load should have failed and left us on internal-page-2.
start();
}
]);
});
asyncTest( "internal form with no action submits to document URL", function(){
$.testHelper.pageSequence([
// open our test page
function(){
$.testHelper.openPage( "#internal-no-action-form-page" );
},
function(){
$( "#internal-no-action-form-page form" ).eq( 0 ).submit();
},
function(){
$.testHelper.assertUrlLocation({
hashOrPush: location.pathname + "?foo=1&bar=2",
report: "hash should match document url and not base url"
});
start();
}
]);
});
asyncTest( "external page form with no action submits to external page URL", function(){
$.testHelper.pageSequence([
function(){
// Go to an external page that has a form.
$("#internal-page-1 .cp1").click();
},
function(){
// Make sure we actually navigated to the external page.
$.testHelper.assertUrlLocation({
hashOrPush: contentDir + "content-page-1.html",
report: "should be on content-page-1.html"
});
// Now submit the form in the external page.
$("#content-page-1 form").eq(0).submit();
},
function(){
$.testHelper.assertUrlLocation({
hashOrPush: contentDir + "content-page-1.html?foo=1&bar=2",
report: "hash should match page url and not document url"
});
start();
}
]);
});
var testBaseTagAlteration = function( assertions ) {
$.testHelper.pageSequence([
function(){
$.mobile.changePage( "../../base-change.html" );
},
function(){
assertions();
window.history.back();
},
function() {
start();
}
]);
};
asyncTest( "disabling base tag changes should prevent base href value changes", function() {
var baseHref = $( "base" ).attr( "href" );
$.mobile.dynamicBaseEnabled = false;
testBaseTagAlteration(function() {
if ( $.support.dynamicBaseTag ) {
equal( baseHref, $( "base" ).attr( "href" ), "the base href value should be unchanged" );
} else {
equal( $.mobile.activePage.find( "#base-change-link" ).attr( "href" ), "foo", "the link href's remain unchanged" );
}
});
});
asyncTest( "enabling base tag changes should enable base href value changes", function() {
var baseHref = $( "base" ).attr( "href" );
$.mobile.dynamicBaseEnabled = true;
$.support.dynamicBaseTag = true;
testBaseTagAlteration(function() {
ok( baseHref !== $( "base" ).attr( "href" ), "the base href value should be changed" );
});
});
asyncTest( "enabling base tag changes when a dynamic base isn't supported should alter links", function() {
$.mobile.dynamicBaseEnabled = true;
$.support.dynamicBaseTag = false;
testBaseTagAlteration(function() {
var linkHref = $.mobile.activePage.find( "#base-change-link" ).attr( "href" );
if ( $.support.pushState ) {
equal( linkHref,
$.mobile.path.get( location.href ) + "foo",
"the link's href is changed" );
} else {
// compare the pathname of the links href with the directory of the current
// location + foo
equal( $.mobile.path.parseUrl( linkHref ).pathname,
$.mobile.path.parseUrl( location.href ).directory + "foo",
"the link's href is changed" );
}
});
});
})(jQuery);
|
// the hash based nav result (hash:) is dictate by the fact that #internal-page-1
|
content.js
|
/**
* @author Eric COURTIAL <[email protected]>
*/
define(
["jquery", "platforms", "games", "game", "home", "platformEditor", "gameEditor", "historyEditor", "history", "tradingEditor", "trading"],
function ($, platforms, games, game, home, platformEditor, gameEditor, historyEditor, history, tradingEditor, trading) {
"use strict";
/**
* Object handling the Ajax call
*/
var dataManager = function () {
/**
* Constructor
*/
var self = this;
/**
* Contact the server to extract or POST data
*/
this.request = function (targetUrl, displayObject, context = null, persist = false, payload = null, requestType = "GET", callback = null) {
if (persist === true) {
previousUrl = targetUrl;
previousDisplayer = displayObject;
previousContext = context;
}
$.ajax({
type: requestType,
url: targetUrl,
data: payload,
success: function (data, textStatus, jqXHR) {
self.showTempMsg(false);
if (data && data.message) {
self.displayMsg(data.message);
} else if (displayObject) {
displayObject.diplayData(data, context);
} else if (callback) {
callback();
}
},
error: function (jqXHR, textStatus, errorThrown) {
self.showTempMsg(false);
self.displayMsg(jqXHR.responseJSON, true);
}
});
};
/**
* Display generic msg
*/
this.displayMsg = function (message, error = false) {
if (error) {
var intro = "Une erreur est survenue : ";
} else {
var intro = "Information : "
}
$("#content").append(intro + message);
};
/**
* Show / Hide the temporary msg "Please wait..."
*/
this.showTempMsg = function(status) {
if (status) {
$("#content").empty();
$("#tempMsg").show();
} else {
$("#tempMsg").hide();
}
};
}; // End of the data getter object
// Function to display home content
function displayHomeContent() {
dataManager.showTempMsg(true);
dataManager.request(hallOfFameUrl, home);
}
function deleteGame(gameId) {
if (confirm("Etes-vous sûr de vouloir supprimer ce jeu?") === false) {
return false;
}
dataManager.showTempMsg(true);
if (previousDisplayer === null || previousDisplayer === game) {
previousContext = 'home';
previousDisplayer = home;
previousUrl = hallOfFameUrl;
}
var callback = function() {
$( "#extraP").trigger( "gameEditDone", [gameId]);
};
dataManager.request(deleteGameUrl+gameId, null, null, false, {'_token': $('#tokenCSRF').html()}, 'DELETE', callback)
}
function deleteHistory(id) {
if (confirm("Etes-vous sûr de vouloir supprimer cette entrée ?") === false) {
return false;
}
var callback = function() {
$("#history").trigger("click");
};
dataManager.showTempMsg(true);
dataManager.request(deleteHistoryUrl + id, null, null, false, {'_token': $('#tokenCSRF').html()}, 'DELETE', callback);
}
function deleteTradingHistory(id) {
if (confirm("Etes-vous sûr de vouloir supprimer cette entrée ?") === false) {
return false;
}
var callback = function() {
$("#trading_history").trigger("click");
};
dataManager.showTempMsg(true);
dataManager.request(deleteTradeHistoryUrl + id, null, null, false, {'_token': $('#tokenCSRF').html()}, 'DELETE', callback);
}
/**
* Event listeners
*/
// Game after edition
$( "#extraP" ).on( "gameEditDone", function(event, gameId) {
dataManager.showTempMsg(true);
if (previousContext !== null) {
dataManager.request(previousUrl, previousDisplayer, previousContext);
} else {
dataManager.request(gameDetailsUrl + gameId, game, 'gameEdit', true);
}
});
// Return to game list
$( "#extraP" ).on( "returnToGameListForThisPlaftorm", function(event, supportId) {
dataManager.showTempMsg(true);
dataManager.request(gameListByPlatformUrl + supportId, games, 'gamePerPlatform', true);
});
/**
* On startup
*/
var dataManager = new dataManager();
dataManager.showTempMsg(true);
displayHomeContent();
/** Main Menu listeners */
// Click on the home menu
$('#homeMenu').click(function() {
displayHomeContent();
return false;
});
// Click on the platform menu
$('#platforms').click(function() {
dataManager.showTempMsg(true);
dataManager.request(platformListUrl, platforms, null);
return false;
});
// Click on the various menu items listing games
$('[id^="special-list"]').click(function() {
var request = $(this).attr('id').substring(13);
dataManager.showTempMsg(true);
dataManager.request(gamesSpecialListUrl + request, games, request, true);
return false;
});
// Click on the random menu
$('[id^="random"]').click(function() {
var request = $(this).attr('id').substring(7);
dataManager.showTempMsg(true);
dataManager.request(randomgameUrl + request, game, request, false);
previousUrl = null;
previousContext = null;
previousDisplayer = null;
return false;
});
// Click on the platform menu
$('#history').click(function() {
dataManager.showTempMsg(true);
dataManager.request(getHistoryUrl, history, null);
return false;
});
// Click on the trading menu
$('#trading_history').click(function() {
dataManager.showTempMsg(true);
dataManager.request(getTradingHistoryUrl, trading, null);
return false;
});
// Search form
$('#searchForm').submit(function() {
var url = gamesSpecialListUrl + 'search?query=' + $('#gameSearch').val();
dataManager.showTempMsg(true);
dataManager.request(url, games, 'gameSearch', true);
return false;
});
// Add platform form
$('#addPlatform').click(function() {
dataManager.showTempMsg(true);
|
});
// Add game form
$('#addGame').click(function() {
dataManager.showTempMsg(true);
dataManager.request(addGameUrl, gameEditor, 'add');
return false;
});
// Add history entry form
$('#addHistory').click(function() {
dataManager.showTempMsg(true);
dataManager.request(addHistoryUrl, historyEditor, 'add');
return false;
});
// Add trading history entry form
$('#addTradingHistory').click(function() {
dataManager.showTempMsg(true);
dataManager.request(addTradingHistoryUrl, tradingEditor, 'add');
return false;
});
/** Content listeners */
// Handle clicks on dynamically added links
$("#content").on("click", "a", function(){
var linkType = $(this).data('link-type');
var id = $(this).attr('id').substring(6);
if (linkType === 'gamePerPlatform') {
var url = gameListByPlatformUrl + id
var displayObject = games;
var persist = true;
} else if (linkType === 'gameDetails') {
var url = gameDetailsUrl + id
var displayObject = game;
var persist = true;
} else if (linkType === 'gameEdit') {
var url = editGameUrl + id
var displayObject = gameEditor;
var persist = false;
} else if (linkType === 'gameDelete') {
// Specific use case since we do a DELETE instead of a GET
deleteGame(id);
return false;
} else if(linkType === 'historyDelete') {
deleteHistory(id);
return false;
} else if(linkType === 'tradingHistoryDelete') {
deleteTradingHistory(id);
return false;
}else {
return false;
}
dataManager.showTempMsg(true);
dataManager.request(url, displayObject, linkType, persist);
return false;
});
}
);
|
dataManager.request(addPlatformUrl, platformEditor, 'add');
return false;
|
sputnik.py
|
# -*- coding: utf-8 -*-
import os
import sys
from news_crawler.spiders import BaseSpider
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
from datetime import datetime
sys.path.insert(0, os.path.join(os.getcwd(), "..",))
from news_crawler.items import NewsCrawlerItem
from news_crawler.utils import remove_empty_paragraphs
class Sputniknews(BaseSpider):
"""Spider for Sputniknews"""
name = 'sputniknews'
rotate_user_agent = True
allowed_domains = ['snanews.de']
start_urls = ['https://snanews.de']
# Exclude pages without relevant articles
rules = (
Rule(
LinkExtractor(
allow=(r'snanews\.de\/\d+\/\w.*\.html$'),
deny=(r'snanews\.de\/category\_multimedia\/',
r'snanews\.de\/location\_oesterreich\/',
r'snanews\.de\/\?modal\=feedback',
r'snanews\.de\/docs\/impressum\.html',
r'snanews\.de\/docs\/cookie\.html',
r'snanews\.de\/docs\/nutzungsrichtlinien\.html',
r'snanews\.de\/docs\/ueber\_uns\.html',
r'snanews\.de\/docs\/privacy\_policy\.html'
)
),
callback='parse_item',
follow=True
),
)
def parse_item(self, response):
"""
Checks article validity. If valid, it parses it.
"""
# Check date validity
creation_date = response.xpath('//div[@itemprop="datePublished"]/text()').get()
if not creation_date:
return
creation_date = datetime.fromisoformat(creation_date.split('T')[0])
if self.is_out_of_date(creation_date):
return
# Extract the article's paragraphs
paragraphs = [node.xpath('string()').get().strip() for node in response.xpath('//div[@class="article__text"] | //div[@class="article__quote-text"]')]
paragraphs = remove_empty_paragraphs(paragraphs)
text = ' '.join([para for para in paragraphs])
# Check article's length validity
if not self.has_min_length(text):
return
# Check keywords validity
if not self.has_valid_keywords(text):
|
item = NewsCrawlerItem()
item['news_outlet'] = 'sputniknews'
item['provenance'] = response.url
item['query_keywords'] = self.get_query_keywords()
# Get creation, modification, and crawling dates
item['creation_date'] = creation_date.strftime('%d.%m.%Y')
last_modified = response.xpath('//div[@itemprop="dateModified"]/text()').get()
item['last_modified'] = datetime.fromisoformat(last_modified.split('T')[0]).strftime('%d.%m.%Y')
item['crawl_date'] = datetime.now().strftime('%d.%m.%Y')
# Get authors
authors = response.xpath('//div[@itemprop="creator"]/div[@itemprop="name"]/text()').getall()
item['author_person'] = authors if authors else list()
item['author_organization'] = list()
# Extract keywords, if available
news_keywords = response.xpath('//meta[@name="keywords"]/@content').get()
item['news_keywords'] = news_keywords.split(', ') if news_keywords else list()
# Get title, description, and body of article
title = response.xpath('//meta[@property="og:title"]/@content').get()
description = response.xpath('//meta[@property="og:description"]/@content').get()
# Body as dictionary: key = headline (if available, otherwise empty string), values = list of corresponding paragraphs
body = dict()
if response.xpath('//h3[@class="article__h2"] | //h2[@class="article__h2"]'):
# Extract headlines
headlines = [h2.xpath('string()').get().strip() for h2 in response.xpath('//h3[@class="article__h2"] | //h2[@class="article__h2"]')]
# Extract the paragraphs and headlines together
text = [node.xpath('string()').get().strip() for node in response.xpath('//div[@class="article__text"] | //div[@class="article__quote-text"] | //h3[@class="article__h2"] | //h2[@class="article__h2"]')]
# Extract paragraphs between the abstract and the first headline
body[''] = remove_empty_paragraphs(text[:text.index(headlines[0])])
# Extract paragraphs corresponding to each headline, except the last one
for i in range(len(headlines)-1):
body[headlines[i]] = remove_empty_paragraphs(text[text.index(headlines[i])+1:text.index(headlines[i+1])])
# Extract the paragraphs belonging to the last headline
body[headlines[-1]] = remove_empty_paragraphs(text[text.index(headlines[-1])+1:])
else:
# The article has no headlines, just paragraphs
body[''] = paragraphs
item['content'] = {'title': title, 'description': description, 'body':body}
# Extract first 5 recommendations towards articles from the same news outlet, if available
item['recommendations'] = list()
item['response_body'] = response.body
yield item
|
return
# Parse the valid article
|
cuhk03_np_detected_jpg.py
|
import os.path as osp
from PIL import Image
import numpy as np
from scipy.misc import imsave
from tqdm import tqdm
import shutil
from ...utils.file import walkdir
from ...utils.file import may_make_dir
from .market1501 import Market1501
class CUHK03NpDetectedJpg(Market1501):
has_pap_mask = True
has_ps_label = True
png_im_root = 'cuhk03-np'
im_root = 'cuhk03-np-jpg'
split_spec = {
'train': {'pattern': '{}/detected/bounding_box_train/*.jpg'.format(im_root), 'map_label': True},
'query': {'pattern': '{}/detected/query/*.jpg'.format(im_root), 'map_label': False},
'gallery': {'pattern': '{}/detected/bounding_box_test/*.jpg'.format(im_root), 'map_label': False},
}
def __init__(self, cfg, samples=None):
|
def _get_kpt_key(self, im_path):
return im_path
def _get_ps_label_path(self, im_path):
return osp.join(self.root, im_path.replace(self.im_root, self.im_root + '_ps_label').replace('.jpg', '.png'))
def _save_png_as_jpg(self):
png_im_dir = osp.join(self.root, self.png_im_root)
jpg_im_dir = osp.join(self.root, self.im_root)
assert osp.exists(png_im_dir), "The PNG image dir {} should be placed inside {}".format(png_im_dir, self.root)
png_paths = list(walkdir(png_im_dir, '.png'))
if osp.exists(jpg_im_dir):
jpg_paths = list(walkdir(jpg_im_dir, '.jpg'))
if len(png_paths) == len(jpg_paths):
print('=> Found same number of JPG images. Skip transforming PNG to JPG.')
return
else:
shutil.rmtree(jpg_im_dir)
print('=> JPG image dir exists but does not contain same number of images. So it is removed and would be re-generated.')
# CUHK03 contains 14097 detected + 14096 labeled images = 28193
for png_path in tqdm(png_paths, desc='PNG->JPG', miniters=2000, ncols=120, unit=' images'):
jpg_path = png_path.replace(self.png_im_root, self.im_root).replace('.png', '.jpg')
may_make_dir(osp.dirname(jpg_path))
imsave(jpg_path, np.array(Image.open(png_path)))
|
self.root = osp.join(cfg.root, cfg.name)
self._save_png_as_jpg()
super(CUHK03NpDetectedJpg, self).__init__(cfg, samples=samples)
|
main.js
|
var gaAccount = 'UA-XXXXXXXX-X';
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = 'https://ssl.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
var _gaq = _gaq || [];
_gaq.push(['_setAccount', gaAccount]);
_gaq.push(['_trackPageview']);
searchJira = function(word){
var query = word.selectionText;
chrome.storage.sync.get(['baseUrl', 'searchSuffix'], function(items) {
var baseUrl = items['baseUrl'] || '/options.html?'; //redirect to options if not provided
var searchSuffix = items['searchSuffix'];
console.log(baseUrl+searchSuffix);
chrome.tabs.create({url: baseUrl + searchSuffix + query});
});
_gaq.push(['_trackEvent','searchJira','success']);
};
chrome.runtime.onInstalled.addListener(function() {
chrome.contextMenus.create({
id:"jirasearch",
title: "Search JIRA",
contexts:["selection"],
onclick: searchJira
|
});
//redirection
var getQueryString = function ( field, url ) {
var href = url ? url : window.location.href;
var reg = new RegExp( '[?&]' + field + '=([^&#]*)', 'i' );
var string = reg.exec(href);
return string ? string[1] : null;
};
function redirect(){
var jira = getQueryString('jira');
if(jira){
try{
//Quick-Fixes #1 (eliminate any parens from the Jira string)
jira = jira.replace(/[()]/g, '');
chrome.storage.sync.get('baseUrl', function(items) {
var baseurl, browseurl;
baseurl = items['baseUrl'] || chrome.extension.getURL("options.html")+"?";
browseurl = baseurl+'browse/';
_gaq.push(['_trackEvent','clickLinkToJira','success']);
_gaq.push(function(){
window.location.href = browseurl+jira;
});
});
} catch(ex) {
_gaq.push(['_trackEvent','clickLinkToJira','failure']);
}
}else{
_gaq.push(['_trackEvent','backgroundInitialized','success']);
}
}
document.addEventListener('DOMContentLoaded', redirect);
|
});
|
outputs.py
|
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__all__ = [
'PolicyStatement',
'GetGroupsGroupResult',
'GetPoliciesPolicyResult',
'GetRolesRoleResult',
'GetSamlProvidersProviderResult',
'GetUsersUserResult',
]
@pulumi.output_type
class PolicyStatement(dict):
def __init__(__self__, *,
actions: Sequence[str],
effect: str,
resources: Sequence[str]):
"""
:param Sequence[str] actions: (It has been deprecated from version 1.49.0, and use field 'document' to replace.) List of operations for the `resource`. The format of each item in this list is `${service}:${action_name}`, such as `oss:ListBuckets` and `ecs:Describe*`. The `${service}` can be `ecs`, `oss`, `ots` and so on, the `${action_name}` refers to the name of an api interface which related to the `${service}`.
:param str effect: (It has been deprecated from version 1.49.0, and use field 'document' to replace.) This parameter indicates whether or not the `action` is allowed. Valid values are `Allow` and `Deny`.
:param Sequence[str] resources: (It has been deprecated from version 1.49.0, and use field 'document' to replace.) List of specific objects which will be authorized. The format of each item in this list is `acs:${service}:${region}:${account_id}:${relative_id}`, such as `acs:ecs:*:*:instance/inst-002` and `acs:oss:*:1234567890000:mybucket`. The `${service}` can be `ecs`, `oss`, `ots` and so on, the `${region}` is the region info which can use `*` replace when it is not supplied, the `${account_id}` refers to someone's Alicloud account id or you can use `*` to replace, the `${relative_id}` is the resource description section which related to the `${service}`.
"""
pulumi.set(__self__, "actions", actions)
pulumi.set(__self__, "effect", effect)
pulumi.set(__self__, "resources", resources)
@property
@pulumi.getter
def actions(self) -> Sequence[str]:
"""
(It has been deprecated from version 1.49.0, and use field 'document' to replace.) List of operations for the `resource`. The format of each item in this list is `${service}:${action_name}`, such as `oss:ListBuckets` and `ecs:Describe*`. The `${service}` can be `ecs`, `oss`, `ots` and so on, the `${action_name}` refers to the name of an api interface which related to the `${service}`.
"""
return pulumi.get(self, "actions")
@property
@pulumi.getter
def effect(self) -> str:
"""
(It has been deprecated from version 1.49.0, and use field 'document' to replace.) This parameter indicates whether or not the `action` is allowed. Valid values are `Allow` and `Deny`.
"""
return pulumi.get(self, "effect")
@property
@pulumi.getter
def resources(self) -> Sequence[str]:
"""
(It has been deprecated from version 1.49.0, and use field 'document' to replace.) List of specific objects which will be authorized. The format of each item in this list is `acs:${service}:${region}:${account_id}:${relative_id}`, such as `acs:ecs:*:*:instance/inst-002` and `acs:oss:*:1234567890000:mybucket`. The `${service}` can be `ecs`, `oss`, `ots` and so on, the `${region}` is the region info which can use `*` replace when it is not supplied, the `${account_id}` refers to someone's Alicloud account id or you can use `*` to replace, the `${relative_id}` is the resource description section which related to the `${service}`.
"""
return pulumi.get(self, "resources")
@pulumi.output_type
class GetGroupsGroupResult(dict):
def __init__(__self__, *,
comments: str,
name: str):
"""
:param str comments: Comments of the group.
:param str name: Name of the group.
"""
pulumi.set(__self__, "comments", comments)
pulumi.set(__self__, "name", name)
@property
@pulumi.getter
def comments(self) -> str:
"""
Comments of the group.
"""
return pulumi.get(self, "comments")
@property
@pulumi.getter
def name(self) -> str:
"""
Name of the group.
"""
return pulumi.get(self, "name")
@pulumi.output_type
class GetPoliciesPolicyResult(dict):
def __init__(__self__, *,
attachment_count: int,
create_date: str,
default_version: str,
description: str,
document: str,
id: str,
name: str,
policy_document: str,
policy_name: str,
type: str,
update_date: str,
user_name: str,
version_id: str):
"""
:param int attachment_count: Attachment count of the policy.
:param str create_date: Creation date of the policy.
:param str default_version: Default version of the policy.
:param str description: Description of the policy.
:param str document: Policy document of the policy.
:param str name: Name of the policy.
:param str policy_document: Policy document of the policy.
:param str policy_name: Name of the policy.
:param str type: Filter results by a specific policy type. Valid values are `Custom` and `System`.
:param str update_date: Update date of the policy.
:param str user_name: Filter results by a specific user name. Returned policies are attached to the specified user.
:param str version_id: The ID of default policy.
"""
pulumi.set(__self__, "attachment_count", attachment_count)
pulumi.set(__self__, "create_date", create_date)
pulumi.set(__self__, "default_version", default_version)
pulumi.set(__self__, "description", description)
pulumi.set(__self__, "document", document)
pulumi.set(__self__, "id", id)
pulumi.set(__self__, "name", name)
pulumi.set(__self__, "policy_document", policy_document)
pulumi.set(__self__, "policy_name", policy_name)
pulumi.set(__self__, "type", type)
pulumi.set(__self__, "update_date", update_date)
pulumi.set(__self__, "user_name", user_name)
pulumi.set(__self__, "version_id", version_id)
@property
@pulumi.getter(name="attachmentCount")
def attachment_count(self) -> int:
"""
Attachment count of the policy.
"""
return pulumi.get(self, "attachment_count")
@property
@pulumi.getter(name="createDate")
def create_date(self) -> str:
"""
Creation date of the policy.
"""
return pulumi.get(self, "create_date")
@property
@pulumi.getter(name="defaultVersion")
def default_version(self) -> str:
"""
Default version of the policy.
"""
return pulumi.get(self, "default_version")
@property
@pulumi.getter
def description(self) -> str:
"""
Description of the policy.
"""
return pulumi.get(self, "description")
@property
@pulumi.getter
def document(self) -> str:
"""
Policy document of the policy.
"""
return pulumi.get(self, "document")
@property
@pulumi.getter
def id(self) -> str:
return pulumi.get(self, "id")
@property
@pulumi.getter
def name(self) -> str:
"""
Name of the policy.
"""
return pulumi.get(self, "name")
@property
@pulumi.getter(name="policyDocument")
def policy_document(self) -> str:
"""
Policy document of the policy.
"""
return pulumi.get(self, "policy_document")
@property
@pulumi.getter(name="policyName")
def policy_name(self) -> str:
"""
Name of the policy.
"""
return pulumi.get(self, "policy_name")
@property
@pulumi.getter
def type(self) -> str:
"""
Filter results by a specific policy type. Valid values are `Custom` and `System`.
"""
return pulumi.get(self, "type")
@property
@pulumi.getter(name="updateDate")
def update_date(self) -> str:
"""
Update date of the policy.
"""
return pulumi.get(self, "update_date")
@property
@pulumi.getter(name="userName")
def user_name(self) -> str:
"""
Filter results by a specific user name. Returned policies are attached to the specified user.
"""
return pulumi.get(self, "user_name")
@property
@pulumi.getter(name="versionId")
def version_id(self) -> str:
"""
The ID of default policy.
"""
return pulumi.get(self, "version_id")
@pulumi.output_type
class GetRolesRoleResult(dict):
def __init__(__self__, *,
arn: str,
assume_role_policy_document: str,
create_date: str,
description: str,
document: str,
id: str,
name: str,
update_date: str):
|
@property
@pulumi.getter
def arn(self) -> str:
"""
Resource descriptor of the role.
"""
return pulumi.get(self, "arn")
@property
@pulumi.getter(name="assumeRolePolicyDocument")
def assume_role_policy_document(self) -> str:
"""
Authorization strategy of the role. This parameter is deprecated and replaced by `document`.
"""
return pulumi.get(self, "assume_role_policy_document")
@property
@pulumi.getter(name="createDate")
def create_date(self) -> str:
"""
Creation date of the role.
"""
return pulumi.get(self, "create_date")
@property
@pulumi.getter
def description(self) -> str:
"""
Description of the role.
"""
return pulumi.get(self, "description")
@property
@pulumi.getter
def document(self) -> str:
"""
Authorization strategy of the role.
"""
return pulumi.get(self, "document")
@property
@pulumi.getter
def id(self) -> str:
"""
Id of the role.
"""
return pulumi.get(self, "id")
@property
@pulumi.getter
def name(self) -> str:
"""
Name of the role.
"""
return pulumi.get(self, "name")
@property
@pulumi.getter(name="updateDate")
def update_date(self) -> str:
"""
Update date of the role.
"""
return pulumi.get(self, "update_date")
@pulumi.output_type
class GetSamlProvidersProviderResult(dict):
def __init__(__self__, *,
arn: str,
description: str,
encodedsaml_metadata_document: str,
id: str,
saml_provider_name: str,
update_date: str):
"""
:param str arn: The Alibaba Cloud Resource Name (ARN) of the IdP.
:param str description: The description of SAML Provider.
:param str encodedsaml_metadata_document: The encodedsaml metadata document.
:param str id: The ID of the SAML Provider.
:param str saml_provider_name: The saml provider name.
:param str update_date: The update time.
"""
pulumi.set(__self__, "arn", arn)
pulumi.set(__self__, "description", description)
pulumi.set(__self__, "encodedsaml_metadata_document", encodedsaml_metadata_document)
pulumi.set(__self__, "id", id)
pulumi.set(__self__, "saml_provider_name", saml_provider_name)
pulumi.set(__self__, "update_date", update_date)
@property
@pulumi.getter
def arn(self) -> str:
"""
The Alibaba Cloud Resource Name (ARN) of the IdP.
"""
return pulumi.get(self, "arn")
@property
@pulumi.getter
def description(self) -> str:
"""
The description of SAML Provider.
"""
return pulumi.get(self, "description")
@property
@pulumi.getter(name="encodedsamlMetadataDocument")
def encodedsaml_metadata_document(self) -> str:
"""
The encodedsaml metadata document.
"""
return pulumi.get(self, "encodedsaml_metadata_document")
@property
@pulumi.getter
def id(self) -> str:
"""
The ID of the SAML Provider.
"""
return pulumi.get(self, "id")
@property
@pulumi.getter(name="samlProviderName")
def saml_provider_name(self) -> str:
"""
The saml provider name.
"""
return pulumi.get(self, "saml_provider_name")
@property
@pulumi.getter(name="updateDate")
def update_date(self) -> str:
"""
The update time.
"""
return pulumi.get(self, "update_date")
@pulumi.output_type
class GetUsersUserResult(dict):
def __init__(__self__, *,
create_date: str,
id: str,
last_login_date: str,
name: str):
"""
:param str create_date: Creation date of the user.
:param str id: The original id is user name, but it is user id in 1.37.0+.
:param str last_login_date: Last login date of the user. Removed from version 1.79.0.
:param str name: Name of the user.
"""
pulumi.set(__self__, "create_date", create_date)
pulumi.set(__self__, "id", id)
pulumi.set(__self__, "last_login_date", last_login_date)
pulumi.set(__self__, "name", name)
@property
@pulumi.getter(name="createDate")
def create_date(self) -> str:
"""
Creation date of the user.
"""
return pulumi.get(self, "create_date")
@property
@pulumi.getter
def id(self) -> str:
"""
The original id is user name, but it is user id in 1.37.0+.
"""
return pulumi.get(self, "id")
@property
@pulumi.getter(name="lastLoginDate")
def last_login_date(self) -> str:
"""
Last login date of the user. Removed from version 1.79.0.
"""
return pulumi.get(self, "last_login_date")
@property
@pulumi.getter
def name(self) -> str:
"""
Name of the user.
"""
return pulumi.get(self, "name")
|
"""
:param str arn: Resource descriptor of the role.
:param str assume_role_policy_document: Authorization strategy of the role. This parameter is deprecated and replaced by `document`.
:param str create_date: Creation date of the role.
:param str description: Description of the role.
:param str document: Authorization strategy of the role.
:param str id: Id of the role.
:param str name: Name of the role.
:param str update_date: Update date of the role.
"""
pulumi.set(__self__, "arn", arn)
pulumi.set(__self__, "assume_role_policy_document", assume_role_policy_document)
pulumi.set(__self__, "create_date", create_date)
pulumi.set(__self__, "description", description)
pulumi.set(__self__, "document", document)
pulumi.set(__self__, "id", id)
pulumi.set(__self__, "name", name)
pulumi.set(__self__, "update_date", update_date)
|
tree_plot.py
|
import uuid
import pydot
def get_root(tree):
"""Get the root node of the tree.
Parameters
----------
tree : dict
The tree.
Returns
----------
s : :py:class:`ast_toolbox.mcts.AdaptiveStressTesting.ASTState`
The root state.
"""
for s in tree.keys():
if s.parent is None:
return s
def
|
(s, tree):
"""Transfer the AST state to pydot node.
Parameters
----------
s : :py:class:`ast_toolbox.mcts.AdaptiveStressTesting.ASTState`
The AST state.
tree : dict
The tree.
Returns
----------
node : :py:class:`pydot.Node`
The pydot node.
"""
if s in tree.keys():
return pydot.Node(str(uuid.uuid4()), label='n=' + str(tree[s].n))
else:
return None
def add_children(s, s_node, tree, graph, d):
"""Add successors of s into the graph.
Parameters
----------
s : :py:class:`ast_toolbox.mcts.AdaptiveStressTesting.ASTState`
The AST state.
s_node : :py:class:`pydot.Node`
The pydot node corresponding to s.
tree : dict
The tree.
graph : :py:class:`pydot.Dot`
The pydot graph.
d : int
The depth.
"""
if d > 0:
for a in tree[s].a.keys():
n = tree[s].a[a].n
q = tree[s].a[a].q
assert len(tree[s].a[a].s.keys()) == 1
for ns in tree[s].a[a].s.keys():
ns_node = s2node(ns, tree)
if ns_node is not None:
graph.add_node(ns_node)
graph.add_edge(pydot.Edge(s_node, ns_node, label="n=" + str(n) + " a=" + str(a.get()) + " q=" + str(q)))
# graph.add_edge(pydot.Edge(s_node, ns_node))
add_children(ns, ns_node, tree, graph, d - 1)
def plot_tree(tree, d, path, format="svg"):
"""Plot the tree.
Parameters
----------
tree : dict
The tree.
d : int
The depth.
path : str
The plotting path.
format : str
The plotting format.
"""
graph = pydot.Dot(graph_type='digraph')
root = get_root(tree)
root_node = s2node(root, tree)
graph.add_node(root_node)
add_children(root, root_node, tree, graph, d)
filename = path + "." + format
if format == "svg":
graph.write(filename)
elif format == "png":
graph.write(filename)
|
s2node
|
interface.go
|
// This file was automatically generated by informer-gen
package image
import (
v1 "github.com/openshift/client-go/image/informers/externalversions/image/v1"
internalinterfaces "github.com/openshift/client-go/image/informers/externalversions/internalinterfaces"
)
// Interface provides access to each of this group's versions.
type Interface interface {
// V1 provides access to shared informers for resources in V1.
V1() v1.Interface
}
type group struct {
factory internalinterfaces.SharedInformerFactory
namespace string
tweakListOptions internalinterfaces.TweakListOptionsFunc
}
// New returns a new Interface.
func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface
|
// V1 returns a new v1.Interface.
func (g *group) V1() v1.Interface {
return v1.New(g.factory, g.namespace, g.tweakListOptions)
}
|
{
return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
}
|
bonus-manager.component.spec.ts
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { BonusManagerComponent } from './bonus-manager.component';
describe('BonusManagerComponent', () => {
let component: BonusManagerComponent;
|
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ BonusManagerComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(BonusManagerComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
|
let fixture: ComponentFixture<BonusManagerComponent>;
|
cache.py
|
#!/usr/bin/python
#
# Copyright 2018-2022 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from polyaxon.exceptions import PolyaxonSchemaError
from polyaxon.managers.project import ProjectConfigManager
from polyaxon.utils.formatting import Printer
CACHE_ERROR = (
"Found an invalid project config or project config cache, "
"if you are using Polyaxon CLI please run: "
"`polyaxon config purge --cache-only`"
)
def get_local_project(is_cli: bool = False):
|
def _is_same_project(owner=None, project=None):
local_project = get_local_project(is_cli=True)
if project and project == local_project.name:
return not all([owner, local_project.owner]) or owner == local_project.owner
def _cache_project(config, owner=None, project=None):
if (
ProjectConfigManager.is_initialized()
and ProjectConfigManager.is_locally_initialized()
):
if _is_same_project(owner, project):
ProjectConfigManager.set_config(config)
return
ProjectConfigManager.set_config(
config, visibility=ProjectConfigManager.VISIBILITY_GLOBAL
)
def cache(config_manager, config, owner=None, project=None):
if config_manager == ProjectConfigManager:
_cache_project(config=config, project=project, owner=owner)
# Set caching only if we have an initialized project
if not ProjectConfigManager.is_initialized():
return
if not _is_same_project(owner, project):
return
visibility = (
ProjectConfigManager.VISIBILITY_LOCAL
if ProjectConfigManager.is_locally_initialized()
else ProjectConfigManager.VISIBILITY_GLOBAL
)
config_manager.set_config(config, visibility=visibility)
|
try:
return ProjectConfigManager.get_config()
except Exception: # noqa
if is_cli:
Printer.print_error(CACHE_ERROR, sys_exit=True)
else:
raise PolyaxonSchemaError(CACHE_ERROR)
|
values_test.go
|
package json
import (
"testing"
"github.com/dotamixer/doom/pkg/lion/source"
)
func TestValues(t *testing.T) {
data := []byte(`{"foo": "bar", "baz": {"bar": "cat"}}`)
testData := []struct {
path []string
value string
}{
{
[]string{"foo"},
"bar",
},
{
|
"cat",
},
}
values, err := newValues(&source.ChangeSet{
Data: data,
})
if err != nil {
t.Fatal(err)
}
for _, test := range testData {
if v := values.Get(test.path...).String(""); v != test.value {
t.Fatalf("Expected %s got %s for path %v", test.value, v, test.path)
}
}
}
|
[]string{"baz", "bar"},
|
train_and_predict-checkpoint.py
|
import tensorflow as tf
import os
import time
import json
import pandas as pd
"""
Script to train a sequential NN.
Takes a df, filters based on `condition` (default None), and separates into test/train based on time
NN trains on training data, all results output to disk
"""
def train_test_split(df,filter_condition,train_condition, test_condition,features,targets):
"""
Separate df into a train and test set.
Returns training and testing dfs as well as split into inputs/outputs
"""
#Filter dataset
if filter_condition is not None:
df_filtered = df.query(filter_condition)
else:
df_filtered = df
#Select train/test data
training_data = df_filtered.query(train_condition)
test_data = df_filtered.query(test_condition)
#Separate into features/targets
x_train = training_data[features]
y_train = training_data[targets]
x_test = test_data[features]
y_test = test_data[targets]
return x_train,y_train,x_test,y_test,training_data, test_data #
def create_normalizer_layer(x_train):
#Create a normaliser layer
print ('Creating a normalization layer')
normalizer = tf.keras.layers.Normalization(axis=-1)
normalizer.adapt(x_train)
return normalizer
def train_NN(x_train,y_train,normalizer):
#Check GPU available
print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))
#Create a basic NN model
model = tf.keras.Sequential([
normalizer,
tf.keras.layers.Dense(int(len(features)/2), activation='relu',input_shape=(len(features),),name='layer1'),
tf.keras.layers.Dense(1, name='output')
])
#Compile it
print ('Compiling model')
model.compile(optimizer='adam',
loss='mse',
metrics=['accuracy'])
#Train it
print('Training model')
history = model.fit(x_train, y_train, epochs=100, batch_size=10000)
return history, model
def write_outputs(output_path,model,history,x_train,y_train,x_test,y_test,df_train,df_test):
print ('Writing outputs to dir: ', fout)
id = int(time.time())
fout = output_path+f'ML_{str(id)}/'
os.makedirs(fout)
print ('Writing outputs to dir: ', fout)
#NN
model.save(fout+'trained_model')
history_dict = history.history
json.dump(history_dict, open(fout+'history.json', 'w'))
#Data
#Probaby overkill saving all of these
x_train.to_pickle(fout + "x_train.pkl")
y_train.to_pickle(fout + "y_train.pkl")
x_test.to_pickle(fout + "x_test.pkl")
x_test.to_pickle(fout + "y_test.pkl")
df_train.to_pickle(fout + "df_train.pkl")
df_test.to_pickle(fout + "df_test.pkl")
|
#Load the data
print('Loading the data')
df = pd.read_pickle(input_file)
#Process into train/test
targets = ['MODIS_LST']
x_train,y_train,x_test,y_test,df_train,df_test = train_test_split(df,filter_condition,train_condition, test_condition,features,targets)
#Train NN
normalizer = create_normalizer_layer(x_train)
history,model = train_NN(x_train,y_train,normalizer)
#Save trained NN in new dir, along with train/test sets
write_outputs(output_path,model,history,x_train,y_train,x_test,y_test,df_train,df_test)
#Parameters
#IO
input_file = '/network/group/aopp/predict/TIP016_PAXTON_RPSPEEDY/ML4L/ECMWF_files/raw/MODIS_ERA_joined_data_averaged.pkl'
output_path = '/network/group/aopp/predict/TIP016_PAXTON_RPSPEEDY/ML4L/'
#Pre Processing
filter_condition = None
train_condition = 'time < "2019-01-01 00:00:00"'
test_condition = 'time >= "2020-01-01 00:00:00"'
features = ['sp', 'msl', 'u10', 'v10','t2m',
'aluvp', 'aluvd', 'alnip', 'alnid', 'cl',
'cvl', 'cvh', 'slt', 'sdfor', 'z', 'sd', 'sdor', 'isor', 'anor', 'slor',
'd2m', 'lsm', 'fal']
#Go
pipeline(input_file,output_path,filter_condition,train_condition, test_condition,features)
|
def pipeline(input_file,output_path,filter_condition,train_condition, test_condition,features):
|
resource_aws_acm_certificate_validation.go
|
package aws
import (
"fmt"
"log"
"reflect"
"sort"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/acm"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/schema"
)
func resourceAwsAcmCertificateValidation() *schema.Resource {
return &schema.Resource{
Create: resourceAwsAcmCertificateValidationCreate,
Read: resourceAwsAcmCertificateValidationRead,
Delete: resourceAwsAcmCertificateValidationDelete,
Schema: map[string]*schema.Schema{
"certificate_arn": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"validation_record_fqdns": {
Type: schema.TypeSet,
Optional: true,
ForceNew: true,
Elem: &schema.Schema{Type: schema.TypeString},
Set: schema.HashString,
},
},
Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(45 * time.Minute),
},
}
}
func resourceAwsAcmCertificateValidationCreate(d *schema.ResourceData, meta interface{}) error
|
func resourceAwsAcmCertificateCheckValidationRecords(validation_record_fqdns []interface{}, cert *acm.CertificateDetail) error {
expected_fqdns := make([]string, len(cert.DomainValidationOptions))
for i, v := range cert.DomainValidationOptions {
if *v.ValidationMethod == acm.ValidationMethodDns {
expected_fqdns[i] = strings.TrimSuffix(*v.ResourceRecord.Name, ".")
}
}
actual_validation_record_fqdns := make([]string, 0, len(validation_record_fqdns))
for _, v := range validation_record_fqdns {
val := v.(string)
actual_validation_record_fqdns = append(actual_validation_record_fqdns, strings.TrimSuffix(val, "."))
}
sort.Strings(expected_fqdns)
sort.Strings(actual_validation_record_fqdns)
log.Printf("[DEBUG] Checking validation_record_fqdns. Expected: %v, Actual: %v", expected_fqdns, actual_validation_record_fqdns)
if !reflect.DeepEqual(expected_fqdns, actual_validation_record_fqdns) {
return fmt.Errorf("Certificate needs %v to be set but only %v was passed to validation_record_fqdns", expected_fqdns, actual_validation_record_fqdns)
}
return nil
}
func resourceAwsAcmCertificateValidationRead(d *schema.ResourceData, meta interface{}) error {
acmconn := meta.(*AWSClient).acmconn
params := &acm.DescribeCertificateInput{
CertificateArn: aws.String(d.Get("certificate_arn").(string)),
}
resp, err := acmconn.DescribeCertificate(params)
if err != nil && isAWSErr(err, acm.ErrCodeResourceNotFoundException, "") {
d.SetId("")
return nil
} else if err != nil {
return fmt.Errorf("Error describing certificate: %s", err)
}
if *resp.Certificate.Status != "ISSUED" {
log.Printf("[INFO] Certificate status not issued, was %s, tainting validation", *resp.Certificate.Status)
d.SetId("")
} else {
d.SetId((*resp.Certificate.IssuedAt).String())
}
return nil
}
func resourceAwsAcmCertificateValidationDelete(d *schema.ResourceData, meta interface{}) error {
// No need to do anything, certificate will be deleted when acm_certificate is deleted
d.SetId("")
return nil
}
|
{
certificate_arn := d.Get("certificate_arn").(string)
acmconn := meta.(*AWSClient).acmconn
params := &acm.DescribeCertificateInput{
CertificateArn: aws.String(certificate_arn),
}
resp, err := acmconn.DescribeCertificate(params)
if err != nil {
return fmt.Errorf("Error describing certificate: %s", err)
}
if *resp.Certificate.Type != "AMAZON_ISSUED" {
return fmt.Errorf("Certificate %s has type %s, no validation necessary", *resp.Certificate.CertificateArn, *resp.Certificate.Type)
}
if validation_record_fqdns, ok := d.GetOk("validation_record_fqdns"); ok {
err := resourceAwsAcmCertificateCheckValidationRecords(validation_record_fqdns.(*schema.Set).List(), resp.Certificate)
if err != nil {
return err
}
} else {
log.Printf("[INFO] No validation_record_fqdns set, skipping check")
}
return resource.Retry(d.Timeout(schema.TimeoutCreate), func() *resource.RetryError {
resp, err := acmconn.DescribeCertificate(params)
if err != nil {
return resource.NonRetryableError(fmt.Errorf("Error describing certificate: %s", err))
}
if *resp.Certificate.Status != "ISSUED" {
return resource.RetryableError(fmt.Errorf("Expected certificate to be issued but was in state %s", *resp.Certificate.Status))
}
log.Printf("[INFO] ACM Certificate validation for %s done, certificate was issued", certificate_arn)
return resource.NonRetryableError(resourceAwsAcmCertificateValidationRead(d, meta))
})
}
|
.Test4TESTESETES.py
|
###########################################################################
# This file holds the plotting routine for the KP solution from the Schmiesy
# Thesie. There is no timestepping, it plots only the initial condition.
############################################################################
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits.mplot3d import axes3d
from scipy import interpolate
def main():
# Loop over all examples
for exampleNum in xrange(0,3+1):
print exampleNum
cFileName, sFileName, gFileName = defFileNames( exampleNum );
coordData, solnData, groupData = loadData(cFileName, sFileName,
gFileName)
createPlot(coordData, solnData, groupData, str(exampleNum))
# Show all the plots at the end.
plt.show()
def defFileNames( exampleNum ):
coordfile = ('/home/jeremy/Documents/research/RiemannSurfaces/jTEM-Jeremy/'
'/jeremy/plotting/data/Test4/coords' + str(exampleNum)+'.csv' )
solsfile = ('/home/jeremy/Documents/research/RiemannSurfaces/jTEM-Jeremy/'
'/jeremy/plotting/data/Test4/soln' + str(exampleNum)+'.csv' )
groupfile = ('/home/jeremy/Documents/research/RiemannSurfaces/jTEM-Jeremy/'
'/jeremy/plotting/data/Test4/group' + str(exampleNum)+'.csv' )
|
return coordfile, solsfile, groupfile
def loadData( cFileName, sFileName, gFileName ):
coordData = np.genfromtxt(cFileName, dtype=float, delimiter=',',
names=True); # comes in (t,x,y) tuples
solnData = np.genfromtxt(sFileName, dtype=float, delimiter=',',
names=True); # comes in (Real, Imaginary) pairs.
groupData = np.genfromtxt(gFileName, dtype=float, delimiter=',',
names=True); # comes in (Real, Imaginary) pairs.
return coordData, solnData, groupData
def createPlot(coordData, solnData, groupData, exampleNum=' NOT GIVEN'):
# Create both the KP Soln plot and the Group Data plot side-by-side
fig = plt.figure()
# First plot the group data
ax1 = plt.subplot(2,1,1)
plotGroupData( groupData, ax1 )
# Then plot the KP Soln
ax2 = plt.subplot(2,1,2, projection='3d')
plotKP( coordData, solnData, ax2 )
fig.suptitle('Example Number'+str(exampleNum))
fig.savefig( '/home/jeremy/Documents/research/RiemannSurfaces/jTEM-Jeremy/jeremy/plotting/data/Test4/ExampleNum'
+ str(exampleNum) + '.eps', format = 'eps' )
def plotGroupData( groupData, ax ):
ReCenters = np.array( [ entry[0] for entry in groupData ] )
ImCenters = np.array( [ entry[1] for entry in groupData ] )
Radii = np.array( [ entry[2] for entry in groupData ] )
ReC0 = lambda t,j: ReCenters[j]+Radii[j]*np.cos(t)
ImC0 = lambda t,j: ImCenters[j]+Radii[j]*np.sin(t)
teval = np.arange( 0.0, 2*np.pi, 0.1 ) #the range to evaluate over
ax.plot( ReC0(teval,0), ImC0(teval,0 ) )
ax.plot( ReC0(teval,1), ImC0(teval,1 ) )
ax.set_xlim( [-6, 6] )
ax.set_ylim( [-6, 6] )
plt.gca().set_aspect('equal')
def plotKP( coordData, solnData, ax ):
#Define the data
t = np.zeros(coordData.shape)
x = np.zeros(coordData.shape)
y = np.zeros(coordData.shape)
j = 0;
for txy in coordData:
t[j] = txy[0]
x[j] = txy[1]
y[j] = txy[2]
j = j+1;
# Check that solution is entirely real-valued.
if sum( [ sol[1] for sol in solnData ] )>0: # then solution is not real-valued
raise ValueError("The solution has nonzero imaginary part.")
realSoln = np.array( [ sol[0] for sol in solnData ] )
tstep = len(t)
# Find the xstep by checking for the value at which x changes from 0 to
# nonzero. Since x changes last
xstep = np.where(x[:-1] != x[1:])[0][0] + 1
# Right now this only works for evenly spaced grids. I.e. xstep = ystep.
ystep = xstep
z = realSoln[ 0:tstep ]
# Put it on a grid.
xx = x.reshape( (xstep, xstep) )
yy = y.reshape( (ystep, ystep) )
zz = z.reshape( xx.shape )
surf = ax.plot_surface( xx, yy, zz, rstride=2, cstride=2, cmap=cm.coolwarm,
linewidth = 0.2)#, antialiased = True )
ax.set_zlim( np.min(realSoln), np.max(realSoln) )
ax.set_xlabel('x'); ax.set_ylabel('y');
#ax.set_title('Example Number'+exampleNum)
if __name__ == '__main__':
main()
| |
xaes_test.go
|
// Copyright 2019 The Gaea Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package crypto
import (
"encoding/base64"
"testing"
)
func TestEncryptECB(t *testing.T)
|
{
key := "1234abcd5678efg*"
msg := "mQSa0mS1Gi1Q8VCVLHrbU_izaHqzaPmh"
data, err := EncryptECB(key, []byte(msg))
if err != nil {
t.Fatalf("encrypt failed, err:%v", err)
return
}
base64Str := base64.StdEncoding.EncodeToString(data)
t.Logf("encrypt succ, data: %v, data str: %s, len:%v", data, base64Str, len(data))
data, _ = base64.StdEncoding.DecodeString(base64Str)
origin, err := DecryptECB(key, data)
if err != nil {
t.Fatalf("decrypt failed, err:%v", err)
return
}
if string(origin) != msg {
t.Fatalf("origin not equal msg")
}
t.Log("decrypt succ")
}
|
|
cli_auth_utils.py
|
#!/usr/bin/env python3
import getpass
import inspect
import os
import sys
import clitool
import mc_bin_client
import memcacheConstants
from functools import wraps
def cmd_decorator(f):
"""Decorate a function with code to authenticate based on
the following additional arguments passed by keyword:
bucketName
username
password
passwordFromStdin - if true, user will be prompted for password on stdin
"""
@wraps(f)
def g(*args, **kwargs):
# check arguments are suitable for wrapped func
mc = args[0]
spec = inspect.getargspec(f)
max_args = len(spec.args)
defaults = len(spec.defaults) if spec.defaults else 0
min_args = max_args - defaults
if len(args) < min_args:
print(("Error: too few arguments - command "
"expected a minimum of %s but was passed "
"%s: %s"
% (min_args - 1, len(args) - 1, list(args[1:]))), file=sys.stderr)
sys.exit(2)
if spec.varargs is None:
if len(args) > max_args:
print(("Error: too many arguments - command "
"expected a maximum of %s but was passed "
"%s: %s"
% (max_args - 1, len(args) - 1, list(args[1:]))), file=sys.stderr)
sys.exit(2)
# extract auth and bucket parameters (not passed to wrapped function)
bucket = kwargs.pop('bucketName', None)
username = kwargs.pop('username', None) or bucket
cli_password = kwargs.pop('password', None)
stdin_password = (getpass.getpass()
if kwargs.pop('passwordFromStdin', False)
else None)
env_password = os.getenv("CB_PASSWORD", None)
password = cli_password or stdin_password or env_password
# try to auth
if username is not None or password is not None:
bucket = bucket or 'default'
username = username or bucket
password = password or ''
try:
mc.sasl_auth_plain(username, password)
except mc_bin_client.MemcachedError:
print("Authentication error for user:{0} bucket:{1}"
.format(username, bucket))
sys.exit(1)
# HELO
mc.enable_xerror()
mc.enable_collections()
mc.hello("{0} {1}".format(os.path.split(sys.argv[0])[1],
os.getenv("EP_ENGINE_VERSION",
"unknown version")))
# call function for one or all buckets
try:
if kwargs.pop('allBuckets', None):
buckets = mc.list_buckets()
for bucket in buckets:
print('*' * 78)
print(bucket)
print()
mc.bucket_select(bucket)
f(*args, **kwargs)
elif bucket is not None:
mc.bucket_select(bucket)
f(*args, **kwargs)
else:
f(*args, **kwargs)
except mc_bin_client.ErrorEaccess:
print("No access to bucket:{0} - permission denied "
"or bucket does not exist.".format(bucket))
sys.exit(1)
return g
def
|
(extraUsage="", allBuckets=True):
c = clitool.CliTool(extraUsage)
if allBuckets:
c.addFlag('-a', 'allBuckets', 'iterate over all buckets')
c.addOption('-b', 'bucketName', 'the bucket to get stats from (Default: default)')
c.addOption('-u', 'username', 'the user as which to authenticate (Default: bucketName)')
c.addOption('-p', 'password', 'the password for the bucket if one exists')
c.addFlag('-S', 'passwordFromStdin', 'read password from stdin')
return c
|
get_authed_clitool
|
test_ssl.py
|
import platform
import sys
import mock
import pytest
from urllib3.util import ssl_
from urllib3.exceptions import SNIMissingWarning
@pytest.mark.parametrize(
"addr",
[
# IPv6
"::1",
"::",
"FE80::8939:7684:D84b:a5A4%251",
# IPv4
"127.0.0.1",
"8.8.8.8",
b"127.0.0.1",
# IPv6 w/ Zone IDs
"FE80::8939:7684:D84b:a5A4%251",
b"FE80::8939:7684:D84b:a5A4%251",
"FE80::8939:7684:D84b:a5A4%19",
b"FE80::8939:7684:D84b:a5A4%19",
],
)
def test_is_ipaddress_true(addr):
assert ssl_.is_ipaddress(addr)
@pytest.mark.parametrize(
"addr",
[
"www.python.org",
b"www.python.org",
"v2.sg.media-imdb.com",
b"v2.sg.media-imdb.com",
],
)
def test_is_ipaddress_false(addr):
assert not ssl_.is_ipaddress(addr)
@pytest.mark.parametrize(
["has_sni", "server_hostname", "uses_sni"],
[
(True, "127.0.0.1", False),
(False, "www.python.org", False),
(False, "0.0.0.0", False),
(True, "www.google.com", True),
(True, None, False),
(False, None, False),
],
)
def test_context_sni_with_ip_address(monkeypatch, has_sni, server_hostname, uses_sni):
monkeypatch.setattr(ssl_, "HAS_SNI", has_sni)
sock = mock.Mock()
context = mock.create_autospec(ssl_.SSLContext)
ssl_.ssl_wrap_socket(sock, server_hostname=server_hostname, ssl_context=context)
if uses_sni:
context.wrap_socket.assert_called_with(sock, server_hostname=server_hostname)
else:
context.wrap_socket.assert_called_with(sock)
@pytest.mark.parametrize(
["has_sni", "server_hostname", "should_warn"],
[
(True, "www.google.com", False),
(True, "127.0.0.1", False),
(False, "127.0.0.1", False),
(False, "www.google.com", True),
(True, None, False),
(False, None, False),
],
)
def test_sni_missing_warning_with_ip_addresses(
monkeypatch, has_sni, server_hostname, should_warn
):
monkeypatch.setattr(ssl_, "HAS_SNI", has_sni)
sock = mock.Mock()
context = mock.create_autospec(ssl_.SSLContext)
with mock.patch("warnings.warn") as warn:
ssl_.ssl_wrap_socket(sock, server_hostname=server_hostname, ssl_context=context)
if should_warn:
assert warn.call_count >= 1
warnings = [call[0][1] for call in warn.call_args_list]
assert SNIMissingWarning in warnings
else:
assert warn.call_count == 0
@pytest.mark.parametrize(
["ciphers", "expected_ciphers"],
[
(None, ssl_.DEFAULT_CIPHERS),
("ECDH+AESGCM:ECDH+CHACHA20", "ECDH+AESGCM:ECDH+CHACHA20"),
],
)
def
|
(monkeypatch, ciphers, expected_ciphers):
context = mock.create_autospec(ssl_.SSLContext)
context.set_ciphers = mock.Mock()
context.options = 0
monkeypatch.setattr(ssl_, "SSLContext", lambda *_, **__: context)
assert ssl_.create_urllib3_context(ciphers=ciphers) is context
assert context.set_ciphers.call_count == 1
assert context.set_ciphers.call_args == mock.call(expected_ciphers)
def test_wrap_socket_given_context_no_load_default_certs():
context = mock.create_autospec(ssl_.SSLContext)
context.load_default_certs = mock.Mock()
sock = mock.Mock()
ssl_.ssl_wrap_socket(sock, ssl_context=context)
context.load_default_certs.assert_not_called()
def test_wrap_socket_given_ca_certs_no_load_default_certs(monkeypatch):
if platform.python_implementation() == "PyPy" and sys.version_info[0] == 2:
# https://github.com/testing-cabal/mock/issues/438
pytest.xfail("fails with PyPy for Python 2 dues to funcsigs bug")
context = mock.create_autospec(ssl_.SSLContext)
context.load_default_certs = mock.Mock()
context.options = 0
monkeypatch.setattr(ssl_, "SSLContext", lambda *_, **__: context)
sock = mock.Mock()
ssl_.ssl_wrap_socket(sock, ca_certs="/tmp/fake-file")
context.load_default_certs.assert_not_called()
context.load_verify_locations.assert_called_with("/tmp/fake-file", None)
def test_wrap_socket_default_loads_default_certs(monkeypatch):
context = mock.create_autospec(ssl_.SSLContext)
context.load_default_certs = mock.Mock()
context.options = 0
monkeypatch.setattr(ssl_, "SSLContext", lambda *_, **__: context)
sock = mock.Mock()
ssl_.ssl_wrap_socket(sock)
context.load_default_certs.assert_called_with()
@pytest.mark.parametrize(
["pha", "expected_pha"], [(None, None), (False, True), (True, True)]
)
def test_create_urllib3_context_pha(monkeypatch, pha, expected_pha):
context = mock.create_autospec(ssl_.SSLContext)
context.set_ciphers = mock.Mock()
context.options = 0
context.post_handshake_auth = pha
monkeypatch.setattr(ssl_, "SSLContext", lambda *_, **__: context)
assert ssl_.create_urllib3_context() is context
assert context.post_handshake_auth == expected_pha
|
test_create_urllib3_context_set_ciphers
|
types.ts
|
import * as React from 'react';
export interface GlobalState {}
export type AnyCallback = (state: GlobalState, payload: any) => GlobalState;
export type AnyActions<TCallback> = Record<string, TCallback>;
export type ActionsOutput<
TCallback extends AnyCallback,
TActions extends AnyActions<TCallback>
> = {
[K in keyof TActions]: (payload: Parameters<TActions[K]>[1]) => void;
};
export type StateMachineContextValue = {
state: GlobalState;
setState: React.Dispatch<React.SetStateAction<GlobalState>>;
};
export type MiddleWare = (
state: GlobalState,
payload: any,
callbackName: string,
) => GlobalState;
export type PersistOptions = 'onAction' | 'none' | 'beforeUnload';
export type StateMachineOptions = Partial<{
name: string;
middleWares: MiddleWare[];
storageType: Storage;
persist: PersistOptions;
}>;
declare global {
interface Window {
__LSM_NAME__: any;
__LSM__: any;
|
__LSM_LOAD__: any;
__LSM_DEBUG_NAME__: any;
}
}
|
__LSM_DEBUG__: any;
__LSM_RESET__: any;
__LSM_GET_STORE__: any;
__LSM_SAVE_TO__: any;
|
model_invoke_function_request.go
|
package model
import (
"encoding/json"
"strings"
)
// Request Object
type InvokeFunctionRequest struct {
FunctionUrn string `json:"function_urn"`
XCffLogType *string `json:"X-Cff-Log-Type,omitempty"`
XCFFRequestVersion *string `json:"X-CFF-Request-Version,omitempty"`
// 执行函数请求体,为json格式。
Body map[string]interface{} `json:"body,omitempty"`
}
|
data, err := json.Marshal(o)
if err != nil {
return "InvokeFunctionRequest struct{}"
}
return strings.Join([]string{"InvokeFunctionRequest", string(data)}, " ")
}
|
func (o InvokeFunctionRequest) String() string {
|
secret.rs
|
// -*- mode: rust; -*-
//
// This file is part of ed25519-dalek.
// Copyright (c) 2017-2019 isis lovecruft
// See LICENSE for licensing information.
//
// Authors:
// - isis agora lovecruft <[email protected]>
//! ed25519 secret key types.
use core::fmt::Debug;
use curve25519_dalek::constants;
use curve25519_dalek::digest::generic_array::typenum::U64;
use curve25519_dalek::digest::Digest;
use curve25519_dalek::edwards::CompressedEdwardsY;
use curve25519_dalek::scalar::Scalar;
use rand::{CryptoRng, RngCore};
use sha2::Sha512;
#[cfg(feature = "serde")]
use serde::de::Error as SerdeError;
#[cfg(feature = "serde")]
use serde::de::Visitor;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
#[cfg(feature = "serde")]
use serde::{Deserializer, Serializer};
use zeroize::Zeroize;
use crate::constants::*;
use crate::errors::*;
use crate::public::*;
use crate::signature::*;
/// An EdDSA secret key.
///
/// Instances of this secret are automatically overwritten with zeroes when they
/// fall out of scope.
#[derive(Zeroize)]
#[zeroize(drop)] // Overwrite secret key material with null bytes when it goes out of scope.
pub struct SecretKey(pub(crate) [u8; SECRET_KEY_LENGTH]);
impl Debug for SecretKey {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
write!(f, "SecretKey: {:?}", &self.0[..])
}
}
impl AsRef<[u8]> for SecretKey {
fn as_ref(&self) -> &[u8] {
self.as_bytes()
}
}
impl SecretKey {
/// Convert this secret key to a byte array.
#[inline]
pub fn to_bytes(&self) -> [u8; SECRET_KEY_LENGTH] {
self.0
}
/// View this secret key as a byte array.
#[inline]
pub fn as_bytes<'a>(&'a self) -> &'a [u8; SECRET_KEY_LENGTH] {
&self.0
}
/// Construct a `SecretKey` from a slice of bytes.
///
/// # Example
///
/// ```
/// # extern crate ed25519_dalek;
/// #
/// use ed25519_dalek::SecretKey;
/// use ed25519_dalek::SECRET_KEY_LENGTH;
/// use ed25519_dalek::SignatureError;
///
/// # fn doctest() -> Result<SecretKey, SignatureError> {
/// let secret_key_bytes: [u8; SECRET_KEY_LENGTH] = [
/// 157, 097, 177, 157, 239, 253, 090, 096,
/// 186, 132, 074, 244, 146, 236, 044, 196,
/// 068, 073, 197, 105, 123, 050, 105, 025,
/// 112, 059, 172, 003, 028, 174, 127, 096, ];
///
/// let secret_key: SecretKey = SecretKey::from_bytes(&secret_key_bytes)?;
/// #
/// # Ok(secret_key)
/// # }
/// #
/// # fn main() {
/// # let result = doctest();
/// # assert!(result.is_ok());
/// # }
/// ```
///
/// # Returns
///
/// A `Result` whose okay value is an EdDSA `SecretKey` or whose error value
/// is an `SignatureError` wrapping the internal error that occurred.
#[inline]
pub fn from_bytes(bytes: &[u8]) -> Result<SecretKey, SignatureError> {
if bytes.len() != SECRET_KEY_LENGTH {
return Err(InternalError::BytesLengthError {
name: "SecretKey",
length: SECRET_KEY_LENGTH,
}.into());
}
let mut bits: [u8; 32] = [0u8; 32];
bits.copy_from_slice(&bytes[..32]);
Ok(SecretKey(bits))
}
/// Generate a `SecretKey` from a `csprng`.
///
/// # Example
///
/// ```
/// extern crate rand;
/// extern crate ed25519_dalek;
///
/// # #[cfg(feature = "std")]
/// # fn main() {
/// #
/// use rand::rngs::OsRng;
/// use ed25519_dalek::PublicKey;
/// use ed25519_dalek::SecretKey;
/// use ed25519_dalek::Signature;
///
/// let mut csprng = OsRng{};
/// let secret_key: SecretKey = SecretKey::generate(&mut csprng);
/// # }
/// #
/// # #[cfg(not(feature = "std"))]
/// # fn main() { }
/// ```
///
/// Afterwards, you can generate the corresponding public:
///
/// ```
/// # extern crate rand;
/// # extern crate ed25519_dalek;
/// #
/// # fn main() {
/// #
/// # use rand::rngs::OsRng;
/// # use ed25519_dalek::PublicKey;
/// # use ed25519_dalek::SecretKey;
/// # use ed25519_dalek::Signature;
/// #
/// # let mut csprng = OsRng{};
/// # let secret_key: SecretKey = SecretKey::generate(&mut csprng);
///
/// let public_key: PublicKey = (&secret_key).into();
/// # }
/// ```
///
/// # Input
///
/// A CSPRNG with a `fill_bytes()` method, e.g. `rand::OsRng`
pub fn
|
<T>(csprng: &mut T) -> SecretKey
where
T: CryptoRng + RngCore,
{
let mut sk: SecretKey = SecretKey([0u8; 32]);
csprng.fill_bytes(&mut sk.0);
sk
}
}
#[cfg(feature = "serde")]
impl Serialize for SecretKey {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
serializer.serialize_bytes(self.as_bytes())
}
}
#[cfg(feature = "serde")]
impl<'d> Deserialize<'d> for SecretKey {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: Deserializer<'d>,
{
struct SecretKeyVisitor;
impl<'d> Visitor<'d> for SecretKeyVisitor {
type Value = SecretKey;
fn expecting(&self, formatter: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
formatter.write_str("An ed25519 secret key as 32 bytes, as specified in RFC8032.")
}
fn visit_bytes<E>(self, bytes: &[u8]) -> Result<SecretKey, E>
where
E: SerdeError,
{
SecretKey::from_bytes(bytes).or(Err(SerdeError::invalid_length(bytes.len(), &self)))
}
}
deserializer.deserialize_bytes(SecretKeyVisitor)
}
}
/// An "expanded" secret key.
///
/// This is produced by using an hash function with 512-bits output to digest a
/// `SecretKey`. The output digest is then split in half, the lower half being
/// the actual `key` used to sign messages, after twiddling with some bits.¹ The
/// upper half is used a sort of half-baked, ill-designed² pseudo-domain-separation
/// "nonce"-like thing, which is used during signature production by
/// concatenating it with the message to be signed before the message is hashed.
///
/// Instances of this secret are automatically overwritten with zeroes when they
/// fall out of scope.
//
// ¹ This results in a slight bias towards non-uniformity at one spectrum of
// the range of valid keys. Oh well: not my idea; not my problem.
//
// ² It is the author's view (specifically, isis agora lovecruft, in the event
// you'd like to complain about me, again) that this is "ill-designed" because
// this doesn't actually provide true hash domain separation, in that in many
// real-world applications a user wishes to have one key which is used in
// several contexts (such as within tor, which does domain separation
// manually by pre-concatenating static strings to messages to achieve more
// robust domain separation). In other real-world applications, such as
// bitcoind, a user might wish to have one master keypair from which others are
// derived (à la BIP32) and different domain separators between keys derived at
// different levels (and similarly for tree-based key derivation constructions,
// such as hash-based signatures). Leaving the domain separation to
// application designers, who thus far have produced incompatible,
// slightly-differing, ad hoc domain separation (at least those application
// designers who knew enough cryptographic theory to do so!), is therefore a
// bad design choice on the part of the cryptographer designing primitives
// which should be simple and as foolproof as possible to use for
// non-cryptographers. Further, later in the ed25519 signature scheme, as
// specified in RFC8032, the public key is added into *another* hash digest
// (along with the message, again); it is unclear to this author why there's
// not only one but two poorly-thought-out attempts at domain separation in the
// same signature scheme, and which both fail in exactly the same way. For a
// better-designed, Schnorr-based signature scheme, see Trevor Perrin's work on
// "generalised EdDSA" and "VXEdDSA".
#[derive(Zeroize)]
#[zeroize(drop)] // Overwrite secret key material with null bytes when it goes out of scope.
pub struct ExpandedSecretKey {
pub(crate) key: Scalar,
pub(crate) nonce: [u8; 32],
}
impl<'a> From<&'a SecretKey> for ExpandedSecretKey {
/// Construct an `ExpandedSecretKey` from a `SecretKey`.
///
/// # Examples
///
/// ```
/// # extern crate rand;
/// # extern crate sha2;
/// # extern crate ed25519_dalek;
/// #
/// # fn main() {
/// #
/// use rand::rngs::OsRng;
/// use ed25519_dalek::{SecretKey, ExpandedSecretKey};
///
/// let mut csprng = OsRng{};
/// let secret_key: SecretKey = SecretKey::generate(&mut csprng);
/// let expanded_secret_key: ExpandedSecretKey = ExpandedSecretKey::from(&secret_key);
/// # }
/// ```
fn from(secret_key: &'a SecretKey) -> ExpandedSecretKey {
let mut h: Sha512 = Sha512::default();
let mut hash: [u8; 64] = [0u8; 64];
let mut lower: [u8; 32] = [0u8; 32];
let mut upper: [u8; 32] = [0u8; 32];
h.update(secret_key.as_bytes());
hash.copy_from_slice(h.finalize().as_slice());
lower.copy_from_slice(&hash[00..32]);
upper.copy_from_slice(&hash[32..64]);
lower[0] &= 248;
lower[31] &= 63;
lower[31] |= 64;
ExpandedSecretKey{ key: Scalar::from_bits(lower), nonce: upper, }
}
}
impl ExpandedSecretKey {
/// Convert this `ExpandedSecretKey` into an array of 64 bytes.
///
/// # Returns
///
/// An array of 64 bytes. The first 32 bytes represent the "expanded"
/// secret key, and the last 32 bytes represent the "domain-separation"
/// "nonce".
///
/// # Examples
///
/// ```
/// # extern crate rand;
/// # extern crate sha2;
/// # extern crate ed25519_dalek;
/// #
/// # #[cfg(feature = "std")]
/// # fn main() {
/// #
/// use rand::rngs::OsRng;
/// use ed25519_dalek::{SecretKey, ExpandedSecretKey};
///
/// let mut csprng = OsRng{};
/// let secret_key: SecretKey = SecretKey::generate(&mut csprng);
/// let expanded_secret_key: ExpandedSecretKey = ExpandedSecretKey::from(&secret_key);
/// let expanded_secret_key_bytes: [u8; 64] = expanded_secret_key.to_bytes();
///
/// assert!(&expanded_secret_key_bytes[..] != &[0u8; 64][..]);
/// # }
/// #
/// # #[cfg(not(feature = "std"))]
/// # fn main() { }
/// ```
#[inline]
pub fn to_bytes(&self) -> [u8; EXPANDED_SECRET_KEY_LENGTH] {
let mut bytes: [u8; 64] = [0u8; 64];
bytes[..32].copy_from_slice(self.key.as_bytes());
bytes[32..].copy_from_slice(&self.nonce[..]);
bytes
}
/// Construct an `ExpandedSecretKey` from a slice of bytes.
///
/// # Returns
///
/// A `Result` whose okay value is an EdDSA `ExpandedSecretKey` or whose
/// error value is an `SignatureError` describing the error that occurred.
///
/// # Examples
///
/// ```
/// # extern crate rand;
/// # extern crate sha2;
/// # extern crate ed25519_dalek;
/// #
/// # use ed25519_dalek::{ExpandedSecretKey, SignatureError};
/// #
/// # #[cfg(feature = "std")]
/// # fn do_test() -> Result<ExpandedSecretKey, SignatureError> {
/// #
/// use rand::rngs::OsRng;
/// use ed25519_dalek::{SecretKey, ExpandedSecretKey};
/// use ed25519_dalek::SignatureError;
///
/// let mut csprng = OsRng{};
/// let secret_key: SecretKey = SecretKey::generate(&mut csprng);
/// let expanded_secret_key: ExpandedSecretKey = ExpandedSecretKey::from(&secret_key);
/// let bytes: [u8; 64] = expanded_secret_key.to_bytes();
/// let expanded_secret_key_again = ExpandedSecretKey::from_bytes(&bytes)?;
/// #
/// # Ok(expanded_secret_key_again)
/// # }
/// #
/// # #[cfg(feature = "std")]
/// # fn main() {
/// # let result = do_test();
/// # assert!(result.is_ok());
/// # }
/// #
/// # #[cfg(not(feature = "std"))]
/// # fn main() { }
/// ```
#[inline]
pub fn from_bytes(bytes: &[u8]) -> Result<ExpandedSecretKey, SignatureError> {
if bytes.len() != EXPANDED_SECRET_KEY_LENGTH {
return Err(InternalError::BytesLengthError {
name: "ExpandedSecretKey",
length: EXPANDED_SECRET_KEY_LENGTH,
}.into());
}
let mut lower: [u8; 32] = [0u8; 32];
let mut upper: [u8; 32] = [0u8; 32];
lower.copy_from_slice(&bytes[00..32]);
upper.copy_from_slice(&bytes[32..64]);
Ok(ExpandedSecretKey {
key: Scalar::from_bits(lower),
nonce: upper,
})
}
/// Sign a message with this `ExpandedSecretKey`.
#[allow(non_snake_case)]
pub fn sign(&self, message: &[u8], public_key: &PublicKey) -> ed25519::Signature {
let mut h: Sha512 = Sha512::new();
let R: CompressedEdwardsY;
let r: Scalar;
let s: Scalar;
let k: Scalar;
h.update(&self.nonce);
h.update(&message);
r = Scalar::from_hash(h);
R = (&r * &constants::ED25519_BASEPOINT_TABLE).compress();
h = Sha512::new();
h.update(R.as_bytes());
h.update(public_key.as_bytes());
h.update(&message);
k = Scalar::from_hash(h);
s = &(&k * &self.key) + &r;
InternalSignature { R, s }.into()
}
/// Sign a `prehashed_message` with this `ExpandedSecretKey` using the
/// Ed25519ph algorithm defined in [RFC8032 §5.1][rfc8032].
///
/// # Inputs
///
/// * `prehashed_message` is an instantiated hash digest with 512-bits of
/// output which has had the message to be signed previously fed into its
/// state.
/// * `public_key` is a [`PublicKey`] which corresponds to this secret key.
/// * `context` is an optional context string, up to 255 bytes inclusive,
/// which may be used to provide additional domain separation. If not
/// set, this will default to an empty string.
///
/// # Returns
///
/// A `Result` whose `Ok` value is an Ed25519ph [`Signature`] on the
/// `prehashed_message` if the context was 255 bytes or less, otherwise
/// a `SignatureError`.
///
/// [rfc8032]: https://tools.ietf.org/html/rfc8032#section-5.1
#[allow(non_snake_case)]
pub fn sign_prehashed<'a, D>(
&self,
prehashed_message: D,
public_key: &PublicKey,
context: Option<&'a [u8]>,
) -> Result<ed25519::Signature, SignatureError>
where
D: Digest<OutputSize = U64>,
{
let mut h: Sha512;
let mut prehash: [u8; 64] = [0u8; 64];
let R: CompressedEdwardsY;
let r: Scalar;
let s: Scalar;
let k: Scalar;
let ctx: &[u8] = context.unwrap_or(b""); // By default, the context is an empty string.
if ctx.len() > 255 {
return Err(SignatureError::from(InternalError::PrehashedContextLengthError));
}
let ctx_len: u8 = ctx.len() as u8;
// Get the result of the pre-hashed message.
prehash.copy_from_slice(prehashed_message.finalize().as_slice());
// This is the dumbest, ten-years-late, non-admission of fucking up the
// domain separation I have ever seen. Why am I still required to put
// the upper half "prefix" of the hashed "secret key" in here? Why
// can't the user just supply their own nonce and decide for themselves
// whether or not they want a deterministic signature scheme? Why does
// the message go into what's ostensibly the signature domain separation
// hash? Why wasn't there always a way to provide a context string?
//
// ...
//
// This is a really fucking stupid bandaid, and the damned scheme is
// still bleeding from malleability, for fuck's sake.
h = Sha512::new()
.chain(b"SigEd25519 no Ed25519 collisions")
.chain(&[1]) // Ed25519ph
.chain(&[ctx_len])
.chain(ctx)
.chain(&self.nonce)
.chain(&prehash[..]);
r = Scalar::from_hash(h);
R = (&r * &constants::ED25519_BASEPOINT_TABLE).compress();
h = Sha512::new()
.chain(b"SigEd25519 no Ed25519 collisions")
.chain(&[1]) // Ed25519ph
.chain(&[ctx_len])
.chain(ctx)
.chain(R.as_bytes())
.chain(public_key.as_bytes())
.chain(&prehash[..]);
k = Scalar::from_hash(h);
s = &(&k * &self.key) + &r;
Ok(InternalSignature { R, s }.into())
}
}
#[cfg(feature = "serde")]
impl Serialize for ExpandedSecretKey {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
serializer.serialize_bytes(&self.to_bytes()[..])
}
}
#[cfg(feature = "serde")]
impl<'d> Deserialize<'d> for ExpandedSecretKey {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: Deserializer<'d>,
{
struct ExpandedSecretKeyVisitor;
impl<'d> Visitor<'d> for ExpandedSecretKeyVisitor {
type Value = ExpandedSecretKey;
fn expecting(&self, formatter: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
formatter.write_str(
"An ed25519 expanded secret key as 64 bytes, as specified in RFC8032.",
)
}
fn visit_bytes<E>(self, bytes: &[u8]) -> Result<ExpandedSecretKey, E>
where
E: SerdeError,
{
ExpandedSecretKey::from_bytes(bytes)
.or(Err(SerdeError::invalid_length(bytes.len(), &self)))
}
}
deserializer.deserialize_bytes(ExpandedSecretKeyVisitor)
}
}
#[cfg(test)]
mod test {
use super::*;
#[test]
fn secret_key_zeroize_on_drop() {
let secret_ptr: *const u8;
{ // scope for the secret to ensure it's been dropped
let secret = SecretKey::from_bytes(&[0x15u8; 32][..]).unwrap();
secret_ptr = secret.0.as_ptr();
}
let memory: &[u8] = unsafe { ::std::slice::from_raw_parts(secret_ptr, 32) };
assert!(!memory.contains(&0x15));
}
}
|
generate
|
remediationAtSubscription.go
|
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package policyinsights
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// The remediation definition.
// API Version: 2019-07-01.
type RemediationAtSubscription struct {
pulumi.CustomResourceState
// The time at which the remediation was created.
CreatedOn pulumi.StringOutput `pulumi:"createdOn"`
// The deployment status summary for all deployments created by the remediation.
DeploymentStatus RemediationDeploymentSummaryResponseOutput `pulumi:"deploymentStatus"`
// The filters that will be applied to determine which resources to remediate.
Filters RemediationFiltersResponsePtrOutput `pulumi:"filters"`
// The time at which the remediation was last updated.
LastUpdatedOn pulumi.StringOutput `pulumi:"lastUpdatedOn"`
// The name of the remediation.
Name pulumi.StringOutput `pulumi:"name"`
// The resource ID of the policy assignment that should be remediated.
PolicyAssignmentId pulumi.StringPtrOutput `pulumi:"policyAssignmentId"`
// The policy definition reference ID of the individual definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition.
PolicyDefinitionReferenceId pulumi.StringPtrOutput `pulumi:"policyDefinitionReferenceId"`
// The status of the remediation.
ProvisioningState pulumi.StringOutput `pulumi:"provisioningState"`
// The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified.
ResourceDiscoveryMode pulumi.StringPtrOutput `pulumi:"resourceDiscoveryMode"`
// The type of the remediation.
Type pulumi.StringOutput `pulumi:"type"`
}
// NewRemediationAtSubscription registers a new resource with the given unique name, arguments, and options.
func NewRemediationAtSubscription(ctx *pulumi.Context,
name string, args *RemediationAtSubscriptionArgs, opts ...pulumi.ResourceOption) (*RemediationAtSubscription, error) {
if args == nil {
args = &RemediationAtSubscriptionArgs{}
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-nextgen:policyinsights/latest:RemediationAtSubscription"),
},
{
Type: pulumi.String("azure-nextgen:policyinsights/v20180701preview:RemediationAtSubscription"),
},
{
Type: pulumi.String("azure-nextgen:policyinsights/v20190701:RemediationAtSubscription"),
},
})
opts = append(opts, aliases)
var resource RemediationAtSubscription
err := ctx.RegisterResource("azure-nextgen:policyinsights:RemediationAtSubscription", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetRemediationAtSubscription gets an existing RemediationAtSubscription resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetRemediationAtSubscription(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *RemediationAtSubscriptionState, opts ...pulumi.ResourceOption) (*RemediationAtSubscription, error) {
var resource RemediationAtSubscription
err := ctx.ReadResource("azure-nextgen:policyinsights:RemediationAtSubscription", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering RemediationAtSubscription resources.
type remediationAtSubscriptionState struct {
// The time at which the remediation was created.
CreatedOn *string `pulumi:"createdOn"`
// The deployment status summary for all deployments created by the remediation.
DeploymentStatus *RemediationDeploymentSummaryResponse `pulumi:"deploymentStatus"`
// The filters that will be applied to determine which resources to remediate.
Filters *RemediationFiltersResponse `pulumi:"filters"`
// The time at which the remediation was last updated.
LastUpdatedOn *string `pulumi:"lastUpdatedOn"`
// The name of the remediation.
Name *string `pulumi:"name"`
// The resource ID of the policy assignment that should be remediated.
PolicyAssignmentId *string `pulumi:"policyAssignmentId"`
// The policy definition reference ID of the individual definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition.
PolicyDefinitionReferenceId *string `pulumi:"policyDefinitionReferenceId"`
// The status of the remediation.
ProvisioningState *string `pulumi:"provisioningState"`
// The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified.
ResourceDiscoveryMode *string `pulumi:"resourceDiscoveryMode"`
// The type of the remediation.
Type *string `pulumi:"type"`
}
type RemediationAtSubscriptionState struct {
// The time at which the remediation was created.
CreatedOn pulumi.StringPtrInput
// The deployment status summary for all deployments created by the remediation.
DeploymentStatus RemediationDeploymentSummaryResponsePtrInput
// The filters that will be applied to determine which resources to remediate.
Filters RemediationFiltersResponsePtrInput
// The time at which the remediation was last updated.
LastUpdatedOn pulumi.StringPtrInput
// The name of the remediation.
Name pulumi.StringPtrInput
// The resource ID of the policy assignment that should be remediated.
PolicyAssignmentId pulumi.StringPtrInput
// The policy definition reference ID of the individual definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition.
PolicyDefinitionReferenceId pulumi.StringPtrInput
// The status of the remediation.
ProvisioningState pulumi.StringPtrInput
// The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified.
ResourceDiscoveryMode pulumi.StringPtrInput
// The type of the remediation.
Type pulumi.StringPtrInput
}
func (RemediationAtSubscriptionState) ElementType() reflect.Type {
return reflect.TypeOf((*remediationAtSubscriptionState)(nil)).Elem()
}
type remediationAtSubscriptionArgs struct {
// The filters that will be applied to determine which resources to remediate.
Filters *RemediationFilters `pulumi:"filters"`
// The resource ID of the policy assignment that should be remediated.
PolicyAssignmentId *string `pulumi:"policyAssignmentId"`
// The policy definition reference ID of the individual definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition.
PolicyDefinitionReferenceId *string `pulumi:"policyDefinitionReferenceId"`
// The name of the remediation.
RemediationName *string `pulumi:"remediationName"`
// The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified.
ResourceDiscoveryMode *string `pulumi:"resourceDiscoveryMode"`
}
// The set of arguments for constructing a RemediationAtSubscription resource.
type RemediationAtSubscriptionArgs struct {
// The filters that will be applied to determine which resources to remediate.
Filters RemediationFiltersPtrInput
|
// The name of the remediation.
RemediationName pulumi.StringPtrInput
// The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified.
ResourceDiscoveryMode pulumi.StringPtrInput
}
func (RemediationAtSubscriptionArgs) ElementType() reflect.Type {
return reflect.TypeOf((*remediationAtSubscriptionArgs)(nil)).Elem()
}
type RemediationAtSubscriptionInput interface {
pulumi.Input
ToRemediationAtSubscriptionOutput() RemediationAtSubscriptionOutput
ToRemediationAtSubscriptionOutputWithContext(ctx context.Context) RemediationAtSubscriptionOutput
}
func (*RemediationAtSubscription) ElementType() reflect.Type {
return reflect.TypeOf((*RemediationAtSubscription)(nil))
}
func (i *RemediationAtSubscription) ToRemediationAtSubscriptionOutput() RemediationAtSubscriptionOutput {
return i.ToRemediationAtSubscriptionOutputWithContext(context.Background())
}
func (i *RemediationAtSubscription) ToRemediationAtSubscriptionOutputWithContext(ctx context.Context) RemediationAtSubscriptionOutput {
return pulumi.ToOutputWithContext(ctx, i).(RemediationAtSubscriptionOutput)
}
type RemediationAtSubscriptionOutput struct {
*pulumi.OutputState
}
func (RemediationAtSubscriptionOutput) ElementType() reflect.Type {
return reflect.TypeOf((*RemediationAtSubscription)(nil))
}
func (o RemediationAtSubscriptionOutput) ToRemediationAtSubscriptionOutput() RemediationAtSubscriptionOutput {
return o
}
func (o RemediationAtSubscriptionOutput) ToRemediationAtSubscriptionOutputWithContext(ctx context.Context) RemediationAtSubscriptionOutput {
return o
}
func init() {
pulumi.RegisterOutputType(RemediationAtSubscriptionOutput{})
}
|
// The resource ID of the policy assignment that should be remediated.
PolicyAssignmentId pulumi.StringPtrInput
// The policy definition reference ID of the individual definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition.
PolicyDefinitionReferenceId pulumi.StringPtrInput
|
watch.go
|
package k8s
import (
"context"
"fmt"
"net/http"
"time"
"github.com/pkg/errors"
v1 "k8s.io/api/core/v1"
apiErrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/informers"
"k8s.io/client-go/tools/cache"
"github.com/windmilleng/tilt/pkg/logger"
)
var PodGVR = v1.SchemeGroupVersion.WithResource("pods")
var ServiceGVR = v1.SchemeGroupVersion.WithResource("services")
var EventGVR = v1.SchemeGroupVersion.WithResource("events")
// A wrapper object around SharedInformer objects, to make them
// a bit easier to use correctly.
type ObjectUpdate struct {
obj interface{}
isDelete bool
}
// Returns a Pod if this is a pod Add or a pod Update.
func (r ObjectUpdate) AsPod() (*v1.Pod, bool) {
if r.isDelete {
return nil, false
}
pod, ok := r.obj.(*v1.Pod)
return pod, ok
}
// Returns (namespace, name, isDelete).
//
// The informer's OnDelete handler sometimes gives us a structured object, and
// sometimes returns a DeletedFinalStateUnknown object. To make this easier to
// handle correctly, we never allow access to the OnDelete object. Instead, we
// force the caller to use AsDeletedKey() to get the identifier of the object.
//
// For more info, see:
// https://godoc.org/k8s.io/client-go/tools/cache#ResourceEventHandler
func (r ObjectUpdate) AsDeletedKey() (Namespace, string, bool) {
if !r.isDelete {
return "", "", false
}
key, err := cache.DeletionHandlingMetaNamespaceKeyFunc(r.obj)
if err != nil {
return "", "", false
}
ns, name, err := cache.SplitMetaNamespaceKey(key)
if err != nil {
return "", "", false
}
return Namespace(ns), name, true
}
type watcherFactory func(namespace string) watcher
type watcher interface {
Watch(ctx context.Context, options metav1.ListOptions) (watch.Interface, error)
}
func (kCli K8sClient) makeWatcher(ctx context.Context, f watcherFactory, ls labels.Selector) (watch.Interface, Namespace, error) {
// passing "" gets us all namespaces
w := f("")
if w == nil {
return nil, "", nil
}
watcher, err := w.Watch(ctx, metav1.ListOptions{LabelSelector: ls.String()})
if err == nil {
return watcher, "", nil
}
// If the request failed, we might be able to recover.
statusErr, isStatusErr := err.(*apiErrors.StatusError)
if !isStatusErr {
return nil, "", err
}
status := statusErr.ErrStatus
if status.Code == http.StatusForbidden {
// If this is a forbidden error, maybe the user just isn't allowed to watch this namespace.
// Let's narrow our request to just the config namespace, and see if that helps.
w := f(kCli.configNamespace.String())
if w == nil {
return nil, "", nil
}
watcher, err := w.Watch(ctx, metav1.ListOptions{LabelSelector: ls.String()})
if err == nil {
return watcher, kCli.configNamespace, nil
}
// ugh, it still failed. return the original error.
}
return nil, "", fmt.Errorf("%s, Reason: %s, Code: %d", status.Message, status.Reason, status.Code)
}
func (kCli K8sClient) makeInformer(
ctx context.Context,
gvr schema.GroupVersionResource,
ls labels.Selector) (cache.SharedInformer, error) {
// HACK(dmiller): There's no way to get errors out of an informer. See https://github.com/kubernetes/client-go/issues/155
// In the meantime, at least to get authorization and some other errors let's try to set up a watcher and then just
// throw it away.
watcher, ns, err := kCli.makeWatcher(ctx, func(ns string) watcher {
return kCli.dynamic.Resource(gvr).Namespace(ns)
}, ls)
if err != nil {
return nil, errors.Wrap(err, "makeInformer")
}
watcher.Stop()
options := []informers.SharedInformerOption{}
if !ls.Empty() {
options = append(options, informers.WithTweakListOptions(func(o *metav1.ListOptions) {
o.LabelSelector = ls.String()
}))
}
if ns != "" {
options = append(options, informers.WithNamespace(ns.String()))
}
factory := informers.NewSharedInformerFactoryWithOptions(kCli.clientset, 5*time.Second, options...)
resFactory, err := factory.ForResource(gvr)
if err != nil {
return nil, errors.Wrap(err, "makeInformer")
}
return resFactory.Informer(), nil
}
func (kCli K8sClient) WatchEvents(ctx context.Context) (<-chan *v1.Event, error) {
gvr := EventGVR
informer, err := kCli.makeInformer(ctx, gvr, labels.Everything())
if err != nil {
return nil, errors.Wrap(err, "WatchEvents")
}
ch := make(chan *v1.Event)
informer.AddEventHandler(cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
mObj, ok := obj.(*v1.Event)
if ok {
ch <- mObj
}
},
UpdateFunc: func(oldObj interface{}, newObj interface{}) {
mObj, ok := newObj.(*v1.Event)
if ok {
oldObj, ok := oldObj.(*v1.Event)
// the informer regularly gives us updates for events where cmp.Equal(oldObj, newObj) returns true.
// we have not investigated why it does this, but these updates seem to always be spurious and
// uninteresting.
// we could check cmp.Equal here, but really, `Count` is probably the only reason we even care about
// updates at all.
if !ok || oldObj.Count < mObj.Count {
ch <- mObj
}
}
},
})
go runInformer(ctx, "events", informer)
return ch, nil
}
func (kCli K8sClient) WatchPods(ctx context.Context, ls labels.Selector) (<-chan ObjectUpdate, error) {
gvr := PodGVR
informer, err := kCli.makeInformer(ctx, gvr, ls)
if err != nil {
return nil, errors.Wrap(err, "WatchPods")
}
ch := make(chan ObjectUpdate)
informer.AddEventHandler(cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
mObj, ok := obj.(*v1.Pod)
if ok {
FixContainerStatusImages(mObj)
}
ch <- ObjectUpdate{obj: obj}
},
DeleteFunc: func(obj interface{}) {
mObj, ok := obj.(*v1.Pod)
if ok {
FixContainerStatusImages(mObj)
}
ch <- ObjectUpdate{obj: obj, isDelete: true}
},
UpdateFunc: func(oldObj interface{}, newObj interface{}) {
oldPod, ok := oldObj.(*v1.Pod)
if !ok {
return
}
newPod, ok := newObj.(*v1.Pod)
if !ok || oldPod == newPod {
return
}
FixContainerStatusImages(newPod)
ch <- ObjectUpdate{obj: newPod}
},
})
go runInformer(ctx, "pods", informer)
return ch, nil
}
func (kCli K8sClient) WatchServices(ctx context.Context, ls labels.Selector) (<-chan *v1.Service, error) {
gvr := ServiceGVR
informer, err := kCli.makeInformer(ctx, gvr, ls)
if err != nil {
return nil, errors.Wrap(err, "WatchServices")
}
ch := make(chan *v1.Service)
informer.AddEventHandler(cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
mObj, ok := obj.(*v1.Service)
if ok {
ch <- mObj
}
},
UpdateFunc: func(oldObj interface{}, newObj interface{}) {
newService, ok := newObj.(*v1.Service)
if ok {
ch <- newService
}
},
})
go runInformer(ctx, "services", informer)
return ch, nil
}
func runInformer(ctx context.Context, name string, informer cache.SharedInformer)
|
{
originalDuration := 3 * time.Second
originalBackoff := wait.Backoff{
Steps: 1000,
Duration: originalDuration,
Factor: 3.0,
Jitter: 0.5,
Cap: time.Hour,
}
backoff := originalBackoff
_ = informer.SetDropWatchHandler(func(err error, doneCh <-chan struct{}) {
sleepTime := originalDuration
if err != nil {
sleepTime = backoff.Step()
logger.Get(ctx).Warnf("Pausing k8s %s watcher for %s: %v",
name,
sleepTime.Truncate(time.Second),
err)
} else {
backoff = originalBackoff
}
select {
case <-doneCh:
case <-time.After(sleepTime):
}
})
informer.Run(ctx.Done())
}
|
|
test-cluster.py
|
import string
import random
import time
import pytest
import os
import subprocess
from os import path
# Provide a list of VMs you want to reuse. VMs should have already microk8s installed.
# the test will attempt a refresh to the channel requested for testing
# reuse_vms = ['vm-ldzcjb', 'vm-nfpgea', 'vm-pkgbtw']
reuse_vms = None
channel_to_test = os.environ.get("CHANNEL_TO_TEST", "edge/ha-preview")
backend = os.environ.get("BACKEND", None)
class VM:
"""
This class abstracts the backend we are using. It could be either multipass or lxc.
"""
def __init__(self, attach_vm=None):
"""Detect the available backends and instantiate a VM.
If `attach_vm` is provided we just make sure the right MicroK8s is deployed.
:param attach_vm: the name of the VM we want to reuse
"""
rnd_letters = "".join(random.choice(string.ascii_lowercase) for i in range(6))
self.backend = "none"
self.vm_name = "vm-{}".format(rnd_letters)
if attach_vm:
self.vm_name = attach_vm
if path.exists("/snap/bin/multipass") or backend == "multipass":
print("Creating mulitpass VM")
self.backend = "multipass"
if not attach_vm:
subprocess.check_call(
"/snap/bin/multipass launch 18.04 -n {} -m 2G".format(self.vm_name).split()
)
subprocess.check_call(
"/snap/bin/multipass exec {} -- sudo "
"snap install microk8s --classic --channel {}".format(
self.vm_name, channel_to_test
).split()
)
else:
subprocess.check_call(
"/snap/bin/multipass exec {} -- sudo "
"snap refresh microk8s --channel {}".format(
self.vm_name, channel_to_test
).split()
)
elif path.exists("/snap/bin/lxc") or backend == "lxc":
self.backend = "lxc"
if not attach_vm:
profiles = subprocess.check_output("/snap/bin/lxc profile list".split())
if "microk8s" not in profiles.decode():
subprocess.check_call("/snap/bin/lxc profile copy default microk8s".split())
with open("lxc/microk8s-zfs.profile", "r+") as fp:
profile_string = fp.read()
process = subprocess.Popen(
"/snap/bin/lxc profile edit microk8s".split(),
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
)
process.stdin.write(profile_string.encode())
process.stdin.close()
subprocess.check_call(
"/snap/bin/lxc launch -p default -p microk8s ubuntu:18.04 {}".format(
self.vm_name
).split()
)
cmd_prefix = "/snap/bin/lxc exec {} -- script -e -c".format(self.vm_name).split()
cmd = ["snap install microk8s --classic --channel {}".format(channel_to_test)]
time.sleep(20)
subprocess.check_output(cmd_prefix + cmd)
else:
cmd = "/snap/bin/lxc exec {} -- ".format(self.vm_name).split()
cmd.append("sudo snap refresh microk8s --channel {}".format(channel_to_test))
subprocess.check_call(cmd)
else:
raise Exception("Need to install multipass of lxc")
def run(self, cmd):
"""
Run a command
:param cmd: the command we are running.
:return: the output of the command
"""
if self.backend == "multipass":
output = subprocess.check_output(
"/snap/bin/multipass exec {} -- sudo " "{}".format(self.vm_name, cmd).split()
)
return output
elif self.backend == "lxc":
cmd_prefix = "/snap/bin/lxc exec {} -- script -e -c ".format(self.vm_name).split()
output = subprocess.check_output(cmd_prefix + [cmd])
return output
else:
raise Exception("Not implemented for backend {}".format(self.backend))
def release(self):
"""
Release a VM.
"""
print("Destroying VM in {}".format(self.backend))
if self.backend == "multipass":
subprocess.check_call("/snap/bin/multipass stop {}".format(self.vm_name).split())
subprocess.check_call("/snap/bin/multipass delete {}".format(self.vm_name).split())
elif self.backend == "lxc":
subprocess.check_call("/snap/bin/lxc stop {}".format(self.vm_name).split())
subprocess.check_call("/snap/bin/lxc delete {}".format(self.vm_name).split())
class TestCluster(object):
@pytest.fixture(autouse=True, scope="module")
def setup_cluster(self):
|
def test_calico_in_nodes(self):
"""
Test each node has a calico pod.
"""
print("Checking calico is in all nodes")
pods = self.VM[0].run("/snap/bin/microk8s.kubectl get po -n kube-system -o wide")
for vm in self.VM:
if vm.vm_name not in pods.decode():
assert False
print("Calico found in node {}".format(vm.vm_name))
def test_nodes_in_ha(self):
"""
Test all nodes are seeing the database while removing nodes
"""
# All nodes see the same pods
for vm in self.VM:
pods = vm.run("/snap/bin/microk8s.kubectl get po -n kube-system -o wide")
for other_vm in self.VM:
if other_vm.vm_name not in pods.decode():
assert False
print("All nodes see the same pods")
attempt = 100
while True:
assert attempt > 0
for vm in self.VM:
status = vm.run("/snap/bin/microk8s.status")
if "high-availability: yes" not in status.decode():
attempt += 1
continue
break
# remove a node
print("Removing machine {}".format(self.VM[0].vm_name))
self.VM[0].run("/snap/bin/microk8s.leave")
self.VM[1].run("/snap/bin/microk8s.remove-node {}".format(self.VM[0].vm_name))
# allow for some time for the leader to hand over leadership
time.sleep(10)
attempt = 100
while True:
ready_pods = 0
pods = self.VM[1].run("/snap/bin/microk8s.kubectl get po -n kube-system -o wide")
for line in pods.decode().splitlines():
if "calico" in line and "Running" in line:
ready_pods += 1
if ready_pods == (len(self.VM)):
print(pods.decode())
break
attempt -= 1
if attempt <= 0:
assert False
time.sleep(5)
print("Checking calico is on the nodes running")
leftVMs = [self.VM[1], self.VM[2]]
attempt = 100
while True:
assert attempt > 0
for vm in leftVMs:
status = vm.run("/snap/bin/microk8s.status")
if "high-availability: no" not in status.decode():
attempt += 1
time.sleep(2)
continue
break
for vm in leftVMs:
pods = vm.run("/snap/bin/microk8s.kubectl get po -n kube-system -o wide")
for other_vm in leftVMs:
if other_vm.vm_name not in pods.decode():
time.sleep(2)
assert False
print("Remaining nodes see the same pods")
print("Waiting for two ingress to appear")
self.VM[1].run("/snap/bin/microk8s.enable ingress")
# wait for two ingress to appear
time.sleep(10)
attempt = 100
while True:
ready_pods = 0
pods = self.VM[1].run("/snap/bin/microk8s.kubectl get po -A -o wide")
for line in pods.decode().splitlines():
if "ingress" in line and "Running" in line:
ready_pods += 1
if ready_pods == (len(self.VM) - 1):
print(pods.decode())
break
attempt -= 1
if attempt <= 0:
assert False
time.sleep(5)
print("Rejoin the node")
add_node = self.VM[1].run("/snap/bin/microk8s.add-node")
endpoint = [ep for ep in add_node.decode().split() if ":25000/" in ep]
self.VM[0].run("/snap/bin/microk8s.join {}".format(endpoint[0]))
print("Waiting for nodes to be ready")
connected_nodes = self.VM[0].run("/snap/bin/microk8s.kubectl get no")
while "NotReady" in connected_nodes.decode():
time.sleep(5)
connected_nodes = self.VM[0].run("/snap/bin/microk8s.kubectl get no")
attempt = 100
while True:
assert attempt > 0
for vm in self.VM:
status = vm.run("/snap/bin/microk8s.status")
if "high-availability: yes" not in status.decode():
attempt += 1
time.sleep(2)
continue
break
|
"""
Provision VMs and for a cluster.
:return:
"""
try:
print("Setting up cluster")
type(self).VM = []
if not reuse_vms:
size = 3
for i in range(0, size):
print("Creating machine {}".format(i))
vm = VM()
print("Waiting for machine {}".format(i))
vm.run("/snap/bin/microk8s.status --wait-ready --timeout 120")
self.VM.append(vm)
else:
for vm_name in reuse_vms:
self.VM.append(VM(vm_name))
# Form cluster
vm_master = self.VM[0]
connected_nodes = vm_master.run("/snap/bin/microk8s.kubectl get no")
for vm in self.VM:
if vm.vm_name in connected_nodes.decode():
continue
else:
print("Adding machine {} to cluster".format(vm.vm_name))
add_node = vm_master.run("/snap/bin/microk8s.add-node")
endpoint = [ep for ep in add_node.decode().split() if ":25000/" in ep]
vm.run("/snap/bin/microk8s.join {}".format(endpoint[0]))
# Wait for nodes to be ready
print("Waiting for nodes to register")
connected_nodes = vm_master.run("/snap/bin/microk8s.kubectl get no")
while "NotReady" in connected_nodes.decode():
time.sleep(5)
connected_nodes = vm_master.run("/snap/bin/microk8s.kubectl get no")
print(connected_nodes.decode())
# Wait for CNI pods
print("Waiting for cni")
while True:
ready_pods = 0
pods = vm_master.run("/snap/bin/microk8s.kubectl get po -n kube-system -o wide")
for line in pods.decode().splitlines():
if "calico" in line and "Running" in line:
ready_pods += 1
if ready_pods == (len(self.VM) + 1):
print(pods.decode())
break
time.sleep(5)
yield
finally:
print("Cleanup up cluster")
if not reuse_vms:
for vm in self.VM:
print("Releasing machine {} in {}".format(vm.vm_name, vm.backend))
vm.release()
|
.eslintrc.js
|
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from @typescript-eslint/eslint-plugin
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
|
},
},
rules: {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
'@typescript-eslint/no-use-before-define': 'off',
},
settings: {
react: {
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
},
},
};
|
ecmaFeatures: {
jsx: true, // Allows for the parsing of JSX
|
mod.rs
|
#![warn(missing_docs)]
//! Utilities module provides set of commonly used algorithms.
pub mod astar;
pub mod lightmap;
pub mod log;
pub mod navmesh;
pub mod raw_mesh;
pub mod uvgen;
use crate::core::algebra::Vector2;
use crate::{
event::{ElementState, ModifiersState, MouseScrollDelta, VirtualKeyCode, WindowEvent},
gui::{
draw,
message::{ButtonState, KeyCode, KeyboardModifiers, OsEvent},
},
resource::texture::Texture,
};
use std::hash::Hasher;
use std::{any::Any, sync::Arc};
/// Translated key code to rg3d-ui key code.
pub fn translate_key(key: VirtualKeyCode) -> KeyCode {
match key {
VirtualKeyCode::Key1 => KeyCode::Key1,
VirtualKeyCode::Key2 => KeyCode::Key2,
VirtualKeyCode::Key3 => KeyCode::Key3,
VirtualKeyCode::Key4 => KeyCode::Key4,
VirtualKeyCode::Key5 => KeyCode::Key5,
VirtualKeyCode::Key6 => KeyCode::Key6,
VirtualKeyCode::Key7 => KeyCode::Key7,
VirtualKeyCode::Key8 => KeyCode::Key8,
VirtualKeyCode::Key9 => KeyCode::Key9,
VirtualKeyCode::Key0 => KeyCode::Key0,
VirtualKeyCode::A => KeyCode::A,
VirtualKeyCode::B => KeyCode::B,
VirtualKeyCode::C => KeyCode::C,
VirtualKeyCode::D => KeyCode::D,
VirtualKeyCode::E => KeyCode::E,
VirtualKeyCode::F => KeyCode::F,
VirtualKeyCode::G => KeyCode::G,
VirtualKeyCode::H => KeyCode::H,
VirtualKeyCode::I => KeyCode::I,
VirtualKeyCode::J => KeyCode::J,
VirtualKeyCode::K => KeyCode::K,
VirtualKeyCode::L => KeyCode::L,
VirtualKeyCode::M => KeyCode::M,
VirtualKeyCode::N => KeyCode::N,
VirtualKeyCode::O => KeyCode::O,
VirtualKeyCode::P => KeyCode::P,
VirtualKeyCode::Q => KeyCode::Q,
VirtualKeyCode::R => KeyCode::R,
VirtualKeyCode::S => KeyCode::S,
VirtualKeyCode::T => KeyCode::T,
VirtualKeyCode::U => KeyCode::U,
VirtualKeyCode::V => KeyCode::V,
VirtualKeyCode::W => KeyCode::W,
VirtualKeyCode::X => KeyCode::X,
VirtualKeyCode::Y => KeyCode::Y,
VirtualKeyCode::Z => KeyCode::Z,
VirtualKeyCode::Escape => KeyCode::Escape,
VirtualKeyCode::F1 => KeyCode::F1,
VirtualKeyCode::F2 => KeyCode::F2,
VirtualKeyCode::F3 => KeyCode::F3,
VirtualKeyCode::F4 => KeyCode::F4,
VirtualKeyCode::F5 => KeyCode::F5,
VirtualKeyCode::F6 => KeyCode::F6,
VirtualKeyCode::F7 => KeyCode::F7,
VirtualKeyCode::F8 => KeyCode::F8,
VirtualKeyCode::F9 => KeyCode::F9,
VirtualKeyCode::F10 => KeyCode::F10,
VirtualKeyCode::F11 => KeyCode::F11,
VirtualKeyCode::F12 => KeyCode::F12,
VirtualKeyCode::F13 => KeyCode::F13,
VirtualKeyCode::F14 => KeyCode::F14,
VirtualKeyCode::F15 => KeyCode::F15,
VirtualKeyCode::F16 => KeyCode::F16,
VirtualKeyCode::F17 => KeyCode::F17,
VirtualKeyCode::F18 => KeyCode::F18,
VirtualKeyCode::F19 => KeyCode::F19,
VirtualKeyCode::F20 => KeyCode::F20,
VirtualKeyCode::F21 => KeyCode::F21,
VirtualKeyCode::F22 => KeyCode::F22,
VirtualKeyCode::F23 => KeyCode::F23,
VirtualKeyCode::F24 => KeyCode::F24,
VirtualKeyCode::Snapshot => KeyCode::Snapshot,
VirtualKeyCode::Scroll => KeyCode::Scroll,
VirtualKeyCode::Pause => KeyCode::Pause,
VirtualKeyCode::Insert => KeyCode::Insert,
VirtualKeyCode::Home => KeyCode::Home,
VirtualKeyCode::Delete => KeyCode::Delete,
VirtualKeyCode::End => KeyCode::End,
VirtualKeyCode::PageDown => KeyCode::PageDown,
VirtualKeyCode::PageUp => KeyCode::PageUp,
VirtualKeyCode::Left => KeyCode::Left,
VirtualKeyCode::Up => KeyCode::Up,
VirtualKeyCode::Right => KeyCode::Right,
VirtualKeyCode::Down => KeyCode::Down,
VirtualKeyCode::Back => KeyCode::Backspace,
VirtualKeyCode::Return => KeyCode::Return,
VirtualKeyCode::Space => KeyCode::Space,
VirtualKeyCode::Compose => KeyCode::Compose,
VirtualKeyCode::Caret => KeyCode::Caret,
VirtualKeyCode::Numlock => KeyCode::Numlock,
VirtualKeyCode::Numpad0 => KeyCode::Numpad0,
VirtualKeyCode::Numpad1 => KeyCode::Numpad1,
VirtualKeyCode::Numpad2 => KeyCode::Numpad2,
VirtualKeyCode::Numpad3 => KeyCode::Numpad3,
VirtualKeyCode::Numpad4 => KeyCode::Numpad4,
VirtualKeyCode::Numpad5 => KeyCode::Numpad5,
VirtualKeyCode::Numpad6 => KeyCode::Numpad6,
VirtualKeyCode::Numpad7 => KeyCode::Numpad7,
VirtualKeyCode::Numpad8 => KeyCode::Numpad8,
VirtualKeyCode::Numpad9 => KeyCode::Numpad9,
VirtualKeyCode::AbntC1 => KeyCode::AbntC1,
VirtualKeyCode::AbntC2 => KeyCode::AbntC2,
VirtualKeyCode::NumpadAdd => KeyCode::NumpadAdd,
VirtualKeyCode::Apostrophe => KeyCode::Apostrophe,
VirtualKeyCode::Apps => KeyCode::Apps,
VirtualKeyCode::At => KeyCode::At,
VirtualKeyCode::Ax => KeyCode::Ax,
VirtualKeyCode::Backslash => KeyCode::Backslash,
VirtualKeyCode::Calculator => KeyCode::Calculator,
VirtualKeyCode::Capital => KeyCode::Capital,
VirtualKeyCode::Colon => KeyCode::Colon,
VirtualKeyCode::Comma => KeyCode::Comma,
VirtualKeyCode::Convert => KeyCode::Convert,
VirtualKeyCode::NumpadDecimal => KeyCode::NumpadDecimal,
VirtualKeyCode::NumpadDivide => KeyCode::NumpadDivide,
VirtualKeyCode::Equals => KeyCode::Equals,
VirtualKeyCode::Grave => KeyCode::Grave,
VirtualKeyCode::Kana => KeyCode::Kana,
VirtualKeyCode::Kanji => KeyCode::Kanji,
VirtualKeyCode::LAlt => KeyCode::LAlt,
VirtualKeyCode::LBracket => KeyCode::LBracket,
VirtualKeyCode::LControl => KeyCode::LControl,
VirtualKeyCode::LShift => KeyCode::LShift,
VirtualKeyCode::LWin => KeyCode::LWin,
VirtualKeyCode::Mail => KeyCode::Mail,
VirtualKeyCode::MediaSelect => KeyCode::MediaSelect,
VirtualKeyCode::MediaStop => KeyCode::MediaStop,
VirtualKeyCode::Minus => KeyCode::Minus,
VirtualKeyCode::NumpadMultiply => KeyCode::NumpadMultiply,
VirtualKeyCode::Mute => KeyCode::Mute,
VirtualKeyCode::MyComputer => KeyCode::MyComputer,
VirtualKeyCode::NavigateForward => KeyCode::NavigateForward,
VirtualKeyCode::NavigateBackward => KeyCode::NavigateBackward,
VirtualKeyCode::NextTrack => KeyCode::NextTrack,
VirtualKeyCode::NoConvert => KeyCode::NoConvert,
VirtualKeyCode::NumpadComma => KeyCode::NumpadComma,
VirtualKeyCode::NumpadEnter => KeyCode::NumpadEnter,
VirtualKeyCode::NumpadEquals => KeyCode::NumpadEquals,
VirtualKeyCode::OEM102 => KeyCode::OEM102,
VirtualKeyCode::Period => KeyCode::Period,
VirtualKeyCode::PlayPause => KeyCode::PlayPause,
VirtualKeyCode::Power => KeyCode::Power,
VirtualKeyCode::PrevTrack => KeyCode::PrevTrack,
VirtualKeyCode::RAlt => KeyCode::RAlt,
VirtualKeyCode::RBracket => KeyCode::RBracket,
|
VirtualKeyCode::RWin => KeyCode::RWin,
VirtualKeyCode::Semicolon => KeyCode::Semicolon,
VirtualKeyCode::Slash => KeyCode::Slash,
VirtualKeyCode::Sleep => KeyCode::Sleep,
VirtualKeyCode::Stop => KeyCode::Stop,
VirtualKeyCode::NumpadSubtract => KeyCode::NumpadSubtract,
VirtualKeyCode::Sysrq => KeyCode::Sysrq,
VirtualKeyCode::Tab => KeyCode::Tab,
VirtualKeyCode::Underline => KeyCode::Underline,
VirtualKeyCode::Unlabeled => KeyCode::Unlabeled,
VirtualKeyCode::VolumeDown => KeyCode::VolumeDown,
VirtualKeyCode::VolumeUp => KeyCode::VolumeUp,
VirtualKeyCode::Wake => KeyCode::Wake,
VirtualKeyCode::WebBack => KeyCode::WebBack,
VirtualKeyCode::WebFavorites => KeyCode::WebFavorites,
VirtualKeyCode::WebForward => KeyCode::WebForward,
VirtualKeyCode::WebHome => KeyCode::WebHome,
VirtualKeyCode::WebRefresh => KeyCode::WebRefresh,
VirtualKeyCode::WebSearch => KeyCode::WebSearch,
VirtualKeyCode::WebStop => KeyCode::WebStop,
VirtualKeyCode::Yen => KeyCode::Yen,
VirtualKeyCode::Copy => KeyCode::Copy,
VirtualKeyCode::Paste => KeyCode::Paste,
VirtualKeyCode::Cut => KeyCode::Cut,
VirtualKeyCode::Asterisk => KeyCode::Asterisk,
VirtualKeyCode::Plus => KeyCode::Plus,
}
}
/// Translates cursor icon from rg3d-ui library to glutin format.
pub fn translate_cursor_icon(icon: crate::gui::message::CursorIcon) -> crate::window::CursorIcon {
match icon {
crate::gui::message::CursorIcon::Default => crate::window::CursorIcon::Default,
crate::gui::message::CursorIcon::Crosshair => crate::window::CursorIcon::Crosshair,
crate::gui::message::CursorIcon::Hand => crate::window::CursorIcon::Hand,
crate::gui::message::CursorIcon::Arrow => crate::window::CursorIcon::Arrow,
crate::gui::message::CursorIcon::Move => crate::window::CursorIcon::Move,
crate::gui::message::CursorIcon::Text => crate::window::CursorIcon::Text,
crate::gui::message::CursorIcon::Wait => crate::window::CursorIcon::Wait,
crate::gui::message::CursorIcon::Help => crate::window::CursorIcon::Help,
crate::gui::message::CursorIcon::Progress => crate::window::CursorIcon::Progress,
crate::gui::message::CursorIcon::NotAllowed => crate::window::CursorIcon::NotAllowed,
crate::gui::message::CursorIcon::ContextMenu => crate::window::CursorIcon::ContextMenu,
crate::gui::message::CursorIcon::Cell => crate::window::CursorIcon::Cell,
crate::gui::message::CursorIcon::VerticalText => crate::window::CursorIcon::VerticalText,
crate::gui::message::CursorIcon::Alias => crate::window::CursorIcon::Alias,
crate::gui::message::CursorIcon::Copy => crate::window::CursorIcon::Copy,
crate::gui::message::CursorIcon::NoDrop => crate::window::CursorIcon::NoDrop,
crate::gui::message::CursorIcon::Grab => crate::window::CursorIcon::Grab,
crate::gui::message::CursorIcon::Grabbing => crate::window::CursorIcon::Grabbing,
crate::gui::message::CursorIcon::AllScroll => crate::window::CursorIcon::AllScroll,
crate::gui::message::CursorIcon::ZoomIn => crate::window::CursorIcon::ZoomIn,
crate::gui::message::CursorIcon::ZoomOut => crate::window::CursorIcon::ZoomOut,
crate::gui::message::CursorIcon::EResize => crate::window::CursorIcon::EResize,
crate::gui::message::CursorIcon::NResize => crate::window::CursorIcon::NResize,
crate::gui::message::CursorIcon::NeResize => crate::window::CursorIcon::NeResize,
crate::gui::message::CursorIcon::NwResize => crate::window::CursorIcon::NwResize,
crate::gui::message::CursorIcon::SResize => crate::window::CursorIcon::SResize,
crate::gui::message::CursorIcon::SeResize => crate::window::CursorIcon::SeResize,
crate::gui::message::CursorIcon::SwResize => crate::window::CursorIcon::SwResize,
crate::gui::message::CursorIcon::WResize => crate::window::CursorIcon::WResize,
crate::gui::message::CursorIcon::EwResize => crate::window::CursorIcon::EwResize,
crate::gui::message::CursorIcon::NsResize => crate::window::CursorIcon::NsResize,
crate::gui::message::CursorIcon::NeswResize => crate::window::CursorIcon::NeswResize,
crate::gui::message::CursorIcon::NwseResize => crate::window::CursorIcon::NwseResize,
crate::gui::message::CursorIcon::ColResize => crate::window::CursorIcon::ColResize,
crate::gui::message::CursorIcon::RowResize => crate::window::CursorIcon::RowResize,
}
}
/// Translates window mouse button into rg3d-ui mouse button.
pub fn translate_button(button: crate::event::MouseButton) -> crate::gui::message::MouseButton {
match button {
crate::event::MouseButton::Left => crate::gui::message::MouseButton::Left,
crate::event::MouseButton::Right => crate::gui::message::MouseButton::Right,
crate::event::MouseButton::Middle => crate::gui::message::MouseButton::Middle,
crate::event::MouseButton::Other(i) => crate::gui::message::MouseButton::Other(i),
}
}
/// Translates library button state into rg3d-ui button state.
pub fn translate_state(state: ElementState) -> ButtonState {
match state {
ElementState::Pressed => ButtonState::Pressed,
ElementState::Released => ButtonState::Released,
}
}
/// Translates window event to rg3d-ui event.
pub fn translate_event(event: &WindowEvent) -> Option<OsEvent> {
match event {
WindowEvent::ReceivedCharacter(c) => Some(OsEvent::Character(*c)),
WindowEvent::KeyboardInput { input, .. } => {
if let Some(key) = input.virtual_keycode {
Some(OsEvent::KeyboardInput {
button: translate_key(key),
state: translate_state(input.state),
})
} else {
None
}
}
WindowEvent::CursorMoved { position, .. } => Some(OsEvent::CursorMoved {
position: Vector2::new(position.x as f32, position.y as f32),
}),
WindowEvent::MouseWheel { delta, .. } => match delta {
MouseScrollDelta::LineDelta(x, y) => Some(OsEvent::MouseWheel(*x, *y)),
MouseScrollDelta::PixelDelta(pos) => {
Some(OsEvent::MouseWheel(pos.x as f32, pos.y as f32))
}
},
WindowEvent::MouseInput { state, button, .. } => Some(OsEvent::MouseInput {
button: translate_button(*button),
state: translate_state(*state),
}),
&WindowEvent::ModifiersChanged(modifiers) => Some(OsEvent::KeyboardModifiers(
translate_keyboard_modifiers(modifiers),
)),
_ => None,
}
}
/// Translates keyboard modifiers to rg3d-ui keyboard modifiers.
pub fn translate_keyboard_modifiers(modifiers: ModifiersState) -> KeyboardModifiers {
KeyboardModifiers {
alt: modifiers.alt(),
shift: modifiers.shift(),
control: modifiers.ctrl(),
system: modifiers.logo(),
}
}
/// Maps key code to its name. Can be useful if you making adjustable key bindings in your
/// game and you need quickly map key code to its name.
pub fn virtual_key_code_name(code: VirtualKeyCode) -> &'static str {
match code {
VirtualKeyCode::Key1 => "1",
VirtualKeyCode::Key2 => "2",
VirtualKeyCode::Key3 => "3",
VirtualKeyCode::Key4 => "4",
VirtualKeyCode::Key5 => "5",
VirtualKeyCode::Key6 => "6",
VirtualKeyCode::Key7 => "7",
VirtualKeyCode::Key8 => "8",
VirtualKeyCode::Key9 => "9",
VirtualKeyCode::Key0 => "0",
VirtualKeyCode::A => "A",
VirtualKeyCode::B => "B",
VirtualKeyCode::C => "C",
VirtualKeyCode::D => "D",
VirtualKeyCode::E => "E",
VirtualKeyCode::F => "F",
VirtualKeyCode::G => "G",
VirtualKeyCode::H => "H",
VirtualKeyCode::I => "I",
VirtualKeyCode::J => "J",
VirtualKeyCode::K => "K",
VirtualKeyCode::L => "L",
VirtualKeyCode::M => "M",
VirtualKeyCode::N => "N",
VirtualKeyCode::O => "O",
VirtualKeyCode::P => "P",
VirtualKeyCode::Q => "Q",
VirtualKeyCode::R => "R",
VirtualKeyCode::S => "S",
VirtualKeyCode::T => "T",
VirtualKeyCode::U => "U",
VirtualKeyCode::V => "V",
VirtualKeyCode::W => "W",
VirtualKeyCode::X => "X",
VirtualKeyCode::Y => "Y",
VirtualKeyCode::Z => "Z",
VirtualKeyCode::Escape => "Escape",
VirtualKeyCode::F1 => "F1",
VirtualKeyCode::F2 => "F2",
VirtualKeyCode::F3 => "F3",
VirtualKeyCode::F4 => "F4",
VirtualKeyCode::F5 => "F5",
VirtualKeyCode::F6 => "F6",
VirtualKeyCode::F7 => "F7",
VirtualKeyCode::F8 => "F8",
VirtualKeyCode::F9 => "F9",
VirtualKeyCode::F10 => "F10",
VirtualKeyCode::F11 => "F11",
VirtualKeyCode::F12 => "F12",
VirtualKeyCode::F13 => "F13",
VirtualKeyCode::F14 => "F14",
VirtualKeyCode::F15 => "F15",
VirtualKeyCode::F16 => "F16",
VirtualKeyCode::F17 => "F17",
VirtualKeyCode::F18 => "F18",
VirtualKeyCode::F19 => "F19",
VirtualKeyCode::F20 => "F20",
VirtualKeyCode::F21 => "F21",
VirtualKeyCode::F22 => "F22",
VirtualKeyCode::F23 => "F23",
VirtualKeyCode::F24 => "F24",
VirtualKeyCode::Snapshot => "Snapshot",
VirtualKeyCode::Scroll => "Scroll",
VirtualKeyCode::Pause => "Pause",
VirtualKeyCode::Insert => "Insert",
VirtualKeyCode::Home => "Home",
VirtualKeyCode::Delete => "Delete",
VirtualKeyCode::End => "End",
VirtualKeyCode::PageDown => "PageDown",
VirtualKeyCode::PageUp => "PageUp",
VirtualKeyCode::Left => "Left",
VirtualKeyCode::Up => "Up",
VirtualKeyCode::Right => "Right",
VirtualKeyCode::Down => "Down",
VirtualKeyCode::Back => "Back",
VirtualKeyCode::Return => "Return",
VirtualKeyCode::Space => "Space",
VirtualKeyCode::Compose => "Compose",
VirtualKeyCode::Caret => "Caret",
VirtualKeyCode::Numlock => "Numlock",
VirtualKeyCode::Numpad0 => "Numpad0",
VirtualKeyCode::Numpad1 => "Numpad1",
VirtualKeyCode::Numpad2 => "Numpad2",
VirtualKeyCode::Numpad3 => "Numpad3",
VirtualKeyCode::Numpad4 => "Numpad4",
VirtualKeyCode::Numpad5 => "Numpad5",
VirtualKeyCode::Numpad6 => "Numpad6",
VirtualKeyCode::Numpad7 => "Numpad7",
VirtualKeyCode::Numpad8 => "Numpad8",
VirtualKeyCode::Numpad9 => "Numpad9",
VirtualKeyCode::AbntC1 => "AbntC1",
VirtualKeyCode::AbntC2 => "AbntC2",
VirtualKeyCode::NumpadAdd => "NumpadAdd",
VirtualKeyCode::Apostrophe => "Apostrophe",
VirtualKeyCode::Apps => "Apps",
VirtualKeyCode::At => "At",
VirtualKeyCode::Ax => "Ax",
VirtualKeyCode::Backslash => "Backslash",
VirtualKeyCode::Calculator => "Calculator",
VirtualKeyCode::Capital => "Capital",
VirtualKeyCode::Colon => "Colon",
VirtualKeyCode::Comma => "Comma",
VirtualKeyCode::Convert => "Convert",
VirtualKeyCode::NumpadDecimal => "NumpadDecimal",
VirtualKeyCode::NumpadDivide => "NumpadDivide",
VirtualKeyCode::Equals => "Equals",
VirtualKeyCode::Grave => "Grave",
VirtualKeyCode::Kana => "Kana",
VirtualKeyCode::Kanji => "Kanji",
VirtualKeyCode::LAlt => "LAlt",
VirtualKeyCode::LBracket => "LBracket",
VirtualKeyCode::LControl => "LControl",
VirtualKeyCode::LShift => "LShift",
VirtualKeyCode::LWin => "LWin",
VirtualKeyCode::Mail => "Mail",
VirtualKeyCode::MediaSelect => "MediaSelect",
VirtualKeyCode::MediaStop => "MediaStop",
VirtualKeyCode::Minus => "Minus",
VirtualKeyCode::NumpadMultiply => "NumpadMultiply",
VirtualKeyCode::Mute => "Mute",
VirtualKeyCode::MyComputer => "MyComputer",
VirtualKeyCode::NavigateForward => "NavigateForward",
VirtualKeyCode::NavigateBackward => "NavigateBackward",
VirtualKeyCode::NextTrack => "NextTrack",
VirtualKeyCode::NoConvert => "NoConvert",
VirtualKeyCode::NumpadComma => "NumpadComma",
VirtualKeyCode::NumpadEnter => "NumpadEnter",
VirtualKeyCode::NumpadEquals => "NumpadEquals",
VirtualKeyCode::OEM102 => "OEM102",
VirtualKeyCode::Period => "Period",
VirtualKeyCode::PlayPause => "PlayPause",
VirtualKeyCode::Power => "Power",
VirtualKeyCode::PrevTrack => "PrevTrack",
VirtualKeyCode::RAlt => "RAlt",
VirtualKeyCode::RBracket => "RBracket",
VirtualKeyCode::RControl => "RControl",
VirtualKeyCode::RShift => "RShift",
VirtualKeyCode::RWin => "RWin",
VirtualKeyCode::Semicolon => "Semicolon",
VirtualKeyCode::Slash => "Slash",
VirtualKeyCode::Sleep => "Sleep",
VirtualKeyCode::Stop => "Stop",
VirtualKeyCode::NumpadSubtract => "NumpadSubtract",
VirtualKeyCode::Sysrq => "Sysrq",
VirtualKeyCode::Tab => "Tab",
VirtualKeyCode::Underline => "Underline",
VirtualKeyCode::Unlabeled => "Unlabeled",
VirtualKeyCode::VolumeDown => "VolumeDown",
VirtualKeyCode::VolumeUp => "VolumeUp",
VirtualKeyCode::Wake => "Wake",
VirtualKeyCode::WebBack => "WebBack",
VirtualKeyCode::WebFavorites => "WebFavorites",
VirtualKeyCode::WebForward => "WebForward",
VirtualKeyCode::WebHome => "WebHome",
VirtualKeyCode::WebRefresh => "WebRefresh",
VirtualKeyCode::WebSearch => "WebSearch",
VirtualKeyCode::WebStop => "WebStop",
VirtualKeyCode::Yen => "Yen",
VirtualKeyCode::Copy => "Copy",
VirtualKeyCode::Paste => "Paste",
VirtualKeyCode::Cut => "Cut",
VirtualKeyCode::Asterisk => "Asterisk",
VirtualKeyCode::Plus => "Plus",
}
}
/// Helper function to convert Option<Arc<T>> to Option<Arc<dyn Any>>.
pub fn into_any_arc<T: Any + Send + Sync>(
opt: Option<Arc<T>>,
) -> Option<Arc<dyn Any + Send + Sync>> {
match opt {
Some(r) => Some(r),
None => None,
}
}
/// Converts engine's optional texture "pointer" to rg3d-ui's.
pub fn into_gui_texture(this: Texture) -> draw::SharedTexture {
draw::SharedTexture(this.into_inner())
}
/// "Transmutes" array of any sized type to a slice of bytes.
pub unsafe fn array_as_u8_slice<T: Sized>(v: &[T]) -> &'_ [u8] {
std::slice::from_raw_parts(v.as_ptr() as *const u8, std::mem::size_of::<T>() * v.len())
}
/// "Transmutes" value of any sized type to a slice of bytes.
pub unsafe fn value_as_u8_slice<T: Sized>(v: &T) -> &'_ [u8] {
std::slice::from_raw_parts(v as *const T as *const u8, std::mem::size_of::<T>())
}
/// Performs hashing of a sized value by interpreting it as raw memory.
pub fn hash_as_bytes<T: Sized, H: Hasher>(value: &T, hasher: &mut H) {
unsafe { hasher.write(value_as_u8_slice(value)) }
}
|
VirtualKeyCode::RControl => KeyCode::RControl,
VirtualKeyCode::RShift => KeyCode::RShift,
|
resnet50_v2_model.py
|
from keras.applications.resnet_v2 import ResNet50V2
model=ResNet50V2(include_top=True, weights=None, input_tensor=None, input_shape=(100,100,3),classes=41)
model.summary()
model.compile(loss='categorical_crossentropy',
optimizer='adam',
metrics=['accuracy'])
|
from keras.layers import Conv2D,MaxPooling2D
from keras.layers import Activation, Dense, Flatten, Dropout
from keras.preprocessing.image import ImageDataGenerator
from keras.callbacks import ModelCheckpoint
from keras import backend as K
batch_size = 50
checkpointer = ModelCheckpoint(filepath = 'cnn_from_scratch_fruits.hdf5', save_best_only = True)
history = model.fit(x_train,y_train,
batch_size = 50,
epochs=15,
validation_data=(x_valid, y_vaild),
callbacks = [checkpointer],
shuffle=True
)
model.load_weights('cnn_from_scratch_fruits.hdf5')
score = model.evaluate(x_test, y_test, verbose=0)
print('\n', 'Test accuracy:', score[1])
import matplotlib.pyplot as plt
# Plot training & validation accuracy values
plt.plot(history.history['accuracy'])
plt.plot(history.history['val_accuracy'])
plt.title('Model accuracy')
plt.ylabel('Accuracy')
plt.xlabel('Epoch')
plt.legend(['Train', 'Test'], loc='upper left')
plt.show()
# Plot training & validation loss values
plt.plot(history.history['loss'])
plt.plot(history.history['val_loss'])
plt.title('Model loss')
plt.ylabel('Loss')
plt.xlabel('Epoch')
plt.legend(['Train', 'Test'], loc='upper left')
plt.show()
|
print('Compiled!')
from keras.models import Sequential
|
tenancy_test.go
|
// Copyright (c) 2004-present Facebook All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package viewer
import (
"context"
"database/sql"
"errors"
"os"
"strconv"
"testing"
"time"
"github.com/cenkalti/backoff"
"github.com/facebookincubator/symphony/graph/ent"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
"gocloud.dev/server/health"
)
func TestFixedTenancy(t *testing.T) {
want := &ent.Client{}
tenancy := NewFixedTenancy(want)
assert.Implements(t, (*Tenancy)(nil), tenancy)
t.Run("ClientFor", func(t *testing.T) {
got, err := tenancy.ClientFor(context.Background(), "")
assert.NoError(t, err)
assert.True(t, want == got)
})
t.Run("Client", func(t *testing.T) {
got := tenancy.Client()
assert.True(t, want == got)
})
}
type testTenancy struct {
mock.Mock
}
func (t *testTenancy) ClientFor(ctx context.Context, name string) (*ent.Client, error) {
args := t.Called(ctx, name)
client, _ := args.Get(0).(*ent.Client)
return client, args.Error(1)
}
func TestCacheTenancy(t *testing.T) {
var m testTenancy
m.On("ClientFor", mock.Anything, "bar").
Return(&ent.Client{}, nil).
Once()
m.On("ClientFor", mock.Anything, "baz").
Return(nil, errors.New("try again")).
Once()
m.On("ClientFor", mock.Anything, "baz").
Return(&ent.Client{}, nil).
Once()
defer m.AssertExpectations(t)
var count int
tenancy := NewCacheTenancy(&m, func(*ent.Client) { count++ })
assert.Implements(t, (*health.Checker)(nil), tenancy)
client, err := tenancy.ClientFor(context.Background(), "bar")
assert.NoError(t, err)
assert.NotNil(t, client)
cached, err := tenancy.ClientFor(context.Background(), "bar")
assert.NoError(t, err)
assert.True(t, client == cached)
client, err = tenancy.ClientFor(context.Background(), "baz")
assert.Error(t, err)
assert.Nil(t, client)
client, err = tenancy.ClientFor(context.Background(), "baz")
assert.NoError(t, err)
assert.NotNil(t, client)
assert.Equal(t, 2, count)
}
func
|
(db *sql.DB) (string, func() error, error) {
name := "testdb_" + strconv.FormatInt(time.Now().UnixNano(), 10)
if _, err := db.Exec("create database " + DBName(name)); err != nil {
return "", nil, err
}
return name, func() error {
_, err := db.Exec("drop database " + DBName(name))
return err
}, nil
}
func TestMySQLTenancy(t *testing.T) {
dsn, ok := os.LookupEnv("MYSQL_DSN")
if !ok {
t.Skip("MYSQL_DSN not provided")
}
db, err := sql.Open("mysql", dsn)
require.NoError(t, err)
tenancy, err := NewMySQLTenancy(dsn)
require.NoError(t, err)
assert.Implements(t, (*health.Checker)(nil), tenancy)
ctx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond)
defer cancel()
b := backoff.WithContext(backoff.NewConstantBackOff(10*time.Millisecond), ctx)
err = backoff.Retry(tenancy.CheckHealth, b)
assert.NoError(t, err)
n1, cleaner, err := createMySQLDatabase(db)
require.NoError(t, err)
defer func(cleaner func() error) {
assert.NoError(t, cleaner())
}(cleaner)
n2, cleaner, err := createMySQLDatabase(db)
require.NoError(t, err)
defer func(cleaner func() error) {
assert.NoError(t, cleaner())
}(cleaner)
c1, err := tenancy.ClientFor(context.Background(), n1)
assert.NotNil(t, c1)
assert.NoError(t, err)
c2, err := tenancy.ClientFor(context.Background(), n2)
assert.NoError(t, err)
assert.True(t, c1 != c2)
}
|
createMySQLDatabase
|
property_map.rs
|
//! The map of property names to values used by the ActionScript VM.
//! This allows for dynamically choosing case-sensitivty at runtime,
//! because SWFv6 and below is case-insensitive. This also maintains
//! the insertion order of properties, which is necessary for accurate
//! enumeration order.
use crate::string::{utils as string_utils, AvmString, WStr};
use fnv::FnvBuildHasher;
use gc_arena::Collect;
use indexmap::{Equivalent, IndexMap};
use std::hash::{Hash, Hasher};
type FnvIndexMap<K, V> = IndexMap<K, V, FnvBuildHasher>;
/// A map from property names to values.
#[derive(Default, Clone, Debug)]
pub struct PropertyMap<'gc, V>(FnvIndexMap<PropertyName<'gc>, V>);
impl<'gc, V> PropertyMap<'gc, V> {
pub fn new() -> Self {
Self(FnvIndexMap::default())
}
pub fn contains_key<T: AsRef<WStr>>(&self, key: T, case_sensitive: bool) -> bool {
if case_sensitive {
self.0.contains_key(&CaseSensitive(key.as_ref()))
} else {
self.0.contains_key(&CaseInsentitive(key.as_ref()))
}
}
pub fn entry<'a>(&'a mut self, key: AvmString<'gc>, case_sensitive: bool) -> Entry<'gc, 'a, V> {
if case_sensitive {
match self.0.get_index_of(&CaseSensitive(key.as_ref())) {
Some(index) => Entry::Occupied(OccupiedEntry {
map: &mut self.0,
index,
}),
None => Entry::Vacant(VacantEntry {
map: &mut self.0,
key,
}),
}
} else {
match self.0.get_index_of(&CaseInsentitive(key.as_ref())) {
Some(index) => Entry::Occupied(OccupiedEntry {
map: &mut self.0,
index,
}),
None => Entry::Vacant(VacantEntry {
map: &mut self.0,
key,
}),
}
|
}
}
/// Gets the value for the specified property.
pub fn get<T: AsRef<WStr>>(&self, key: T, case_sensitive: bool) -> Option<&V> {
if case_sensitive {
self.0.get(&CaseSensitive(key.as_ref()))
} else {
self.0.get(&CaseInsentitive(key.as_ref()))
}
}
/// Gets a mutable reference to the value for the specified property.
pub fn get_mut<T: AsRef<WStr>>(&mut self, key: T, case_sensitive: bool) -> Option<&mut V> {
if case_sensitive {
self.0.get_mut(&CaseSensitive(key.as_ref()))
} else {
self.0.get_mut(&CaseInsentitive(key.as_ref()))
}
}
/// Gets a value by index, based on insertion order.
pub fn get_index(&self, index: usize) -> Option<&V> {
self.0.get_index(index).map(|(_, v)| v)
}
pub fn insert(&mut self, key: AvmString<'gc>, value: V, case_sensitive: bool) -> Option<V> {
match self.entry(key, case_sensitive) {
Entry::Occupied(entry) => Some(entry.insert(value)),
Entry::Vacant(entry) => {
entry.insert(value);
None
}
}
}
/// Returns the value tuples in Flash's iteration order (most recently added first).
pub fn iter(&self) -> impl Iterator<Item = (AvmString<'gc>, &V)> {
self.0.iter().rev().map(|(k, v)| (k.0, v))
}
/// Returns the key-value tuples in Flash's iteration order (most recently added first).
pub fn iter_mut(&mut self) -> impl Iterator<Item = (AvmString<'gc>, &mut V)> {
self.0.iter_mut().rev().map(|(k, v)| (k.0, v))
}
pub fn remove<T: AsRef<WStr>>(&mut self, key: T, case_sensitive: bool) -> Option<V> {
// Note that we must use shift_remove to maintain order in case this object is enumerated.
if case_sensitive {
self.0.shift_remove(&CaseSensitive(key.as_ref()))
} else {
self.0.shift_remove(&CaseInsentitive(key.as_ref()))
}
}
}
unsafe impl<'gc, V: Collect> Collect for PropertyMap<'gc, V> {
fn trace(&self, cc: gc_arena::CollectionContext) {
for (key, value) in &self.0 {
key.0.trace(cc);
value.trace(cc);
}
}
}
pub enum Entry<'gc, 'a, V> {
Occupied(OccupiedEntry<'gc, 'a, V>),
Vacant(VacantEntry<'gc, 'a, V>),
}
pub struct OccupiedEntry<'gc, 'a, V> {
map: &'a mut FnvIndexMap<PropertyName<'gc>, V>,
index: usize,
}
impl<'gc, 'a, V> OccupiedEntry<'gc, 'a, V> {
pub fn remove_entry(&mut self) -> (AvmString<'gc>, V) {
let (k, v) = self.map.shift_remove_index(self.index).unwrap();
(k.0, v)
}
pub fn get(&self) -> &V {
self.map.get_index(self.index).unwrap().1
}
pub fn get_mut(&mut self) -> &mut V {
self.map.get_index_mut(self.index).unwrap().1
}
pub fn insert(self, value: V) -> V {
std::mem::replace(self.map.get_index_mut(self.index).unwrap().1, value)
}
}
pub struct VacantEntry<'gc, 'a, V> {
map: &'a mut FnvIndexMap<PropertyName<'gc>, V>,
key: AvmString<'gc>,
}
impl<'gc, 'a, V> VacantEntry<'gc, 'a, V> {
pub fn insert(self, value: V) {
self.map.insert(PropertyName(self.key), value);
}
}
/// Wraps a str-like type, causing the hash map to use a case insensitive hash and equality.
struct CaseInsentitive<T>(T);
impl<'a> Hash for CaseInsentitive<&'a WStr> {
fn hash<H: Hasher>(&self, state: &mut H) {
swf_hash_string_ignore_case(self.0, state);
}
}
impl<'gc, 'a> Equivalent<PropertyName<'gc>> for CaseInsentitive<&'a WStr> {
fn equivalent(&self, key: &PropertyName<'gc>) -> bool {
key.0.eq_ignore_case(self.0)
}
}
/// Wraps an str-like type, causing the property map to use a case insensitive hash lookup,
/// but case sensitive equality.
struct CaseSensitive<T>(T);
impl<'a> Hash for CaseSensitive<&'a WStr> {
fn hash<H: Hasher>(&self, state: &mut H) {
swf_hash_string_ignore_case(self.0, state);
}
}
impl<'gc, 'a> Equivalent<PropertyName<'gc>> for CaseSensitive<&'a WStr> {
fn equivalent(&self, key: &PropertyName<'gc>) -> bool {
key.0 == self.0
}
}
/// The property keys stored in the property map.
/// This uses a case insensitive hash to ensure that properties can be found in
/// SWFv6, which is case insensitive. The equality check is handled by the `Equivalent`
/// impls above, which allow it to be either case-sensitive or insensitive.
/// Note that the property of if key1 == key2 -> hash(key1) == hash(key2) still holds.
#[derive(Debug, Clone, PartialEq, Eq, Collect)]
#[collect(require_static)]
struct PropertyName<'gc>(AvmString<'gc>);
#[allow(clippy::derive_hash_xor_eq)]
impl<'gc> Hash for PropertyName<'gc> {
fn hash<H: Hasher>(&self, state: &mut H) {
swf_hash_string_ignore_case(self.0.as_ref(), state);
}
}
fn swf_hash_string_ignore_case<H: Hasher>(s: &WStr, state: &mut H) {
s.iter()
.for_each(|c| string_utils::swf_to_lowercase(c).hash(state));
state.write_u8(0xff);
}
| |
handler_observed_txin_test.go
|
package thorchain
import (
"github.com/blang/semver"
sdk "github.com/cosmos/cosmos-sdk/types"
. "gopkg.in/check.v1"
"gitlab.com/thorchain/thornode/common"
"gitlab.com/thorchain/thornode/constants"
)
type HandlerObservedTxInSuite struct{}
type TestObservedTxInValidateKeeper struct {
KVStoreDummy
activeNodeAccount NodeAccount
standbyAccount NodeAccount
}
func (k *TestObservedTxInValidateKeeper) GetNodeAccount(_ sdk.Context, addr sdk.AccAddress) (NodeAccount, error) {
if addr.Equals(k.standbyAccount.NodeAddress) {
return k.standbyAccount, nil
}
if addr.Equals(k.activeNodeAccount.NodeAddress)
|
return NodeAccount{}, kaboom
}
func (k *TestObservedTxInValidateKeeper) SetNodeAccount(_ sdk.Context, na NodeAccount) error {
if na.NodeAddress.Equals(k.standbyAccount.NodeAddress) {
k.standbyAccount = na
return nil
}
return kaboom
}
var _ = Suite(&HandlerObservedTxInSuite{})
func (s *HandlerObservedTxInSuite) TestValidate(c *C) {
var err error
ctx, _ := setupKeeperForTest(c)
w := getHandlerTestWrapper(c, 1, true, false)
activeNodeAccount := GetRandomNodeAccount(NodeActive)
standbyAccount := GetRandomNodeAccount(NodeStandby)
keeper := &TestObservedTxInValidateKeeper{
activeNodeAccount: activeNodeAccount,
standbyAccount: standbyAccount,
}
versionedVaultMgrDummy := NewVersionedVaultMgrDummy(w.versionedTxOutStore)
versionedGasMgr := NewDummyVersionedGasMgr()
versionedObMgr := NewDummyVersionedObserverMgr()
versionedEventManagerDummy := NewDummyVersionedEventMgr()
handler := NewObservedTxInHandler(keeper, versionedObMgr, w.versionedTxOutStore, w.validatorMgr, versionedVaultMgrDummy, versionedGasMgr, versionedEventManagerDummy)
// happy path
ver := constants.SWVersion
pk := GetRandomPubKey()
txs := ObservedTxs{NewObservedTx(GetRandomTx(), 12, pk)}
txs[0].Tx.ToAddress, err = pk.GetAddress(txs[0].Tx.Coins[0].Asset.Chain)
c.Assert(err, IsNil)
msg := NewMsgObservedTxIn(txs, activeNodeAccount.NodeAddress)
isNewSigner, err := handler.validate(ctx, msg, ver)
c.Assert(err, IsNil)
c.Assert(isNewSigner, Equals, false)
// invalid version
isNewSigner, err = handler.validate(ctx, msg, semver.Version{})
c.Assert(err, Equals, errInvalidVersion)
c.Assert(isNewSigner, Equals, false)
// inactive node account
msg = NewMsgObservedTxIn(txs, GetRandomBech32Addr())
isNewSigner, err = handler.validate(ctx, msg, ver)
c.Assert(err, Equals, notAuthorized)
c.Assert(isNewSigner, Equals, false)
// invalid msg
msg = MsgObservedTxIn{}
isNewSigner, err = handler.validate(ctx, msg, ver)
c.Assert(err, NotNil)
c.Assert(isNewSigner, Equals, false)
}
type TestObservedTxInFailureKeeper struct {
KVStoreDummy
pool Pool
evt Event
}
func (k *TestObservedTxInFailureKeeper) GetPool(_ sdk.Context, _ common.Asset) (Pool, error) {
return k.pool, nil
}
func (k *TestObservedTxInFailureKeeper) UpsertEvent(_ sdk.Context, evt Event) error {
k.evt = evt
return nil
}
func (s *HandlerObservedTxInSuite) TestFailure(c *C) {
ctx, _ := setupKeeperForTest(c)
// w := getHandlerTestWrapper(c, 1, true, false)
keeper := &TestObservedTxInFailureKeeper{
pool: Pool{
Asset: common.BNBAsset,
BalanceRune: sdk.NewUint(200),
BalanceAsset: sdk.NewUint(300),
},
}
txOutStore := NewTxStoreDummy()
tx := NewObservedTx(GetRandomTx(), 12, GetRandomPubKey())
ver := constants.SWVersion
constAccessor := constants.GetConstantValues(ver)
err := refundTx(ctx, tx, txOutStore, keeper, constAccessor, CodeInvalidMemo, "Invalid memo", NewEventMgr())
c.Assert(err, IsNil)
items, err := txOutStore.GetOutboundItems(ctx)
c.Assert(err, IsNil)
c.Check(items, HasLen, 1)
}
type TestObservedTxInHandleKeeper struct {
KVStoreDummy
nas NodeAccounts
voter ObservedTxVoter
yggExists bool
height int64
msg MsgSwap
pool Pool
observing []sdk.AccAddress
vault Vault
txOut *TxOut
}
func (k *TestObservedTxInHandleKeeper) SetSwapQueueItem(_ sdk.Context, msg MsgSwap) error {
k.msg = msg
return nil
}
func (k *TestObservedTxInHandleKeeper) ListActiveNodeAccounts(_ sdk.Context) (NodeAccounts, error) {
return k.nas, nil
}
func (k *TestObservedTxInHandleKeeper) GetObservedTxVoter(_ sdk.Context, _ common.TxID) (ObservedTxVoter, error) {
return k.voter, nil
}
func (k *TestObservedTxInHandleKeeper) SetObservedTxVoter(_ sdk.Context, voter ObservedTxVoter) {
k.voter = voter
}
func (k *TestObservedTxInHandleKeeper) VaultExists(_ sdk.Context, _ common.PubKey) bool {
return k.yggExists
}
func (k *TestObservedTxInHandleKeeper) SetLastChainHeight(_ sdk.Context, _ common.Chain, height int64) error {
k.height = height
return nil
}
func (k *TestObservedTxInHandleKeeper) GetPool(_ sdk.Context, _ common.Asset) (Pool, error) {
return k.pool, nil
}
func (k *TestObservedTxInHandleKeeper) AddIncompleteEvents(_ sdk.Context, evt Event) error {
return nil
}
func (k *TestObservedTxInHandleKeeper) AddObservingAddresses(_ sdk.Context, addrs []sdk.AccAddress) error {
k.observing = addrs
return nil
}
func (k *TestObservedTxInHandleKeeper) UpsertEvent(_ sdk.Context, _ Event) error {
return nil
}
func (k *TestObservedTxInHandleKeeper) GetVault(_ sdk.Context, key common.PubKey) (Vault, error) {
if k.vault.PubKey.Equals(key) {
return k.vault, nil
}
return GetRandomVault(), kaboom
}
func (k *TestObservedTxInHandleKeeper) SetVault(_ sdk.Context, vault Vault) error {
if k.vault.PubKey.Equals(vault.PubKey) {
k.vault = vault
return nil
}
return kaboom
}
func (k *TestObservedTxInHandleKeeper) GetLowestActiveVersion(_ sdk.Context) semver.Version {
return constants.SWVersion
}
func (k *TestObservedTxInHandleKeeper) IsActiveObserver(_ sdk.Context, addr sdk.AccAddress) bool {
if addr.Equals(k.nas[0].NodeAddress) {
return true
}
return false
}
func (k *TestObservedTxInHandleKeeper) GetTxOut(ctx sdk.Context, blockHeight int64) (*TxOut, error) {
if k.txOut != nil && k.txOut.Height == blockHeight {
return k.txOut, nil
}
return nil, kaboom
}
func (k *TestObservedTxInHandleKeeper) SetTxOut(ctx sdk.Context, blockOut *TxOut) error {
if k.txOut.Height == blockOut.Height {
k.txOut = blockOut
return nil
}
return kaboom
}
func (s *HandlerObservedTxInSuite) TestHandle(c *C) {
var err error
ctx, _ := setupKeeperForTest(c)
w := getHandlerTestWrapper(c, 1, true, false)
ver := constants.SWVersion
tx := GetRandomTx()
tx.Memo = "SWAP:BTC.BTC:" + GetRandomBTCAddress().String()
obTx := NewObservedTx(tx, 12, GetRandomPubKey())
txs := ObservedTxs{obTx}
pk := GetRandomPubKey()
txs[0].Tx.ToAddress, err = pk.GetAddress(txs[0].Tx.Coins[0].Asset.Chain)
vault := GetRandomVault()
vault.PubKey = obTx.ObservedPubKey
keeper := &TestObservedTxInHandleKeeper{
nas: NodeAccounts{GetRandomNodeAccount(NodeActive)},
voter: NewObservedTxVoter(tx.ID, make(ObservedTxs, 0)),
vault: vault,
pool: Pool{
Asset: common.BNBAsset,
BalanceRune: sdk.NewUint(200),
BalanceAsset: sdk.NewUint(300),
},
yggExists: true,
}
versionedTxOutStore := NewVersionedTxOutStoreDummy()
versionedVaultMgrDummy := NewVersionedVaultMgrDummy(versionedTxOutStore)
versionedGasMgr := NewVersionedGasMgr()
versionedObMgr := NewVersionedObserverMgr()
versionedEventManagerDummy := NewDummyVersionedEventMgr()
handler := NewObservedTxInHandler(keeper, versionedObMgr, versionedTxOutStore, w.validatorMgr, versionedVaultMgrDummy, versionedGasMgr, versionedEventManagerDummy)
c.Assert(err, IsNil)
msg := NewMsgObservedTxIn(txs, keeper.nas[0].NodeAddress)
result := handler.handle(ctx, msg, ver)
obMgr, err := versionedObMgr.GetObserverManager(ctx, ver)
c.Assert(err, IsNil)
obMgr.EndBlock(ctx, keeper)
c.Assert(result.IsOK(), Equals, true, Commentf("%s", result.Log))
c.Check(keeper.msg.Tx.ID.Equals(tx.ID), Equals, true)
c.Check(keeper.observing, HasLen, 1)
c.Check(keeper.height, Equals, int64(12))
bnbCoin := keeper.vault.Coins.GetCoin(common.BNBAsset)
c.Assert(bnbCoin.Amount.Equal(sdk.OneUint()), Equals, true)
}
// Test migrate memo
func (s *HandlerObservedTxInSuite) TestMigrateMemo(c *C) {
var err error
ctx, _ := setupKeeperForTest(c)
w := getHandlerTestWrapper(c, 1, true, false)
ver := constants.SWVersion
vault := GetRandomVault()
addr, err := vault.PubKey.GetAddress(common.BNBChain)
c.Assert(err, IsNil)
newVault := GetRandomVault()
txout := NewTxOut(12)
newVaultAddr, err := newVault.PubKey.GetAddress(common.BNBChain)
c.Assert(err, IsNil)
txout.TxArray = append(txout.TxArray, &TxOutItem{
Chain: common.BNBChain,
InHash: common.BlankTxID,
ToAddress: newVaultAddr,
VaultPubKey: vault.PubKey,
Coin: common.NewCoin(common.BNBAsset, sdk.NewUint(1024)),
Memo: NewMigrateMemo(1).String(),
})
tx := NewObservedTx(common.Tx{
ID: GetRandomTxHash(),
Chain: common.BNBChain,
Coins: common.Coins{
common.NewCoin(common.BNBAsset, sdk.NewUint(1024)),
},
Memo: NewMigrateMemo(12).String(),
FromAddress: addr,
ToAddress: newVaultAddr,
Gas: BNBGasFeeSingleton,
}, 13, vault.PubKey)
txs := ObservedTxs{tx}
keeper := &TestObservedTxInHandleKeeper{
nas: NodeAccounts{GetRandomNodeAccount(NodeActive)},
voter: NewObservedTxVoter(tx.Tx.ID, make(ObservedTxs, 0)),
vault: vault,
pool: Pool{
Asset: common.BNBAsset,
BalanceRune: sdk.NewUint(200),
BalanceAsset: sdk.NewUint(300),
},
yggExists: true,
txOut: txout,
}
versionedTxOutStore := NewVersionedTxOutStoreDummy()
c.Assert(err, IsNil)
versionedVaultMgrDummy := NewVersionedVaultMgrDummy(versionedTxOutStore)
versionedGasMgr := NewVersionedGasMgr()
versionedObMgr := NewDummyVersionedObserverMgr()
versionedEventManagerDummy := NewDummyVersionedEventMgr()
handler := NewObservedTxInHandler(keeper, versionedObMgr, versionedTxOutStore, w.validatorMgr, versionedVaultMgrDummy, versionedGasMgr, versionedEventManagerDummy)
c.Assert(err, IsNil)
msg := NewMsgObservedTxIn(txs, keeper.nas[0].NodeAddress)
result := handler.handle(ctx, msg, ver)
c.Assert(result.IsOK(), Equals, true)
}
|
{
return k.activeNodeAccount, nil
}
|
main.go
|
// Copyright (c) 2014 The unifi Authors. All rights reserved.
// Use of this source code is governed by ISC-style license
// that can be found in the LICENSE file.
// Example command list-vouchers
// List vouchers of a given site
package main
import (
"flag"
"fmt"
"log"
"os"
"strconv"
"strings"
"text/tabwriter"
"github.com/dim13/unifi"
)
var (
host = flag.String("host", "unifi", "Controller hostname")
user = flag.String("user", "admin", "Controller username")
pass = flag.String("pass", "unifi", "Controller password")
version = flag.Int("version", 5, "Controller base version")
port = flag.String("port", "8443", "Controller port")
siteid = flag.String("siteid", "default", "Sitename or description")
)
func main() {
w := new(tabwriter.Writer)
w.Init(os.Stdout, 0, 8, 3, ' ', 0)
defer w.Flush()
flag.Parse()
u, err := unifi.Login(*user, *pass, *host, *port, *siteid, *version)
if err != nil
|
defer u.Logout()
site, err := u.Site(*siteid)
if err != nil {
log.Fatal(err)
}
vouchers, err := u.VoucherMap(site)
if err != nil {
log.Fatalln(err)
}
fmt.Fprintln(w, "Code\tCreateTime\tDuration\tNote\tQuota\tUsed")
for _, v := range vouchers {
p := []string{
v.Code,
strconv.Itoa(v.CreateTime),
strconv.Itoa(v.Duration),
v.Note,
strconv.Itoa(v.Quota),
strconv.Itoa(v.Used),
}
fmt.Fprintln(w, strings.Join(p, "\t"))
}
}
|
{
log.Fatal("Login returned error: ", err)
}
|
rrt_connect.py
|
from .smoothing import smooth_path
from .rrt import TreeNode, configs
from .utils import irange, argmin, RRT_ITERATIONS, RRT_RESTARTS, RRT_SMOOTHING
def rrt_connect(q1, q2, distance, sample, extend, collision, iterations=RRT_ITERATIONS):
if collision(q1) or collision(q2):
return None
root1, root2 = TreeNode(q1), TreeNode(q2)
nodes1, nodes2 = [root1], [root2]
for _ in irange(iterations):
if len(nodes1) > len(nodes2):
nodes1, nodes2 = nodes2, nodes1
s = sample()
last1 = argmin(lambda n: distance(n.config, s), nodes1)
for q in extend(last1.config, s):
if collision(q):
break
last1 = TreeNode(q, parent=last1)
nodes1.append(last1)
last2 = argmin(lambda n: distance(n.config, last1.config), nodes2)
for q in extend(last2.config, last1.config):
if collision(q):
break
last2 = TreeNode(q, parent=last2)
nodes2.append(last2)
else:
path1, path2 = last1.retrace(), last2.retrace()
if path1[0] != root1:
path1, path2 = path2, path1
return configs(path1[:-1] + path2[::-1])
return None
# TODO: version which checks whether the segment is valid
def direct_path(q1, q2, extend, collision):
|
def birrt(q1, q2, distance, sample, extend, collision,
restarts=RRT_RESTARTS, iterations=RRT_ITERATIONS, smooth=RRT_SMOOTHING):
if collision(q1) or collision(q2):
return None
path = direct_path(q1, q2, extend, collision)
if path is not None:
return path
for _ in irange(restarts + 1):
path = rrt_connect(q1, q2, distance, sample, extend,
collision, iterations=iterations)
if path is not None:
if smooth is None:
return path
return smooth_path(path, extend, collision, iterations=smooth)
return None
|
if collision(q1) or collision(q2):
return None
path = [q1]
for q in extend(q1, q2):
if collision(q):
return None
path.append(q)
return path
|
accounts_index.rs
|
use crate::{
contains::Contains,
inline_spl_token_v2_0::{self, SPL_TOKEN_ACCOUNT_MINT_OFFSET, SPL_TOKEN_ACCOUNT_OWNER_OFFSET},
secondary_index::*,
};
use bv::BitVec;
use dashmap::DashSet;
use log::*;
use ouroboros::self_referencing;
use solana_measure::measure::Measure;
use solana_sdk::{
clock::Slot,
pubkey::{Pubkey, PUBKEY_BYTES},
};
use std::{
collections::{
btree_map::{self, BTreeMap},
HashMap, HashSet,
},
ops::{
Bound,
Bound::{Excluded, Included, Unbounded},
Range, RangeBounds,
},
sync::{
atomic::{AtomicU64, Ordering},
Arc, RwLock, RwLockReadGuard, RwLockWriteGuard,
},
};
pub const ITER_BATCH_SIZE: usize = 1000;
pub type SlotList<T> = Vec<(Slot, T)>;
pub type SlotSlice<'s, T> = &'s [(Slot, T)];
pub type Ancestors = HashMap<Slot, usize>;
pub type RefCount = u64;
pub type AccountMap<K, V> = BTreeMap<K, V>;
type AccountMapEntry<T> = Arc<AccountMapEntryInner<T>>;
pub trait IsCached {
fn is_cached(&self) -> bool;
}
impl IsCached for bool {
fn is_cached(&self) -> bool {
false
}
}
impl IsCached for u64 {
fn is_cached(&self) -> bool {
false
}
}
enum ScanTypes<R: RangeBounds<Pubkey>> {
Unindexed(Option<R>),
Indexed(IndexKey),
}
#[derive(Debug, Clone, Copy)]
pub enum IndexKey {
ProgramId(Pubkey),
SplTokenMint(Pubkey),
SplTokenOwner(Pubkey),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AccountIndex {
ProgramId,
SplTokenMint,
SplTokenOwner,
}
#[derive(Debug)]
pub struct AccountMapEntryInner<T> {
ref_count: AtomicU64,
pub slot_list: RwLock<SlotList<T>>,
}
impl<T> AccountMapEntryInner<T> {
pub fn ref_count(&self) -> u64 {
self.ref_count.load(Ordering::Relaxed)
}
}
pub enum AccountIndexGetResult<'a, T: 'static, U> {
Found(ReadAccountMapEntry<T>, usize),
NotFoundOnFork,
Missing(std::sync::RwLockReadGuard<'a, AccountMap<U, AccountMapEntry<T>>>),
}
#[self_referencing]
pub struct ReadAccountMapEntry<T: 'static> {
owned_entry: AccountMapEntry<T>,
#[borrows(owned_entry)]
slot_list_guard: RwLockReadGuard<'this, SlotList<T>>,
}
impl<T: Clone> ReadAccountMapEntry<T> {
pub fn from_account_map_entry(account_map_entry: AccountMapEntry<T>) -> Self {
ReadAccountMapEntryBuilder {
owned_entry: account_map_entry,
slot_list_guard_builder: |lock| lock.slot_list.read().unwrap(),
}
.build()
}
pub fn slot_list(&self) -> &SlotList<T> {
&*self.borrow_slot_list_guard()
}
pub fn ref_count(&self) -> &AtomicU64 {
&self.borrow_owned_entry_contents().ref_count
}
pub fn unref(&self) {
self.ref_count().fetch_sub(1, Ordering::Relaxed);
}
}
#[self_referencing]
pub struct WriteAccountMapEntry<T: 'static> {
owned_entry: AccountMapEntry<T>,
#[borrows(owned_entry)]
slot_list_guard: RwLockWriteGuard<'this, SlotList<T>>,
}
impl<T: 'static + Clone + IsCached> WriteAccountMapEntry<T> {
pub fn from_account_map_entry(account_map_entry: AccountMapEntry<T>) -> Self {
WriteAccountMapEntryBuilder {
owned_entry: account_map_entry,
slot_list_guard_builder: |lock| lock.slot_list.write().unwrap(),
}
.build()
}
pub fn slot_list(&mut self) -> &SlotList<T> {
&*self.borrow_slot_list_guard()
}
pub fn slot_list_mut<RT>(
&mut self,
user: impl for<'this> FnOnce(&mut RwLockWriteGuard<'this, SlotList<T>>) -> RT,
) -> RT {
self.with_slot_list_guard_mut(user)
}
pub fn ref_count(&self) -> &AtomicU64 {
&self.borrow_owned_entry_contents().ref_count
}
// Try to update an item in the slot list the given `slot` If an item for the slot
// already exists in the list, remove the older item, add it to `reclaims`, and insert
// the new item.
pub fn update(&mut self, slot: Slot, account_info: T, reclaims: &mut SlotList<T>) {
// filter out other dirty entries from the same slot
let mut same_slot_previous_updates: Vec<(usize, &(Slot, T))> = self
.slot_list()
.iter()
.enumerate()
.filter(|(_, (s, _))| *s == slot)
.collect();
assert!(same_slot_previous_updates.len() <= 1);
if let Some((list_index, (s, previous_update_value))) = same_slot_previous_updates.pop() {
let is_flush_from_cache =
previous_update_value.is_cached() && !account_info.is_cached();
reclaims.push((*s, previous_update_value.clone()));
self.slot_list_mut(|list| list.remove(list_index));
if is_flush_from_cache {
self.ref_count().fetch_add(1, Ordering::Relaxed);
}
} else if !account_info.is_cached() {
// If it's the first non-cache insert, also bump the stored ref count
self.ref_count().fetch_add(1, Ordering::Relaxed);
}
self.slot_list_mut(|list| list.push((slot, account_info)));
}
}
#[derive(Debug, Default)]
pub struct RollingBitField {
max_width: u64,
min: u64,
max: u64, // exclusive
bits: BitVec,
count: usize,
// These are items that are true and lower than min.
// They would cause us to exceed max_width if we stored them in our bit field.
// We only expect these items in conditions where there is some other bug in the system.
excess: HashSet<u64>,
}
// functionally similar to a hashset
// Relies on there being a sliding window of key values. The key values continue to increase.
// Old key values are removed from the lesser values and do not accumulate.
impl RollingBitField {
pub fn new(max_width: u64) -> Self {
assert!(max_width > 0);
assert!(max_width.is_power_of_two()); // power of 2 to make dividing a shift
let bits = BitVec::new_fill(false, max_width);
Self {
max_width,
bits,
count: 0,
min: 0,
max: 0,
excess: HashSet::new(),
}
}
// find the array index
fn get_address(&self, key: &u64) -> u64 {
key % self.max_width
}
pub fn range_width(&self) -> u64 {
// note that max isn't updated on remove, so it can be above the current max
self.max - self.min
}
pub fn insert(&mut self, key: u64) {
let bits_empty = self.count == 0 || self.count == self.excess.len();
let update_bits = if bits_empty {
true // nothing in bits, so in range
} else if key < self.min {
// bits not empty and this insert is before min, so add to excess
if self.excess.insert(key) {
self.count += 1;
}
false
} else if key < self.max {
true // fits current bit field range
} else {
// key is >= max
let new_max = key + 1;
loop {
let new_width = new_max.saturating_sub(self.min);
if new_width <= self.max_width {
// this key will fit the max range
break;
}
// move the min item from bits to excess and then purge from min to make room for this new max
let inserted = self.excess.insert(self.min);
assert!(inserted);
let key = self.min;
let address = self.get_address(&key);
self.bits.set(address, false);
self.purge(&key);
}
true // moved things to excess if necessary, so update bits with the new entry
};
if update_bits {
let address = self.get_address(&key);
let value = self.bits.get(address);
if !value {
self.bits.set(address, true);
if bits_empty {
self.min = key;
self.max = key + 1;
} else {
self.min = std::cmp::min(self.min, key);
self.max = std::cmp::max(self.max, key + 1);
}
self.count += 1;
}
}
}
pub fn remove(&mut self, key: &u64) -> bool {
if key >= &self.min {
// if asked to remove something bigger than max, then no-op
if key < &self.max {
let address = self.get_address(key);
let get = self.bits.get(address);
if get {
self.count -= 1;
self.bits.set(address, false);
self.purge(key);
}
get
} else {
false
}
} else {
// asked to remove something < min. would be in excess if it exists
let remove = self.excess.remove(key);
if remove {
self.count -= 1;
}
remove
}
}
// after removing 'key' where 'key' = min, make min the correct new min value
fn purge(&mut self, key: &u64) {
if self.count > 0 {
if key == &self.min {
let start = self.min + 1; // min just got removed
for key in start..self.max {
if self.contains_assume_in_range(&key) {
self.min = key;
break;
}
}
}
} else {
self.min = Slot::default();
self.max = Slot::default();
}
}
fn contains_assume_in_range(&self, key: &u64) -> bool {
// the result may be aliased. Caller is responsible for determining key is in range.
let address = self.get_address(key);
self.bits.get(address)
}
pub fn contains(&self, key: &u64) -> bool {
if key < &self.max {
if key >= &self.min {
self.contains_assume_in_range(key)
} else {
self.excess.contains(key)
}
} else {
false
}
}
pub fn len(&self) -> usize {
self.count
}
pub fn is_empty(&self) -> bool {
self.len() == 0
}
pub fn clear(&mut self) {
let mut n = Self::new(self.max_width);
std::mem::swap(&mut n, self);
}
pub fn get_all(&self) -> Vec<u64> {
let mut all = Vec::with_capacity(self.count);
self.excess.iter().for_each(|slot| all.push(*slot));
for key in self.min..self.max {
if self.contains_assume_in_range(&key) {
all.push(key);
}
}
all
}
}
#[derive(Debug)]
pub struct RootsTracker {
roots: RollingBitField,
max_root: Slot,
uncleaned_roots: HashSet<Slot>,
previous_uncleaned_roots: HashSet<Slot>,
}
impl Default for RootsTracker {
fn default() -> Self {
// we expect to keep a rolling set of 400k slots around at a time
// 4M gives us plenty of extra(?!) room to handle a width 10x what we should need.
// cost is 4M bits of memory, which is .5MB
RootsTracker::new(4194304)
}
}
impl RootsTracker {
pub fn new(max_width: u64) -> Self {
Self {
roots: RollingBitField::new(max_width),
max_root: 0,
uncleaned_roots: HashSet::new(),
previous_uncleaned_roots: HashSet::new(),
}
}
}
#[derive(Debug, Default)]
pub struct AccountsIndexRootsStats {
pub roots_len: usize,
pub uncleaned_roots_len: usize,
pub previous_uncleaned_roots_len: usize,
pub roots_range: u64,
pub rooted_cleaned_count: usize,
pub unrooted_cleaned_count: usize,
}
pub struct AccountsIndexIterator<'a, T> {
account_maps: &'a RwLock<AccountMap<Pubkey, AccountMapEntry<T>>>,
start_bound: Bound<Pubkey>,
end_bound: Bound<Pubkey>,
is_finished: bool,
}
impl<'a, T> AccountsIndexIterator<'a, T> {
fn clone_bound(bound: Bound<&Pubkey>) -> Bound<Pubkey> {
match bound {
Unbounded => Unbounded,
Included(k) => Included(*k),
Excluded(k) => Excluded(*k),
}
}
pub fn new<R>(
account_maps: &'a RwLock<AccountMap<Pubkey, AccountMapEntry<T>>>,
range: Option<R>,
) -> Self
where
R: RangeBounds<Pubkey>,
{
Self {
start_bound: range
.as_ref()
.map(|r| Self::clone_bound(r.start_bound()))
.unwrap_or(Unbounded),
end_bound: range
.as_ref()
.map(|r| Self::clone_bound(r.end_bound()))
.unwrap_or(Unbounded),
account_maps,
is_finished: false,
}
}
}
impl<'a, T: 'static + Clone> Iterator for AccountsIndexIterator<'a, T> {
type Item = Vec<(Pubkey, AccountMapEntry<T>)>;
fn next(&mut self) -> Option<Self::Item> {
if self.is_finished {
return None;
}
let chunk: Vec<(Pubkey, AccountMapEntry<T>)> = self
.account_maps
.read()
.unwrap()
.range((self.start_bound, self.end_bound))
.map(|(pubkey, account_map_entry)| (*pubkey, account_map_entry.clone()))
.take(ITER_BATCH_SIZE)
.collect();
if chunk.is_empty() {
self.is_finished = true;
return None;
}
self.start_bound = Excluded(chunk.last().unwrap().0);
Some(chunk)
}
}
pub trait ZeroLamport {
fn is_zero_lamport(&self) -> bool;
}
#[derive(Debug, Default)]
pub struct AccountsIndex<T> {
pub account_maps: RwLock<AccountMap<Pubkey, AccountMapEntry<T>>>,
program_id_index: SecondaryIndex<DashMapSecondaryIndexEntry>,
spl_token_mint_index: SecondaryIndex<DashMapSecondaryIndexEntry>,
spl_token_owner_index: SecondaryIndex<RwLockSecondaryIndexEntry>,
roots_tracker: RwLock<RootsTracker>,
ongoing_scan_roots: RwLock<BTreeMap<Slot, u64>>,
zero_lamport_pubkeys: DashSet<Pubkey>,
}
impl<T: 'static + Clone + IsCached + ZeroLamport> AccountsIndex<T> {
fn
|
<R>(&self, range: Option<R>) -> AccountsIndexIterator<T>
where
R: RangeBounds<Pubkey>,
{
AccountsIndexIterator::new(&self.account_maps, range)
}
fn do_checked_scan_accounts<F, R>(
&self,
metric_name: &'static str,
ancestors: &Ancestors,
func: F,
scan_type: ScanTypes<R>,
) where
F: FnMut(&Pubkey, (&T, Slot)),
R: RangeBounds<Pubkey>,
{
let max_root = {
let mut w_ongoing_scan_roots = self
// This lock is also grabbed by clean_accounts(), so clean
// has at most cleaned up to the current `max_root` (since
// clean only happens *after* BankForks::set_root() which sets
// the `max_root`)
.ongoing_scan_roots
.write()
.unwrap();
// `max_root()` grabs a lock while
// the `ongoing_scan_roots` lock is held,
// make sure inverse doesn't happen to avoid
// deadlock
let max_root = self.max_root();
*w_ongoing_scan_roots.entry(max_root).or_default() += 1;
max_root
};
// First we show that for any bank `B` that is a descendant of
// the current `max_root`, it must be true that and `B.ancestors.contains(max_root)`,
// regardless of the pattern of `squash()` behavior, where `ancestors` is the set
// of ancestors that is tracked in each bank.
//
// Proof: At startup, if starting from a snapshot, generate_index() adds all banks
// in the snapshot to the index via `add_root()` and so `max_root` will be the
// greatest of these. Thus, so the claim holds at startup since there are no
// descendants of `max_root`.
//
// Now we proceed by induction on each `BankForks::set_root()`.
// Assume the claim holds when the `max_root` is `R`. Call the set of
// descendants of `R` present in BankForks `R_descendants`.
//
// Then for any banks `B` in `R_descendants`, it must be that `B.ancestors.contains(S)`,
// where `S` is any ancestor of `B` such that `S >= R`.
//
// For example:
// `R` -> `A` -> `C` -> `B`
// Then `B.ancestors == {R, A, C}`
//
// Next we call `BankForks::set_root()` at some descendant of `R`, `R_new`,
// where `R_new > R`.
//
// When we squash `R_new`, `max_root` in the AccountsIndex here is now set to `R_new`,
// and all nondescendants of `R_new` are pruned.
//
// Now consider any outstanding references to banks in the system that are descended from
// `max_root == R_new`. Take any one of these references and call it `B`. Because `B` is
// a descendant of `R_new`, this means `B` was also a descendant of `R`. Thus `B`
// must be a member of `R_descendants` because `B` was constructed and added to
// BankForks before the `set_root`.
//
// This means by the guarantees of `R_descendants` described above, because
// `R_new` is an ancestor of `B`, and `R < R_new < B`, then `B.ancestors.contains(R_new)`.
//
// Now until the next `set_root`, any new banks constructed from `new_from_parent` will
// also have `max_root == R_new` in their ancestor set, so the claim holds for those descendants
// as well. Once the next `set_root` happens, we once again update `max_root` and the same
// inductive argument can be applied again to show the claim holds.
// Check that the `max_root` is present in `ancestors`. From the proof above, if
// `max_root` is not present in `ancestors`, this means the bank `B` with the
// given `ancestors` is not descended from `max_root, which means
// either:
// 1) `B` is on a different fork or
// 2) `B` is an ancestor of `max_root`.
// In both cases we can ignore the given ancestors and instead just rely on the roots
// present as `max_root` indicates the roots present in the index are more up to date
// than the ancestors given.
let empty = Ancestors::default();
let ancestors = if ancestors.contains_key(&max_root) {
ancestors
} else {
/*
This takes of edge cases like:
Diagram 1:
slot 0
|
slot 1
/ \
slot 2 |
| slot 3 (max root)
slot 4 (scan)
By the time the scan on slot 4 is called, slot 2 may already have been
cleaned by a clean on slot 3, but slot 4 may not have been cleaned.
The state in slot 2 would have been purged and is not saved in any roots.
In this case, a scan on slot 4 wouldn't accurately reflect the state when bank 4
was frozen. In cases like this, we default to a scan on the latest roots by
removing all `ancestors`.
*/
&empty
};
/*
Now there are two cases, either `ancestors` is empty or nonempty:
1) If ancestors is empty, then this is the same as a scan on a rooted bank,
and `ongoing_scan_roots` provides protection against cleanup of roots necessary
for the scan, and passing `Some(max_root)` to `do_scan_accounts()` ensures newer
roots don't appear in the scan.
2) If ancestors is non-empty, then from the `ancestors_contains(&max_root)` above, we know
that the fork structure must look something like:
Diagram 2:
Build fork structure:
slot 0
|
slot 1 (max_root)
/ \
slot 2 |
| slot 3 (potential newer max root)
slot 4
|
slot 5 (scan)
Consider both types of ancestors, ancestor <= `max_root` and
ancestor > `max_root`, where `max_root == 1` as illustrated above.
a) The set of `ancestors <= max_root` are all rooted, which means their state
is protected by the same guarantees as 1).
b) As for the `ancestors > max_root`, those banks have at least one reference discoverable
through the chain of `Bank::BankRc::parent` starting from the calling bank. For instance
bank 5's parent reference keeps bank 4 alive, which will prevent the `Bank::drop()` from
running and cleaning up bank 4. Furthermore, no cleans can happen past the saved max_root == 1,
so a potential newer max root at 3 will not clean up any of the ancestors > 1, so slot 4
will not be cleaned in the middle of the scan either. (NOTE similar reasoning is employed for
assert!() justification in AccountsDb::retry_to_get_account_accessor)
*/
match scan_type {
ScanTypes::Unindexed(range) => {
// Pass "" not to log metrics, so RPC doesn't get spammy
self.do_scan_accounts(metric_name, ancestors, func, range, Some(max_root));
}
ScanTypes::Indexed(IndexKey::ProgramId(program_id)) => {
self.do_scan_secondary_index(
ancestors,
func,
&self.program_id_index,
&program_id,
Some(max_root),
);
}
ScanTypes::Indexed(IndexKey::SplTokenMint(mint_key)) => {
self.do_scan_secondary_index(
ancestors,
func,
&self.spl_token_mint_index,
&mint_key,
Some(max_root),
);
}
ScanTypes::Indexed(IndexKey::SplTokenOwner(owner_key)) => {
self.do_scan_secondary_index(
ancestors,
func,
&self.spl_token_owner_index,
&owner_key,
Some(max_root),
);
}
}
{
let mut ongoing_scan_roots = self.ongoing_scan_roots.write().unwrap();
let count = ongoing_scan_roots.get_mut(&max_root).unwrap();
*count -= 1;
if *count == 0 {
ongoing_scan_roots.remove(&max_root);
}
}
}
fn do_unchecked_scan_accounts<F, R>(
&self,
metric_name: &'static str,
ancestors: &Ancestors,
func: F,
range: Option<R>,
) where
F: FnMut(&Pubkey, (&T, Slot)),
R: RangeBounds<Pubkey>,
{
self.do_scan_accounts(metric_name, ancestors, func, range, None);
}
// Scan accounts and return latest version of each account that is either:
// 1) rooted or
// 2) present in ancestors
fn do_scan_accounts<F, R>(
&self,
metric_name: &'static str,
ancestors: &Ancestors,
mut func: F,
range: Option<R>,
max_root: Option<Slot>,
) where
F: FnMut(&Pubkey, (&T, Slot)),
R: RangeBounds<Pubkey>,
{
// TODO: expand to use mint index to find the `pubkey_list` below more efficiently
// instead of scanning the entire range
let mut total_elapsed_timer = Measure::start("total");
let mut num_keys_iterated = 0;
let mut latest_slot_elapsed = 0;
let mut load_account_elapsed = 0;
let mut read_lock_elapsed = 0;
let mut iterator_elapsed = 0;
let mut iterator_timer = Measure::start("iterator_elapsed");
for pubkey_list in self.iter(range) {
iterator_timer.stop();
iterator_elapsed += iterator_timer.as_us();
for (pubkey, list) in pubkey_list {
num_keys_iterated += 1;
let mut read_lock_timer = Measure::start("read_lock");
let list_r = &list.slot_list.read().unwrap();
read_lock_timer.stop();
read_lock_elapsed += read_lock_timer.as_us();
let mut latest_slot_timer = Measure::start("latest_slot");
if let Some(index) = self.latest_slot(Some(ancestors), &list_r, max_root) {
latest_slot_timer.stop();
latest_slot_elapsed += latest_slot_timer.as_us();
let mut load_account_timer = Measure::start("load_account");
func(&pubkey, (&list_r[index].1, list_r[index].0));
load_account_timer.stop();
load_account_elapsed += load_account_timer.as_us();
}
}
iterator_timer = Measure::start("iterator_elapsed");
}
total_elapsed_timer.stop();
if !metric_name.is_empty() {
datapoint_info!(
metric_name,
("total_elapsed", total_elapsed_timer.as_us(), i64),
("latest_slot_elapsed", latest_slot_elapsed, i64),
("read_lock_elapsed", read_lock_elapsed, i64),
("load_account_elapsed", load_account_elapsed, i64),
("iterator_elapsed", iterator_elapsed, i64),
("num_keys_iterated", num_keys_iterated, i64),
)
}
}
fn do_scan_secondary_index<
F,
SecondaryIndexEntryType: SecondaryIndexEntry + Default + Sync + Send,
>(
&self,
ancestors: &Ancestors,
mut func: F,
index: &SecondaryIndex<SecondaryIndexEntryType>,
index_key: &Pubkey,
max_root: Option<Slot>,
) where
F: FnMut(&Pubkey, (&T, Slot)),
{
for pubkey in index.get(index_key) {
// Maybe these reads from the AccountsIndex can be batched every time it
// grabs the read lock as well...
if let AccountIndexGetResult::Found(list_r, index) =
self.get(&pubkey, Some(ancestors), max_root)
{
func(
&pubkey,
(&list_r.slot_list()[index].1, list_r.slot_list()[index].0),
);
}
}
}
pub fn get_account_read_entry(&self, pubkey: &Pubkey) -> Option<ReadAccountMapEntry<T>> {
self.account_maps
.read()
.unwrap()
.get(pubkey)
.cloned()
.map(ReadAccountMapEntry::from_account_map_entry)
}
fn get_account_write_entry(&self, pubkey: &Pubkey) -> Option<WriteAccountMapEntry<T>> {
self.account_maps
.read()
.unwrap()
.get(pubkey)
.cloned()
.map(WriteAccountMapEntry::from_account_map_entry)
}
fn insert_new_entry_if_missing(&self, pubkey: &Pubkey) -> (WriteAccountMapEntry<T>, bool) {
let new_entry = Arc::new(AccountMapEntryInner {
ref_count: AtomicU64::new(0),
slot_list: RwLock::new(SlotList::with_capacity(1)),
});
let mut w_account_maps = self.account_maps.write().unwrap();
let mut is_newly_inserted = false;
let account_entry = w_account_maps.entry(*pubkey).or_insert_with(|| {
is_newly_inserted = true;
new_entry
});
let w_account_entry = WriteAccountMapEntry::from_account_map_entry(account_entry.clone());
(w_account_entry, is_newly_inserted)
}
fn get_account_write_entry_else_create(
&self,
pubkey: &Pubkey,
) -> (WriteAccountMapEntry<T>, bool) {
let mut w_account_entry = self.get_account_write_entry(pubkey);
let mut is_newly_inserted = false;
if w_account_entry.is_none() {
let entry_is_new = self.insert_new_entry_if_missing(pubkey);
w_account_entry = Some(entry_is_new.0);
is_newly_inserted = entry_is_new.1;
}
(w_account_entry.unwrap(), is_newly_inserted)
}
pub fn handle_dead_keys(&self, dead_keys: &[&Pubkey], account_indexes: &HashSet<AccountIndex>) {
if !dead_keys.is_empty() {
for key in dead_keys.iter() {
let mut w_index = self.account_maps.write().unwrap();
if let btree_map::Entry::Occupied(index_entry) = w_index.entry(**key) {
if index_entry.get().slot_list.read().unwrap().is_empty() {
index_entry.remove();
// Note passing `None` to remove all the entries for this key
// is only safe because we have the lock for this key's entry
// in the AccountsIndex, so no other thread is also updating
// the index
self.purge_secondary_indexes_by_inner_key(
key,
None::<&Slot>,
account_indexes,
);
}
}
}
}
}
/// call func with every pubkey and index visible from a given set of ancestors
pub(crate) fn scan_accounts<F>(&self, ancestors: &Ancestors, func: F)
where
F: FnMut(&Pubkey, (&T, Slot)),
{
// Pass "" not to log metrics, so RPC doesn't get spammy
self.do_checked_scan_accounts(
"",
ancestors,
func,
ScanTypes::Unindexed(None::<Range<Pubkey>>),
);
}
pub(crate) fn unchecked_scan_accounts<F>(
&self,
metric_name: &'static str,
ancestors: &Ancestors,
func: F,
) where
F: FnMut(&Pubkey, (&T, Slot)),
{
self.do_unchecked_scan_accounts(metric_name, ancestors, func, None::<Range<Pubkey>>);
}
/// call func with every pubkey and index visible from a given set of ancestors with range
pub(crate) fn range_scan_accounts<F, R>(
&self,
metric_name: &'static str,
ancestors: &Ancestors,
range: R,
func: F,
) where
F: FnMut(&Pubkey, (&T, Slot)),
R: RangeBounds<Pubkey>,
{
// Only the rent logic should be calling this, which doesn't need the safety checks
self.do_unchecked_scan_accounts(metric_name, ancestors, func, Some(range));
}
/// call func with every pubkey and index visible from a given set of ancestors
pub(crate) fn index_scan_accounts<F>(&self, ancestors: &Ancestors, index_key: IndexKey, func: F)
where
F: FnMut(&Pubkey, (&T, Slot)),
{
// Pass "" not to log metrics, so RPC doesn't get spammy
self.do_checked_scan_accounts(
"",
ancestors,
func,
ScanTypes::<Range<Pubkey>>::Indexed(index_key),
);
}
pub fn get_rooted_entries(&self, slice: SlotSlice<T>, max: Option<Slot>) -> SlotList<T> {
let max = max.unwrap_or(Slot::MAX);
let lock = &self.roots_tracker.read().unwrap().roots;
slice
.iter()
.filter(|(slot, _)| *slot <= max && lock.contains(slot))
.cloned()
.collect()
}
// returns the rooted entries and the storage ref count
pub fn roots_and_ref_count(
&self,
locked_account_entry: &ReadAccountMapEntry<T>,
max: Option<Slot>,
) -> (SlotList<T>, RefCount) {
(
self.get_rooted_entries(&locked_account_entry.slot_list(), max),
locked_account_entry.ref_count().load(Ordering::Relaxed),
)
}
pub fn purge_exact<'a, C>(
&'a self,
pubkey: &Pubkey,
slots_to_purge: &'a C,
reclaims: &mut SlotList<T>,
account_indexes: &HashSet<AccountIndex>,
) -> bool
where
C: Contains<'a, Slot>,
{
let is_empty = {
let mut write_account_map_entry = self.get_account_write_entry(pubkey).unwrap();
write_account_map_entry.slot_list_mut(|slot_list| {
slot_list.retain(|(slot, item)| {
let should_purge = slots_to_purge.contains(&slot);
if should_purge {
reclaims.push((*slot, item.clone()));
false
} else {
true
}
});
slot_list.is_empty()
})
};
self.purge_secondary_indexes_by_inner_key(pubkey, Some(slots_to_purge), account_indexes);
is_empty
}
pub fn min_ongoing_scan_root(&self) -> Option<Slot> {
self.ongoing_scan_roots
.read()
.unwrap()
.keys()
.next()
.cloned()
}
// Given a SlotSlice `L`, a list of ancestors and a maximum slot, find the latest element
// in `L`, where the slot `S` is an ancestor or root, and if `S` is a root, then `S <= max_root`
fn latest_slot(
&self,
ancestors: Option<&Ancestors>,
slice: SlotSlice<T>,
max_root: Option<Slot>,
) -> Option<usize> {
let mut current_max = 0;
let mut rv = None;
if let Some(ancestors) = ancestors {
if !ancestors.is_empty() {
for (i, (slot, _t)) in slice.iter().rev().enumerate() {
if (rv.is_none() || *slot > current_max) && ancestors.contains_key(slot) {
rv = Some(i);
current_max = *slot;
}
}
}
}
let max_root = max_root.unwrap_or(Slot::MAX);
let mut tracker = None;
for (i, (slot, _t)) in slice.iter().rev().enumerate() {
if (rv.is_none() || *slot > current_max) && *slot <= max_root {
let lock = match tracker {
Some(inner) => inner,
None => self.roots_tracker.read().unwrap(),
};
if lock.roots.contains(&slot) {
rv = Some(i);
current_max = *slot;
}
tracker = Some(lock);
}
}
rv.map(|index| slice.len() - 1 - index)
}
/// Get an account
/// The latest account that appears in `ancestors` or `roots` is returned.
pub(crate) fn get(
&self,
pubkey: &Pubkey,
ancestors: Option<&Ancestors>,
max_root: Option<Slot>,
) -> AccountIndexGetResult<'_, T, Pubkey> {
let read_lock = self.account_maps.read().unwrap();
let account = read_lock
.get(pubkey)
.cloned()
.map(ReadAccountMapEntry::from_account_map_entry);
match account {
Some(locked_entry) => {
drop(read_lock);
let slot_list = locked_entry.slot_list();
let found_index = self.latest_slot(ancestors, slot_list, max_root);
match found_index {
Some(found_index) => AccountIndexGetResult::Found(locked_entry, found_index),
None => AccountIndexGetResult::NotFoundOnFork,
}
}
None => AccountIndexGetResult::Missing(read_lock),
}
}
// Get the maximum root <= `max_allowed_root` from the given `slice`
fn get_newest_root_in_slot_list(
roots: &RollingBitField,
slice: SlotSlice<T>,
max_allowed_root: Option<Slot>,
) -> Slot {
let mut max_root = 0;
for (f, _) in slice.iter() {
if let Some(max_allowed_root) = max_allowed_root {
if *f > max_allowed_root {
continue;
}
}
if *f > max_root && roots.contains(f) {
max_root = *f;
}
}
max_root
}
fn update_secondary_indexes(
&self,
pubkey: &Pubkey,
slot: Slot,
account_owner: &Pubkey,
account_data: &[u8],
account_indexes: &HashSet<AccountIndex>,
) {
if account_indexes.is_empty() {
return;
}
if account_indexes.contains(&AccountIndex::ProgramId) {
self.program_id_index.insert(account_owner, pubkey, slot);
}
// Note because of the below check below on the account data length, when an
// account hits zero lamports and is reset to AccountSharedData::Default, then we skip
// the below updates to the secondary indexes.
//
// Skipping means not updating secondary index to mark the account as missing.
// This doesn't introduce false positives during a scan because the caller to scan
// provides the ancestors to check. So even if a zero-lamport account is not yet
// removed from the secondary index, the scan function will:
// 1) consult the primary index via `get(&pubkey, Some(ancestors), max_root)`
// and find the zero-lamport version
// 2) When the fetch from storage occurs, it will return AccountSharedData::Default
// (as persisted tombstone for snapshots). This will then ultimately be
// filtered out by post-scan filters, like in `get_filtered_spl_token_accounts_by_owner()`.
if *account_owner == inline_spl_token_v2_0::id()
&& account_data.len() == inline_spl_token_v2_0::state::Account::get_packed_len()
{
if account_indexes.contains(&AccountIndex::SplTokenOwner) {
let owner_key = Pubkey::new(
&account_data[SPL_TOKEN_ACCOUNT_OWNER_OFFSET
..SPL_TOKEN_ACCOUNT_OWNER_OFFSET + PUBKEY_BYTES],
);
self.spl_token_owner_index.insert(&owner_key, pubkey, slot);
}
if account_indexes.contains(&AccountIndex::SplTokenMint) {
let mint_key = Pubkey::new(
&account_data[SPL_TOKEN_ACCOUNT_MINT_OFFSET
..SPL_TOKEN_ACCOUNT_MINT_OFFSET + PUBKEY_BYTES],
);
self.spl_token_mint_index.insert(&mint_key, pubkey, slot);
}
}
}
// Same functionally to upsert, but doesn't take the read lock
// initially on the accounts_map
// Can save time when inserting lots of new keys
pub fn insert_new_if_missing(
&self,
slot: Slot,
pubkey: &Pubkey,
account_owner: &Pubkey,
account_data: &[u8],
account_indexes: &HashSet<AccountIndex>,
account_info: T,
reclaims: &mut SlotList<T>,
) {
{
let (mut w_account_entry, _is_new) = self.insert_new_entry_if_missing(pubkey);
if account_info.is_zero_lamport() {
self.zero_lamport_pubkeys.insert(*pubkey);
}
w_account_entry.update(slot, account_info, reclaims);
}
self.update_secondary_indexes(pubkey, slot, account_owner, account_data, account_indexes);
}
// Updates the given pubkey at the given slot with the new account information.
// Returns true if the pubkey was newly inserted into the index, otherwise, if the
// pubkey updates an existing entry in the index, returns false.
pub fn upsert(
&self,
slot: Slot,
pubkey: &Pubkey,
account_owner: &Pubkey,
account_data: &[u8],
account_indexes: &HashSet<AccountIndex>,
account_info: T,
reclaims: &mut SlotList<T>,
) -> bool {
let is_newly_inserted = {
let (mut w_account_entry, is_newly_inserted) =
self.get_account_write_entry_else_create(pubkey);
// We don't atomically update both primary index and secondary index together.
// This certainly creates small time window with inconsistent state across the two indexes.
// However, this is acceptable because:
//
// - A strict consistent view at any given moment of time is not necessary, because the only
// use case for the secondary index is `scan`, and `scans` are only supported/require consistency
// on frozen banks, and this inconsistency is only possible on working banks.
//
// - The secondary index is never consulted as primary source of truth for gets/stores.
// So, what the accounts_index sees alone is sufficient as a source of truth for other non-scan
// account operations.
if account_info.is_zero_lamport() {
self.zero_lamport_pubkeys.insert(*pubkey);
}
w_account_entry.update(slot, account_info, reclaims);
is_newly_inserted
};
self.update_secondary_indexes(pubkey, slot, account_owner, account_data, account_indexes);
is_newly_inserted
}
pub fn remove_zero_lamport_key(&self, pubkey: &Pubkey) {
self.zero_lamport_pubkeys.remove(pubkey);
}
pub fn zero_lamport_pubkeys(&self) -> &DashSet<Pubkey> {
&self.zero_lamport_pubkeys
}
pub fn unref_from_storage(&self, pubkey: &Pubkey) {
if let Some(locked_entry) = self.get_account_read_entry(pubkey) {
locked_entry.unref();
}
}
pub fn ref_count_from_storage(&self, pubkey: &Pubkey) -> RefCount {
if let Some(locked_entry) = self.get_account_read_entry(pubkey) {
locked_entry.ref_count().load(Ordering::Relaxed)
} else {
0
}
}
fn purge_secondary_indexes_by_inner_key<'a, C>(
&'a self,
inner_key: &Pubkey,
slots_to_remove: Option<&'a C>,
account_indexes: &HashSet<AccountIndex>,
) where
C: Contains<'a, Slot>,
{
if account_indexes.contains(&AccountIndex::ProgramId) {
self.program_id_index
.remove_by_inner_key(inner_key, slots_to_remove);
}
if account_indexes.contains(&AccountIndex::SplTokenOwner) {
self.spl_token_owner_index
.remove_by_inner_key(inner_key, slots_to_remove);
}
if account_indexes.contains(&AccountIndex::SplTokenMint) {
self.spl_token_mint_index
.remove_by_inner_key(inner_key, slots_to_remove);
}
}
fn purge_older_root_entries(
&self,
pubkey: &Pubkey,
slot_list: &mut SlotList<T>,
reclaims: &mut SlotList<T>,
max_clean_root: Option<Slot>,
account_indexes: &HashSet<AccountIndex>,
) {
let roots_tracker = &self.roots_tracker.read().unwrap();
let newest_root_in_slot_list =
Self::get_newest_root_in_slot_list(&roots_tracker.roots, &slot_list, max_clean_root);
let max_clean_root = max_clean_root.unwrap_or(roots_tracker.max_root);
let mut purged_slots: HashSet<Slot> = HashSet::new();
slot_list.retain(|(slot, value)| {
let should_purge =
Self::can_purge_older_entries(max_clean_root, newest_root_in_slot_list, *slot)
&& !value.is_cached();
if should_purge {
reclaims.push((*slot, value.clone()));
purged_slots.insert(*slot);
}
!should_purge
});
self.purge_secondary_indexes_by_inner_key(pubkey, Some(&purged_slots), account_indexes);
}
pub fn clean_rooted_entries(
&self,
pubkey: &Pubkey,
reclaims: &mut SlotList<T>,
max_clean_root: Option<Slot>,
account_indexes: &HashSet<AccountIndex>,
) {
let mut is_slot_list_empty = false;
if let Some(mut locked_entry) = self.get_account_write_entry(pubkey) {
locked_entry.slot_list_mut(|slot_list| {
self.purge_older_root_entries(
pubkey,
slot_list,
reclaims,
max_clean_root,
account_indexes,
);
is_slot_list_empty = slot_list.is_empty();
});
}
// If the slot list is empty, remove the pubkey from `account_maps`. Make sure to grab the
// lock and double check the slot list is still empty, because another writer could have
// locked and inserted the pubkey inbetween when `is_slot_list_empty=true` and the call to
// remove() below.
if is_slot_list_empty {
let mut w_maps = self.account_maps.write().unwrap();
if let Some(x) = w_maps.get(pubkey) {
if x.slot_list.read().unwrap().is_empty() {
w_maps.remove(pubkey);
}
}
}
}
/// When can an entry be purged?
///
/// If we get a slot update where slot != newest_root_in_slot_list for an account where slot <
/// max_clean_root, then we know it's safe to delete because:
///
/// a) If slot < newest_root_in_slot_list, then we know the update is outdated by a later rooted
/// update, namely the one in newest_root_in_slot_list
///
/// b) If slot > newest_root_in_slot_list, then because slot < max_clean_root and we know there are
/// no roots in the slot list between newest_root_in_slot_list and max_clean_root, (otherwise there
/// would be a bigger newest_root_in_slot_list, which is a contradiction), then we know slot must be
/// an unrooted slot less than max_clean_root and thus safe to clean as well.
fn can_purge_older_entries(
max_clean_root: Slot,
newest_root_in_slot_list: Slot,
slot: Slot,
) -> bool {
slot < max_clean_root && slot != newest_root_in_slot_list
}
pub fn is_root(&self, slot: Slot) -> bool {
self.roots_tracker.read().unwrap().roots.contains(&slot)
}
pub fn add_root(&self, slot: Slot, caching_enabled: bool) {
let mut w_roots_tracker = self.roots_tracker.write().unwrap();
w_roots_tracker.roots.insert(slot);
// we delay cleaning until flushing!
if !caching_enabled {
w_roots_tracker.uncleaned_roots.insert(slot);
}
// `AccountsDb::flush_accounts_cache()` relies on roots being added in order
assert!(slot >= w_roots_tracker.max_root);
w_roots_tracker.max_root = slot;
}
pub fn add_uncleaned_roots<I>(&self, roots: I)
where
I: IntoIterator<Item = Slot>,
{
let mut w_roots_tracker = self.roots_tracker.write().unwrap();
w_roots_tracker.uncleaned_roots.extend(roots);
}
pub fn max_root(&self) -> Slot {
self.roots_tracker.read().unwrap().max_root
}
/// Remove the slot when the storage for the slot is freed
/// Accounts no longer reference this slot.
pub fn clean_dead_slot(&self, slot: Slot) -> Option<AccountsIndexRootsStats> {
let (roots_len, uncleaned_roots_len, previous_uncleaned_roots_len, roots_range) = {
let mut w_roots_tracker = self.roots_tracker.write().unwrap();
let removed_from_unclean_roots = w_roots_tracker.uncleaned_roots.remove(&slot);
let removed_from_previous_uncleaned_roots =
w_roots_tracker.previous_uncleaned_roots.remove(&slot);
if !w_roots_tracker.roots.remove(&slot) {
if removed_from_unclean_roots {
error!("clean_dead_slot-removed_from_unclean_roots: {}", slot);
inc_new_counter_error!("clean_dead_slot-removed_from_unclean_roots", 1, 1);
}
if removed_from_previous_uncleaned_roots {
error!(
"clean_dead_slot-removed_from_previous_uncleaned_roots: {}",
slot
);
inc_new_counter_error!(
"clean_dead_slot-removed_from_previous_uncleaned_roots",
1,
1
);
}
return None;
}
(
w_roots_tracker.roots.len(),
w_roots_tracker.uncleaned_roots.len(),
w_roots_tracker.previous_uncleaned_roots.len(),
w_roots_tracker.roots.range_width(),
)
};
Some(AccountsIndexRootsStats {
roots_len,
uncleaned_roots_len,
previous_uncleaned_roots_len,
roots_range,
rooted_cleaned_count: 0,
unrooted_cleaned_count: 0,
})
}
pub fn reset_uncleaned_roots(&self, max_clean_root: Option<Slot>) -> HashSet<Slot> {
let mut cleaned_roots = HashSet::new();
let mut w_roots_tracker = self.roots_tracker.write().unwrap();
w_roots_tracker.uncleaned_roots.retain(|root| {
let is_cleaned = max_clean_root
.map(|max_clean_root| *root <= max_clean_root)
.unwrap_or(true);
if is_cleaned {
cleaned_roots.insert(*root);
}
// Only keep the slots that have yet to be cleaned
!is_cleaned
});
std::mem::replace(&mut w_roots_tracker.previous_uncleaned_roots, cleaned_roots)
}
#[cfg(test)]
pub fn clear_uncleaned_roots(&self, max_clean_root: Option<Slot>) -> HashSet<Slot> {
let mut cleaned_roots = HashSet::new();
let mut w_roots_tracker = self.roots_tracker.write().unwrap();
w_roots_tracker.uncleaned_roots.retain(|root| {
let is_cleaned = max_clean_root
.map(|max_clean_root| *root <= max_clean_root)
.unwrap_or(true);
if is_cleaned {
cleaned_roots.insert(*root);
}
// Only keep the slots that have yet to be cleaned
!is_cleaned
});
cleaned_roots
}
pub fn is_uncleaned_root(&self, slot: Slot) -> bool {
self.roots_tracker
.read()
.unwrap()
.uncleaned_roots
.contains(&slot)
}
pub fn num_roots(&self) -> usize {
self.roots_tracker.read().unwrap().roots.len()
}
pub fn all_roots(&self) -> Vec<Slot> {
let tracker = self.roots_tracker.read().unwrap();
tracker.roots.get_all()
}
#[cfg(test)]
pub fn clear_roots(&self) {
self.roots_tracker.write().unwrap().roots.clear()
}
#[cfg(test)]
pub fn uncleaned_roots_len(&self) -> usize {
self.roots_tracker.read().unwrap().uncleaned_roots.len()
}
#[cfg(test)]
// filter any rooted entries and return them along with a bool that indicates
// if this account has no more entries. Note this does not update the secondary
// indexes!
pub fn purge_roots(&self, pubkey: &Pubkey) -> (SlotList<T>, bool) {
let mut write_account_map_entry = self.get_account_write_entry(pubkey).unwrap();
write_account_map_entry.slot_list_mut(|slot_list| {
let reclaims = self.get_rooted_entries(slot_list, None);
slot_list.retain(|(slot, _)| !self.is_root(*slot));
(reclaims, slot_list.is_empty())
})
}
}
#[cfg(test)]
pub mod tests {
use super::*;
use solana_sdk::signature::{Keypair, Signer};
pub enum SecondaryIndexTypes<'a> {
RwLock(&'a SecondaryIndex<RwLockSecondaryIndexEntry>),
DashMap(&'a SecondaryIndex<DashMapSecondaryIndexEntry>),
}
pub fn spl_token_mint_index_enabled() -> HashSet<AccountIndex> {
let mut account_indexes = HashSet::new();
account_indexes.insert(AccountIndex::SplTokenMint);
account_indexes
}
pub fn spl_token_owner_index_enabled() -> HashSet<AccountIndex> {
let mut account_indexes = HashSet::new();
account_indexes.insert(AccountIndex::SplTokenOwner);
account_indexes
}
impl<'a, T: 'static, U> AccountIndexGetResult<'a, T, U> {
pub fn unwrap(self) -> (ReadAccountMapEntry<T>, usize) {
match self {
AccountIndexGetResult::Found(lock, size) => (lock, size),
_ => {
panic!("trying to unwrap AccountIndexGetResult with non-Success result");
}
}
}
pub fn is_none(&self) -> bool {
!self.is_some()
}
pub fn is_some(&self) -> bool {
matches!(self, AccountIndexGetResult::Found(_lock, _size))
}
pub fn map<V, F: FnOnce((ReadAccountMapEntry<T>, usize)) -> V>(self, f: F) -> Option<V> {
match self {
AccountIndexGetResult::Found(lock, size) => Some(f((lock, size))),
_ => None,
}
}
}
fn create_dashmap_secondary_index_state() -> (usize, usize, HashSet<AccountIndex>) {
{
// Check that we're actually testing the correct variant
let index = AccountsIndex::<bool>::default();
let _type_check = SecondaryIndexTypes::DashMap(&index.spl_token_mint_index);
}
(0, PUBKEY_BYTES, spl_token_mint_index_enabled())
}
fn create_rwlock_secondary_index_state() -> (usize, usize, HashSet<AccountIndex>) {
{
// Check that we're actually testing the correct variant
let index = AccountsIndex::<bool>::default();
let _type_check = SecondaryIndexTypes::RwLock(&index.spl_token_owner_index);
}
(
SPL_TOKEN_ACCOUNT_OWNER_OFFSET,
SPL_TOKEN_ACCOUNT_OWNER_OFFSET + PUBKEY_BYTES,
spl_token_owner_index_enabled(),
)
}
#[test]
fn test_bitfield_permutations() {
solana_logger::setup();
let mut bitfield = RollingBitField::new(2097152);
let mut hash = HashSet::new();
let min = 101_000;
let width = 400_000;
let dead = 19;
let mut slot = min;
while hash.len() < width {
slot += 1;
if slot % dead == 0 {
continue;
}
hash.insert(slot);
bitfield.insert(slot);
}
compare(&hash, &bitfield);
let max = slot + 1;
let mut time = Measure::start("");
let mut count = 0;
for slot in (min - 10)..max + 100 {
if hash.contains(&slot) {
count += 1;
}
}
time.stop();
let mut time2 = Measure::start("");
let mut count2 = 0;
for slot in (min - 10)..max + 100 {
if bitfield.contains(&slot) {
count2 += 1;
}
}
time2.stop();
info!(
"{}ms, {}ms, {} ratio",
time.as_ms(),
time2.as_ms(),
time.as_ns() / time2.as_ns()
);
assert_eq!(count, count2);
}
#[test]
#[should_panic(expected = "assertion failed: max_width.is_power_of_two()")]
fn test_bitfield_power_2() {
let _ = RollingBitField::new(3);
}
#[test]
#[should_panic(expected = "assertion failed: max_width > 0")]
fn test_bitfield_0() {
let _ = RollingBitField::new(0);
}
fn setup_empty(width: u64) -> RollingBitFieldTester {
let bitfield = RollingBitField::new(width);
let hash_set = HashSet::new();
RollingBitFieldTester { bitfield, hash_set }
}
struct RollingBitFieldTester {
pub bitfield: RollingBitField,
pub hash_set: HashSet<u64>,
}
impl RollingBitFieldTester {
fn insert(&mut self, slot: u64) {
self.bitfield.insert(slot);
self.hash_set.insert(slot);
assert!(self.bitfield.contains(&slot));
compare(&self.hash_set, &self.bitfield);
}
fn remove(&mut self, slot: &u64) -> bool {
let result = self.bitfield.remove(slot);
assert_eq!(result, self.hash_set.remove(slot));
assert!(!self.bitfield.contains(&slot));
self.compare();
result
}
fn compare(&self) {
compare(&self.hash_set, &self.bitfield);
}
}
fn setup_wide(width: u64, start: u64) -> RollingBitFieldTester {
let mut tester = setup_empty(width);
tester.compare();
tester.insert(start);
tester.insert(start + 1);
tester
}
#[test]
fn test_bitfield_insert_wide() {
solana_logger::setup();
let width = 16;
let start = 0;
let mut tester = setup_wide(width, start);
let slot = start + width;
let all = tester.bitfield.get_all();
// higher than max range by 1
tester.insert(slot);
let bitfield = tester.bitfield;
for slot in all {
assert!(bitfield.contains(&slot));
}
assert_eq!(bitfield.excess.len(), 1);
assert_eq!(bitfield.count, 3);
}
#[test]
fn test_bitfield_insert_wide_before() {
solana_logger::setup();
let width = 16;
let start = 100;
let mut bitfield = setup_wide(width, start).bitfield;
let slot = start + 1 - width;
// assert here - would make min too low, causing too wide of a range
bitfield.insert(slot);
assert_eq!(1, bitfield.excess.len());
assert_eq!(3, bitfield.count);
assert!(bitfield.contains(&slot));
}
#[test]
fn test_bitfield_insert_wide_before_ok() {
solana_logger::setup();
let width = 16;
let start = 100;
let mut bitfield = setup_wide(width, start).bitfield;
let slot = start + 2 - width; // this item would make our width exactly equal to what is allowed, but it is also inserting prior to min
bitfield.insert(slot);
assert_eq!(1, bitfield.excess.len());
assert!(bitfield.contains(&slot));
assert_eq!(3, bitfield.count);
}
#[test]
fn test_bitfield_contains_wide_no_assert() {
{
let width = 16;
let start = 0;
let bitfield = setup_wide(width, start).bitfield;
let mut slot = width;
assert!(!bitfield.contains(&slot));
slot += 1;
assert!(!bitfield.contains(&slot));
}
{
let width = 16;
let start = 100;
let bitfield = setup_wide(width, start).bitfield;
// too large
let mut slot = width;
assert!(!bitfield.contains(&slot));
slot += 1;
assert!(!bitfield.contains(&slot));
// too small, before min
slot = 0;
assert!(!bitfield.contains(&slot));
}
}
#[test]
fn test_bitfield_remove_wide() {
let width = 16;
let start = 0;
let mut tester = setup_wide(width, start);
let slot = width;
assert!(!tester.remove(&slot));
}
#[test]
fn test_bitfield_excess2() {
solana_logger::setup();
let width = 16;
let mut tester = setup_empty(width);
let slot = 100;
// insert 1st slot
tester.insert(slot);
assert!(tester.bitfield.excess.is_empty());
// insert a slot before the previous one. this is 'excess' since we don't use this pattern in normal operation
let slot2 = slot - 1;
tester.insert(slot2);
assert_eq!(tester.bitfield.excess.len(), 1);
// remove the 1st slot. we will be left with only excess
tester.remove(&slot);
assert!(tester.bitfield.contains(&slot2));
assert_eq!(tester.bitfield.excess.len(), 1);
// re-insert at valid range, making sure we don't insert into excess
tester.insert(slot);
assert_eq!(tester.bitfield.excess.len(), 1);
// remove the excess slot.
tester.remove(&slot2);
assert!(tester.bitfield.contains(&slot));
assert!(tester.bitfield.excess.is_empty());
// re-insert the excess slot
tester.insert(slot2);
assert_eq!(tester.bitfield.excess.len(), 1);
}
#[test]
fn test_bitfield_excess() {
solana_logger::setup();
// start at slot 0 or a separate, higher slot
for width in [16, 4194304].iter() {
let width = *width;
let mut tester = setup_empty(width);
for start in [0, width * 5].iter().cloned() {
// recreate means create empty bitfield with each iteration, otherwise re-use
for recreate in [false, true].iter().cloned() {
let max = start + 3;
// first root to add
for slot in start..max {
// subsequent roots to add
for slot2 in (slot + 1)..max {
// reverse_slots = 1 means add slots in reverse order (max to min). This causes us to add second and later slots to excess.
for reverse_slots in [false, true].iter().cloned() {
let maybe_reverse = |slot| {
if reverse_slots {
max - slot
} else {
slot
}
};
if recreate {
let recreated = setup_empty(width);
tester = recreated;
}
// insert
for slot in slot..=slot2 {
let slot_use = maybe_reverse(slot);
tester.insert(slot_use);
debug!(
"slot: {}, bitfield: {:?}, reverse: {}, len: {}, excess: {:?}",
slot_use,
tester.bitfield,
reverse_slots,
tester.bitfield.len(),
tester.bitfield.excess
);
assert!(
(reverse_slots && tester.bitfield.len() > 1)
^ tester.bitfield.excess.is_empty()
);
}
if start > width * 2 {
assert!(!tester.bitfield.contains(&(start - width * 2)));
}
assert!(!tester.bitfield.contains(&(start + width * 2)));
let len = (slot2 - slot + 1) as usize;
assert_eq!(tester.bitfield.len(), len);
assert_eq!(tester.bitfield.count, len);
// remove
for slot in slot..=slot2 {
let slot_use = maybe_reverse(slot);
assert!(tester.remove(&slot_use));
assert!(
(reverse_slots && !tester.bitfield.is_empty())
^ tester.bitfield.excess.is_empty()
);
}
assert!(tester.bitfield.is_empty());
assert_eq!(tester.bitfield.count, 0);
if start > width * 2 {
assert!(!tester.bitfield.contains(&(start - width * 2)));
}
assert!(!tester.bitfield.contains(&(start + width * 2)));
}
}
}
}
}
}
}
#[test]
fn test_bitfield_remove_wide_before() {
let width = 16;
let start = 100;
let mut tester = setup_wide(width, start);
let slot = start + 1 - width;
assert!(!tester.remove(&slot));
}
fn compare(hashset: &HashSet<u64>, bitfield: &RollingBitField) {
assert_eq!(hashset.len(), bitfield.len());
assert_eq!(hashset.is_empty(), bitfield.is_empty());
if !bitfield.is_empty() {
let mut min = Slot::MAX;
let mut max = Slot::MIN;
for item in bitfield.get_all() {
assert!(hashset.contains(&item));
if !bitfield.excess.contains(&item) {
min = std::cmp::min(min, item);
max = std::cmp::max(max, item);
}
}
assert_eq!(bitfield.get_all().len(), hashset.len());
// range isn't tracked for excess items
if bitfield.excess.len() != bitfield.len() {
let width = if bitfield.is_empty() {
0
} else {
max + 1 - min
};
assert!(
bitfield.range_width() >= width,
"hashset: {:?}, bitfield: {:?}, bitfield.range_width: {}, width: {}",
hashset,
bitfield.get_all(),
bitfield.range_width(),
width,
);
}
}
}
#[test]
fn test_bitfield_functionality() {
solana_logger::setup();
// bitfield sizes are powers of 2, cycle through values of 1, 2, 4, .. 2^9
for power in 0..10 {
let max_bitfield_width = 2u64.pow(power) as u64;
let width_iteration_max = if max_bitfield_width > 1 {
// add up to 2 items so we can test out multiple items
3
} else {
// 0 or 1 items is all we can fit with a width of 1 item
2
};
for width in 0..width_iteration_max {
let mut tester = setup_empty(max_bitfield_width);
let min = 101_000;
let dead = 19;
let mut slot = min;
while tester.hash_set.len() < width {
slot += 1;
if max_bitfield_width > 2 && slot % dead == 0 {
// with max_bitfield_width of 1 and 2, there is no room for dead slots
continue;
}
tester.insert(slot);
}
let max = slot + 1;
for slot in (min - 10)..max + 100 {
assert_eq!(
tester.bitfield.contains(&slot),
tester.hash_set.contains(&slot)
);
}
if width > 0 {
assert!(tester.remove(&slot));
assert!(!tester.remove(&slot));
}
let all = tester.bitfield.get_all();
// remove the rest, including a call that removes slot again
for item in all.iter() {
assert!(tester.remove(&item));
assert!(!tester.remove(&item));
}
let min = max + ((width * 2) as u64) + 3;
let slot = min; // several widths past previous min
let max = slot + 1;
tester.insert(slot);
for slot in (min - 10)..max + 100 {
assert_eq!(
tester.bitfield.contains(&slot),
tester.hash_set.contains(&slot)
);
}
}
}
}
fn bitfield_insert_and_test(bitfield: &mut RollingBitField, slot: Slot) {
let len = bitfield.len();
let old_all = bitfield.get_all();
let (new_min, new_max) = if bitfield.is_empty() {
(slot, slot + 1)
} else {
(
std::cmp::min(bitfield.min, slot),
std::cmp::max(bitfield.max, slot + 1),
)
};
bitfield.insert(slot);
assert_eq!(bitfield.min, new_min);
assert_eq!(bitfield.max, new_max);
assert_eq!(bitfield.len(), len + 1);
assert!(!bitfield.is_empty());
assert!(bitfield.contains(&slot));
// verify aliasing is what we expect
assert!(bitfield.contains_assume_in_range(&(slot + bitfield.max_width)));
let get_all = bitfield.get_all();
old_all
.into_iter()
.for_each(|slot| assert!(get_all.contains(&slot)));
assert!(get_all.contains(&slot));
assert!(get_all.len() == len + 1);
}
#[test]
fn test_bitfield_clear() {
let mut bitfield = RollingBitField::new(4);
assert_eq!(bitfield.len(), 0);
assert!(bitfield.is_empty());
bitfield_insert_and_test(&mut bitfield, 0);
bitfield.clear();
assert_eq!(bitfield.len(), 0);
assert!(bitfield.is_empty());
assert!(bitfield.get_all().is_empty());
bitfield_insert_and_test(&mut bitfield, 1);
bitfield.clear();
assert_eq!(bitfield.len(), 0);
assert!(bitfield.is_empty());
assert!(bitfield.get_all().is_empty());
bitfield_insert_and_test(&mut bitfield, 4);
}
#[test]
fn test_bitfield_wrapping() {
let mut bitfield = RollingBitField::new(4);
assert_eq!(bitfield.len(), 0);
assert!(bitfield.is_empty());
bitfield_insert_and_test(&mut bitfield, 0);
assert_eq!(bitfield.get_all(), vec![0]);
bitfield_insert_and_test(&mut bitfield, 2);
assert_eq!(bitfield.get_all(), vec![0, 2]);
bitfield_insert_and_test(&mut bitfield, 3);
bitfield.insert(3); // redundant insert
assert_eq!(bitfield.get_all(), vec![0, 2, 3]);
assert!(bitfield.remove(&0));
assert!(!bitfield.remove(&0));
assert_eq!(bitfield.min, 2);
assert_eq!(bitfield.max, 4);
assert_eq!(bitfield.len(), 2);
assert!(!bitfield.remove(&0)); // redundant remove
assert_eq!(bitfield.len(), 2);
assert_eq!(bitfield.get_all(), vec![2, 3]);
bitfield.insert(4); // wrapped around value - same bit as '0'
assert_eq!(bitfield.min, 2);
assert_eq!(bitfield.max, 5);
assert_eq!(bitfield.len(), 3);
assert_eq!(bitfield.get_all(), vec![2, 3, 4]);
assert!(bitfield.remove(&2));
assert_eq!(bitfield.min, 3);
assert_eq!(bitfield.max, 5);
assert_eq!(bitfield.len(), 2);
assert_eq!(bitfield.get_all(), vec![3, 4]);
assert!(bitfield.remove(&3));
assert_eq!(bitfield.min, 4);
assert_eq!(bitfield.max, 5);
assert_eq!(bitfield.len(), 1);
assert_eq!(bitfield.get_all(), vec![4]);
assert!(bitfield.remove(&4));
assert_eq!(bitfield.len(), 0);
assert!(bitfield.is_empty());
assert!(bitfield.get_all().is_empty());
bitfield_insert_and_test(&mut bitfield, 8);
assert!(bitfield.remove(&8));
assert_eq!(bitfield.len(), 0);
assert!(bitfield.is_empty());
assert!(bitfield.get_all().is_empty());
bitfield_insert_and_test(&mut bitfield, 9);
assert!(bitfield.remove(&9));
assert_eq!(bitfield.len(), 0);
assert!(bitfield.is_empty());
assert!(bitfield.get_all().is_empty());
}
#[test]
fn test_bitfield_smaller() {
// smaller bitfield, fewer entries, including 0
solana_logger::setup();
for width in 0..34 {
let mut bitfield = RollingBitField::new(4096);
let mut hash_set = HashSet::new();
let min = 1_010_000;
let dead = 19;
let mut slot = min;
while hash_set.len() < width {
slot += 1;
if slot % dead == 0 {
continue;
}
hash_set.insert(slot);
bitfield.insert(slot);
}
let max = slot + 1;
let mut time = Measure::start("");
let mut count = 0;
for slot in (min - 10)..max + 100 {
if hash_set.contains(&slot) {
count += 1;
}
}
time.stop();
let mut time2 = Measure::start("");
let mut count2 = 0;
for slot in (min - 10)..max + 100 {
if bitfield.contains(&slot) {
count2 += 1;
}
}
time2.stop();
info!(
"{}, {}, {}",
time.as_ms(),
time2.as_ms(),
time.as_ns() / time2.as_ns()
);
assert_eq!(count, count2);
}
}
#[test]
fn test_get_empty() {
let key = Keypair::new();
let index = AccountsIndex::<bool>::default();
let ancestors = Ancestors::default();
assert!(index.get(&key.pubkey(), Some(&ancestors), None).is_none());
assert!(index.get(&key.pubkey(), None, None).is_none());
let mut num = 0;
index.unchecked_scan_accounts("", &ancestors, |_pubkey, _index| num += 1);
assert_eq!(num, 0);
}
#[test]
fn test_insert_no_ancestors() {
let key = Keypair::new();
let index = AccountsIndex::<bool>::default();
let mut gc = Vec::new();
index.upsert(
0,
&key.pubkey(),
&Pubkey::default(),
&[],
&HashSet::new(),
true,
&mut gc,
);
assert!(gc.is_empty());
let ancestors = Ancestors::default();
assert!(index.get(&key.pubkey(), Some(&ancestors), None).is_none());
assert!(index.get(&key.pubkey(), None, None).is_none());
let mut num = 0;
index.unchecked_scan_accounts("", &ancestors, |_pubkey, _index| num += 1);
assert_eq!(num, 0);
}
#[test]
fn test_insert_wrong_ancestors() {
let key = Keypair::new();
let index = AccountsIndex::<bool>::default();
let mut gc = Vec::new();
index.upsert(
0,
&key.pubkey(),
&Pubkey::default(),
&[],
&HashSet::new(),
true,
&mut gc,
);
assert!(gc.is_empty());
let ancestors = vec![(1, 1)].into_iter().collect();
assert!(index.get(&key.pubkey(), Some(&ancestors), None).is_none());
let mut num = 0;
index.unchecked_scan_accounts("", &ancestors, |_pubkey, _index| num += 1);
assert_eq!(num, 0);
}
#[test]
fn test_insert_with_ancestors() {
let key = Keypair::new();
let index = AccountsIndex::<bool>::default();
let mut gc = Vec::new();
index.upsert(
0,
&key.pubkey(),
&Pubkey::default(),
&[],
&HashSet::new(),
true,
&mut gc,
);
assert!(gc.is_empty());
let ancestors = vec![(0, 0)].into_iter().collect();
let (list, idx) = index.get(&key.pubkey(), Some(&ancestors), None).unwrap();
assert_eq!(list.slot_list()[idx], (0, true));
let mut num = 0;
let mut found_key = false;
index.unchecked_scan_accounts("", &ancestors, |pubkey, _index| {
if pubkey == &key.pubkey() {
found_key = true
};
num += 1
});
assert_eq!(num, 1);
assert!(found_key);
}
fn setup_accounts_index_keys(num_pubkeys: usize) -> (AccountsIndex<bool>, Vec<Pubkey>) {
let index = AccountsIndex::<bool>::default();
let root_slot = 0;
let mut pubkeys: Vec<Pubkey> = std::iter::repeat_with(|| {
let new_pubkey = solana_sdk::pubkey::new_rand();
index.upsert(
root_slot,
&new_pubkey,
&Pubkey::default(),
&[],
&HashSet::new(),
true,
&mut vec![],
);
new_pubkey
})
.take(num_pubkeys.saturating_sub(1))
.collect();
if num_pubkeys != 0 {
pubkeys.push(Pubkey::default());
index.upsert(
root_slot,
&Pubkey::default(),
&Pubkey::default(),
&[],
&HashSet::new(),
true,
&mut vec![],
);
}
index.add_root(root_slot, false);
(index, pubkeys)
}
fn run_test_range(
index: &AccountsIndex<bool>,
pubkeys: &[Pubkey],
start_bound: Bound<usize>,
end_bound: Bound<usize>,
) {
// Exclusive `index_start`
let (pubkey_start, index_start) = match start_bound {
Unbounded => (Unbounded, 0),
Included(i) => (Included(pubkeys[i]), i),
Excluded(i) => (Excluded(pubkeys[i]), i + 1),
};
// Exclusive `index_end`
let (pubkey_end, index_end) = match end_bound {
Unbounded => (Unbounded, pubkeys.len()),
Included(i) => (Included(pubkeys[i]), i + 1),
Excluded(i) => (Excluded(pubkeys[i]), i),
};
let pubkey_range = (pubkey_start, pubkey_end);
let ancestors = Ancestors::default();
let mut scanned_keys = HashSet::new();
index.range_scan_accounts("", &ancestors, pubkey_range, |pubkey, _index| {
scanned_keys.insert(*pubkey);
});
let mut expected_len = 0;
for key in &pubkeys[index_start..index_end] {
expected_len += 1;
assert!(scanned_keys.contains(key));
}
assert_eq!(scanned_keys.len(), expected_len);
}
fn run_test_range_indexes(
index: &AccountsIndex<bool>,
pubkeys: &[Pubkey],
start: Option<usize>,
end: Option<usize>,
) {
let start_options = start
.map(|i| vec![Included(i), Excluded(i)])
.unwrap_or_else(|| vec![Unbounded]);
let end_options = end
.map(|i| vec![Included(i), Excluded(i)])
.unwrap_or_else(|| vec![Unbounded]);
for start in &start_options {
for end in &end_options {
run_test_range(index, pubkeys, *start, *end);
}
}
}
#[test]
fn test_range_scan_accounts() {
let (index, mut pubkeys) = setup_accounts_index_keys(3 * ITER_BATCH_SIZE);
pubkeys.sort();
run_test_range_indexes(&index, &pubkeys, None, None);
run_test_range_indexes(&index, &pubkeys, Some(ITER_BATCH_SIZE), None);
run_test_range_indexes(&index, &pubkeys, None, Some(2 * ITER_BATCH_SIZE as usize));
run_test_range_indexes(
&index,
&pubkeys,
Some(ITER_BATCH_SIZE as usize),
Some(2 * ITER_BATCH_SIZE as usize),
);
run_test_range_indexes(
&index,
&pubkeys,
Some(ITER_BATCH_SIZE as usize),
Some(2 * ITER_BATCH_SIZE as usize - 1),
);
run_test_range_indexes(
&index,
&pubkeys,
Some(ITER_BATCH_SIZE - 1_usize),
Some(2 * ITER_BATCH_SIZE as usize + 1),
);
}
fn run_test_scan_accounts(num_pubkeys: usize) {
let (index, _) = setup_accounts_index_keys(num_pubkeys);
let ancestors = Ancestors::default();
let mut scanned_keys = HashSet::new();
index.unchecked_scan_accounts("", &ancestors, |pubkey, _index| {
scanned_keys.insert(*pubkey);
});
assert_eq!(scanned_keys.len(), num_pubkeys);
}
#[test]
fn test_scan_accounts() {
run_test_scan_accounts(0);
run_test_scan_accounts(1);
run_test_scan_accounts(ITER_BATCH_SIZE * 10);
run_test_scan_accounts(ITER_BATCH_SIZE * 10 - 1);
run_test_scan_accounts(ITER_BATCH_SIZE * 10 + 1);
}
#[test]
fn test_accounts_iter_finished() {
let (index, _) = setup_accounts_index_keys(0);
let mut iter = index.iter(None::<Range<Pubkey>>);
assert!(iter.next().is_none());
let mut gc = vec![];
index.upsert(
0,
&solana_sdk::pubkey::new_rand(),
&Pubkey::default(),
&[],
&HashSet::new(),
true,
&mut gc,
);
assert!(iter.next().is_none());
}
#[test]
fn test_is_root() {
let index = AccountsIndex::<bool>::default();
assert!(!index.is_root(0));
index.add_root(0, false);
assert!(index.is_root(0));
}
#[test]
fn test_insert_with_root() {
let key = Keypair::new();
let index = AccountsIndex::<bool>::default();
let mut gc = Vec::new();
index.upsert(
0,
&key.pubkey(),
&Pubkey::default(),
&[],
&HashSet::new(),
true,
&mut gc,
);
assert!(gc.is_empty());
index.add_root(0, false);
let (list, idx) = index.get(&key.pubkey(), None, None).unwrap();
assert_eq!(list.slot_list()[idx], (0, true));
}
#[test]
fn test_clean_first() {
let index = AccountsIndex::<bool>::default();
index.add_root(0, false);
index.add_root(1, false);
index.clean_dead_slot(0);
assert!(index.is_root(1));
assert!(!index.is_root(0));
}
#[test]
fn test_clean_last() {
//this behavior might be undefined, clean up should only occur on older slots
let index = AccountsIndex::<bool>::default();
index.add_root(0, false);
index.add_root(1, false);
index.clean_dead_slot(1);
assert!(!index.is_root(1));
assert!(index.is_root(0));
}
#[test]
fn test_clean_and_unclean_slot() {
let index = AccountsIndex::<bool>::default();
assert_eq!(0, index.roots_tracker.read().unwrap().uncleaned_roots.len());
index.add_root(0, false);
index.add_root(1, false);
assert_eq!(2, index.roots_tracker.read().unwrap().uncleaned_roots.len());
assert_eq!(
0,
index
.roots_tracker
.read()
.unwrap()
.previous_uncleaned_roots
.len()
);
index.reset_uncleaned_roots(None);
assert_eq!(2, index.roots_tracker.read().unwrap().roots.len());
assert_eq!(0, index.roots_tracker.read().unwrap().uncleaned_roots.len());
assert_eq!(
2,
index
.roots_tracker
.read()
.unwrap()
.previous_uncleaned_roots
.len()
);
index.add_root(2, false);
index.add_root(3, false);
assert_eq!(4, index.roots_tracker.read().unwrap().roots.len());
assert_eq!(2, index.roots_tracker.read().unwrap().uncleaned_roots.len());
assert_eq!(
2,
index
.roots_tracker
.read()
.unwrap()
.previous_uncleaned_roots
.len()
);
index.clean_dead_slot(1);
assert_eq!(3, index.roots_tracker.read().unwrap().roots.len());
assert_eq!(2, index.roots_tracker.read().unwrap().uncleaned_roots.len());
assert_eq!(
1,
index
.roots_tracker
.read()
.unwrap()
.previous_uncleaned_roots
.len()
);
index.clean_dead_slot(2);
assert_eq!(2, index.roots_tracker.read().unwrap().roots.len());
assert_eq!(1, index.roots_tracker.read().unwrap().uncleaned_roots.len());
assert_eq!(
1,
index
.roots_tracker
.read()
.unwrap()
.previous_uncleaned_roots
.len()
);
}
#[test]
fn test_update_last_wins() {
let key = Keypair::new();
let index = AccountsIndex::<bool>::default();
let ancestors = vec![(0, 0)].into_iter().collect();
let mut gc = Vec::new();
index.upsert(
0,
&key.pubkey(),
&Pubkey::default(),
&[],
&HashSet::new(),
true,
&mut gc,
);
assert!(gc.is_empty());
let (list, idx) = index.get(&key.pubkey(), Some(&ancestors), None).unwrap();
assert_eq!(list.slot_list()[idx], (0, true));
drop(list);
let mut gc = Vec::new();
index.upsert(
0,
&key.pubkey(),
&Pubkey::default(),
&[],
&HashSet::new(),
false,
&mut gc,
);
assert_eq!(gc, vec![(0, true)]);
let (list, idx) = index.get(&key.pubkey(), Some(&ancestors), None).unwrap();
assert_eq!(list.slot_list()[idx], (0, false));
}
#[test]
fn test_update_new_slot() {
solana_logger::setup();
let key = Keypair::new();
let index = AccountsIndex::<bool>::default();
let ancestors = vec![(0, 0)].into_iter().collect();
let mut gc = Vec::new();
index.upsert(
0,
&key.pubkey(),
&Pubkey::default(),
&[],
&HashSet::new(),
true,
&mut gc,
);
assert!(gc.is_empty());
index.upsert(
1,
&key.pubkey(),
&Pubkey::default(),
&[],
&HashSet::new(),
false,
&mut gc,
);
assert!(gc.is_empty());
let (list, idx) = index.get(&key.pubkey(), Some(&ancestors), None).unwrap();
assert_eq!(list.slot_list()[idx], (0, true));
let ancestors = vec![(1, 0)].into_iter().collect();
let (list, idx) = index.get(&key.pubkey(), Some(&ancestors), None).unwrap();
assert_eq!(list.slot_list()[idx], (1, false));
}
#[test]
fn test_update_gc_purged_slot() {
let key = Keypair::new();
let index = AccountsIndex::<bool>::default();
let mut gc = Vec::new();
index.upsert(
0,
&key.pubkey(),
&Pubkey::default(),
&[],
&HashSet::new(),
true,
&mut gc,
);
assert!(gc.is_empty());
index.upsert(
1,
&key.pubkey(),
&Pubkey::default(),
&[],
&HashSet::new(),
false,
&mut gc,
);
index.upsert(
2,
&key.pubkey(),
&Pubkey::default(),
&[],
&HashSet::new(),
true,
&mut gc,
);
index.upsert(
3,
&key.pubkey(),
&Pubkey::default(),
&[],
&HashSet::new(),
true,
&mut gc,
);
index.add_root(0, false);
index.add_root(1, false);
index.add_root(3, false);
index.upsert(
4,
&key.pubkey(),
&Pubkey::default(),
&[],
&HashSet::new(),
true,
&mut gc,
);
// Updating index should not purge older roots, only purges
// previous updates within the same slot
assert_eq!(gc, vec![]);
let (list, idx) = index.get(&key.pubkey(), None, None).unwrap();
assert_eq!(list.slot_list()[idx], (3, true));
let mut num = 0;
let mut found_key = false;
index.unchecked_scan_accounts("", &Ancestors::default(), |pubkey, _index| {
if pubkey == &key.pubkey() {
found_key = true;
assert_eq!(_index, (&true, 3));
};
num += 1
});
assert_eq!(num, 1);
assert!(found_key);
}
#[test]
fn test_purge() {
let key = Keypair::new();
let index = AccountsIndex::<u64>::default();
let mut gc = Vec::new();
assert!(index.upsert(
1,
&key.pubkey(),
&Pubkey::default(),
&[],
&HashSet::new(),
12,
&mut gc
));
assert!(!index.upsert(
1,
&key.pubkey(),
&Pubkey::default(),
&[],
&HashSet::new(),
10,
&mut gc
));
let purges = index.purge_roots(&key.pubkey());
assert_eq!(purges, (vec![], false));
index.add_root(1, false);
let purges = index.purge_roots(&key.pubkey());
assert_eq!(purges, (vec![(1, 10)], true));
assert!(!index.upsert(
1,
&key.pubkey(),
&Pubkey::default(),
&[],
&HashSet::new(),
9,
&mut gc
));
}
#[test]
fn test_latest_slot() {
let slot_slice = vec![(0, true), (5, true), (3, true), (7, true)];
let index = AccountsIndex::<bool>::default();
// No ancestors, no root, should return None
assert!(index.latest_slot(None, &slot_slice, None).is_none());
// Given a root, should return the root
index.add_root(5, false);
assert_eq!(index.latest_slot(None, &slot_slice, None).unwrap(), 1);
// Given a max_root == root, should still return the root
assert_eq!(index.latest_slot(None, &slot_slice, Some(5)).unwrap(), 1);
// Given a max_root < root, should filter out the root
assert!(index.latest_slot(None, &slot_slice, Some(4)).is_none());
// Given a max_root, should filter out roots < max_root, but specified
// ancestors should not be affected
let ancestors = vec![(3, 1), (7, 1)].into_iter().collect();
assert_eq!(
index
.latest_slot(Some(&ancestors), &slot_slice, Some(4))
.unwrap(),
3
);
assert_eq!(
index
.latest_slot(Some(&ancestors), &slot_slice, Some(7))
.unwrap(),
3
);
// Given no max_root, should just return the greatest ancestor or root
assert_eq!(
index
.latest_slot(Some(&ancestors), &slot_slice, None)
.unwrap(),
3
);
}
fn run_test_purge_exact_secondary_index<
SecondaryIndexEntryType: SecondaryIndexEntry + Default + Sync + Send,
>(
index: &AccountsIndex<bool>,
secondary_index: &SecondaryIndex<SecondaryIndexEntryType>,
key_start: usize,
key_end: usize,
account_index: &HashSet<AccountIndex>,
) {
// No roots, should be no reclaims
let slots = vec![1, 2, 5, 9];
let index_key = Pubkey::new_unique();
let account_key = Pubkey::new_unique();
let mut account_data = vec![0; inline_spl_token_v2_0::state::Account::get_packed_len()];
account_data[key_start..key_end].clone_from_slice(&(index_key.to_bytes()));
// Insert slots into secondary index
for slot in &slots {
index.upsert(
*slot,
&account_key,
// Make sure these accounts are added to secondary index
&inline_spl_token_v2_0::id(),
&account_data,
account_index,
true,
&mut vec![],
);
}
// Only one top level index entry exists
assert_eq!(secondary_index.index.get(&index_key).unwrap().len(), 1);
// In the reverse index, one account maps across multiple slots
// to the same top level key
assert_eq!(
secondary_index
.reverse_index
.get(&account_key)
.unwrap()
.value()
.read()
.unwrap()
.len(),
slots.len()
);
index.purge_exact(
&account_key,
&slots.into_iter().collect::<HashSet<Slot>>(),
&mut vec![],
account_index,
);
assert!(secondary_index.index.is_empty());
assert!(secondary_index.reverse_index.is_empty());
}
#[test]
fn test_purge_exact_dashmap_secondary_index() {
let (key_start, key_end, account_index) = create_dashmap_secondary_index_state();
let index = AccountsIndex::<bool>::default();
run_test_purge_exact_secondary_index(
&index,
&index.spl_token_mint_index,
key_start,
key_end,
&account_index,
);
}
#[test]
fn test_purge_exact_rwlock_secondary_index() {
let (key_start, key_end, account_index) = create_rwlock_secondary_index_state();
let index = AccountsIndex::<bool>::default();
run_test_purge_exact_secondary_index(
&index,
&index.spl_token_owner_index,
key_start,
key_end,
&account_index,
);
}
#[test]
fn test_purge_older_root_entries() {
// No roots, should be no reclaims
let index = AccountsIndex::<bool>::default();
let mut slot_list = vec![(1, true), (2, true), (5, true), (9, true)];
let mut reclaims = vec![];
index.purge_older_root_entries(
&Pubkey::default(),
&mut slot_list,
&mut reclaims,
None,
&HashSet::new(),
);
assert!(reclaims.is_empty());
assert_eq!(slot_list, vec![(1, true), (2, true), (5, true), (9, true)]);
// Add a later root, earlier slots should be reclaimed
slot_list = vec![(1, true), (2, true), (5, true), (9, true)];
index.add_root(1, false);
// Note 2 is not a root
index.add_root(5, false);
reclaims = vec![];
index.purge_older_root_entries(
&Pubkey::default(),
&mut slot_list,
&mut reclaims,
None,
&HashSet::new(),
);
assert_eq!(reclaims, vec![(1, true), (2, true)]);
assert_eq!(slot_list, vec![(5, true), (9, true)]);
// Add a later root that is not in the list, should not affect the outcome
slot_list = vec![(1, true), (2, true), (5, true), (9, true)];
index.add_root(6, false);
reclaims = vec![];
index.purge_older_root_entries(
&Pubkey::default(),
&mut slot_list,
&mut reclaims,
None,
&HashSet::new(),
);
assert_eq!(reclaims, vec![(1, true), (2, true)]);
assert_eq!(slot_list, vec![(5, true), (9, true)]);
// Pass a max root >= than any root in the slot list, should not affect
// outcome
slot_list = vec![(1, true), (2, true), (5, true), (9, true)];
reclaims = vec![];
index.purge_older_root_entries(
&Pubkey::default(),
&mut slot_list,
&mut reclaims,
Some(6),
&HashSet::new(),
);
assert_eq!(reclaims, vec![(1, true), (2, true)]);
assert_eq!(slot_list, vec![(5, true), (9, true)]);
// Pass a max root, earlier slots should be reclaimed
slot_list = vec![(1, true), (2, true), (5, true), (9, true)];
reclaims = vec![];
index.purge_older_root_entries(
&Pubkey::default(),
&mut slot_list,
&mut reclaims,
Some(5),
&HashSet::new(),
);
assert_eq!(reclaims, vec![(1, true), (2, true)]);
assert_eq!(slot_list, vec![(5, true), (9, true)]);
// Pass a max root 2. This means the latest root < 2 is 1 because 2 is not a root
// so nothing will be purged
slot_list = vec![(1, true), (2, true), (5, true), (9, true)];
reclaims = vec![];
index.purge_older_root_entries(
&Pubkey::default(),
&mut slot_list,
&mut reclaims,
Some(2),
&HashSet::new(),
);
assert!(reclaims.is_empty());
assert_eq!(slot_list, vec![(1, true), (2, true), (5, true), (9, true)]);
// Pass a max root 1. This means the latest root < 3 is 1 because 2 is not a root
// so nothing will be purged
slot_list = vec![(1, true), (2, true), (5, true), (9, true)];
reclaims = vec![];
index.purge_older_root_entries(
&Pubkey::default(),
&mut slot_list,
&mut reclaims,
Some(1),
&HashSet::new(),
);
assert!(reclaims.is_empty());
assert_eq!(slot_list, vec![(1, true), (2, true), (5, true), (9, true)]);
// Pass a max root that doesn't exist in the list but is greater than
// some of the roots in the list, shouldn't return those smaller roots
slot_list = vec![(1, true), (2, true), (5, true), (9, true)];
reclaims = vec![];
index.purge_older_root_entries(
&Pubkey::default(),
&mut slot_list,
&mut reclaims,
Some(7),
&HashSet::new(),
);
assert_eq!(reclaims, vec![(1, true), (2, true)]);
assert_eq!(slot_list, vec![(5, true), (9, true)]);
}
fn check_secondary_index_unique<SecondaryIndexEntryType>(
secondary_index: &SecondaryIndex<SecondaryIndexEntryType>,
slot: Slot,
key: &Pubkey,
account_key: &Pubkey,
) where
SecondaryIndexEntryType: SecondaryIndexEntry + Default + Sync + Send,
{
// Check secondary index has unique mapping from secondary index key
// to the account key and slot
assert_eq!(secondary_index.index.len(), 1);
let inner_key_map = secondary_index.index.get(key).unwrap();
assert_eq!(inner_key_map.len(), 1);
inner_key_map
.value()
.get(account_key, &|slots_map: Option<&RwLock<HashSet<Slot>>>| {
let slots_map = slots_map.unwrap();
assert_eq!(slots_map.read().unwrap().len(), 1);
assert!(slots_map.read().unwrap().contains(&slot));
});
// Check reverse index is unique
let slots_map = secondary_index.reverse_index.get(account_key).unwrap();
assert_eq!(slots_map.value().read().unwrap().get(&slot).unwrap(), key);
}
fn run_test_secondary_indexes<
SecondaryIndexEntryType: SecondaryIndexEntry + Default + Sync + Send,
>(
index: &AccountsIndex<bool>,
secondary_index: &SecondaryIndex<SecondaryIndexEntryType>,
key_start: usize,
key_end: usize,
account_index: &HashSet<AccountIndex>,
) {
let account_key = Pubkey::new_unique();
let index_key = Pubkey::new_unique();
let slot = 1;
let mut account_data = vec![0; inline_spl_token_v2_0::state::Account::get_packed_len()];
account_data[key_start..key_end].clone_from_slice(&(index_key.to_bytes()));
// Wrong program id
index.upsert(
0,
&account_key,
&Pubkey::default(),
&account_data,
account_index,
true,
&mut vec![],
);
assert!(index.spl_token_mint_index.index.is_empty());
assert!(index.spl_token_mint_index.reverse_index.is_empty());
// Wrong account data size
index.upsert(
0,
&account_key,
&inline_spl_token_v2_0::id(),
&account_data[1..],
account_index,
true,
&mut vec![],
);
assert!(index.spl_token_mint_index.index.is_empty());
assert!(index.spl_token_mint_index.reverse_index.is_empty());
// Just right. Inserting the same index multiple times should be ok
for _ in 0..2 {
index.update_secondary_indexes(
&account_key,
slot,
&inline_spl_token_v2_0::id(),
&account_data,
account_index,
);
check_secondary_index_unique(secondary_index, slot, &index_key, &account_key);
}
index
.get_account_write_entry(&account_key)
.unwrap()
.slot_list_mut(|slot_list| slot_list.clear());
// Everything should be deleted
index.handle_dead_keys(&[&account_key], account_index);
assert!(index.spl_token_mint_index.index.is_empty());
assert!(index.spl_token_mint_index.reverse_index.is_empty());
}
#[test]
fn test_dashmap_secondary_index() {
let (key_start, key_end, account_index) = create_dashmap_secondary_index_state();
let index = AccountsIndex::<bool>::default();
run_test_secondary_indexes(
&index,
&index.spl_token_mint_index,
key_start,
key_end,
&account_index,
);
}
#[test]
fn test_rwlock_secondary_index() {
let (key_start, key_end, account_index) = create_rwlock_secondary_index_state();
let index = AccountsIndex::<bool>::default();
run_test_secondary_indexes(
&index,
&index.spl_token_owner_index,
key_start,
key_end,
&account_index,
);
}
fn run_test_secondary_indexes_same_slot_and_forks<
SecondaryIndexEntryType: SecondaryIndexEntry + Default + Sync + Send,
>(
index: &AccountsIndex<bool>,
secondary_index: &SecondaryIndex<SecondaryIndexEntryType>,
index_key_start: usize,
index_key_end: usize,
account_index: &HashSet<AccountIndex>,
) {
let account_key = Pubkey::new_unique();
let secondary_key1 = Pubkey::new_unique();
let secondary_key2 = Pubkey::new_unique();
let slot = 1;
let mut account_data1 = vec![0; inline_spl_token_v2_0::state::Account::get_packed_len()];
account_data1[index_key_start..index_key_end]
.clone_from_slice(&(secondary_key1.to_bytes()));
let mut account_data2 = vec![0; inline_spl_token_v2_0::state::Account::get_packed_len()];
account_data2[index_key_start..index_key_end]
.clone_from_slice(&(secondary_key2.to_bytes()));
// First write one mint index
index.upsert(
slot,
&account_key,
&inline_spl_token_v2_0::id(),
&account_data1,
account_index,
true,
&mut vec![],
);
// Now write a different mint index
index.upsert(
slot,
&account_key,
&inline_spl_token_v2_0::id(),
&account_data2,
account_index,
true,
&mut vec![],
);
// Check correctness
check_secondary_index_unique(&secondary_index, slot, &secondary_key2, &account_key);
assert!(secondary_index.get(&secondary_key1).is_empty());
assert_eq!(secondary_index.get(&secondary_key2), vec![account_key]);
// If another fork reintroduces secondary_key1, then it should be re-added to the
// index
let fork = slot + 1;
index.upsert(
fork,
&account_key,
&inline_spl_token_v2_0::id(),
&account_data1,
account_index,
true,
&mut vec![],
);
assert_eq!(secondary_index.get(&secondary_key1), vec![account_key]);
// If we set a root at fork, and clean, then the secondary_key1 should no longer
// be findable
index.add_root(fork, false);
index
.get_account_write_entry(&account_key)
.unwrap()
.slot_list_mut(|slot_list| {
index.purge_older_root_entries(
&account_key,
slot_list,
&mut vec![],
None,
account_index,
)
});
assert!(secondary_index.get(&secondary_key2).is_empty());
assert_eq!(secondary_index.get(&secondary_key1), vec![account_key]);
// Check correctness
check_secondary_index_unique(secondary_index, fork, &secondary_key1, &account_key);
}
#[test]
fn test_dashmap_secondary_index_same_slot_and_forks() {
let (key_start, key_end, account_index) = create_dashmap_secondary_index_state();
let index = AccountsIndex::<bool>::default();
run_test_secondary_indexes_same_slot_and_forks(
&index,
&index.spl_token_mint_index,
key_start,
key_end,
&account_index,
);
}
#[test]
fn test_rwlock_secondary_index_same_slot_and_forks() {
let (key_start, key_end, account_index) = create_rwlock_secondary_index_state();
let index = AccountsIndex::<bool>::default();
run_test_secondary_indexes_same_slot_and_forks(
&index,
&index.spl_token_owner_index,
key_start,
key_end,
&account_index,
);
}
impl ZeroLamport for bool {
fn is_zero_lamport(&self) -> bool {
false
}
}
impl ZeroLamport for u64 {
fn is_zero_lamport(&self) -> bool {
false
}
}
}
|
iter
|
staking.pulsar.go
|
// Code generated by protoc-gen-go-pulsar. DO NOT EDIT.
package stakingv1beta1
import (
fmt "fmt"
_ "github.com/cosmos/cosmos-proto"
runtime "github.com/cosmos/cosmos-proto/runtime"
v1beta1 "github.com/cosmos/cosmos-sdk/api/cosmos/base/v1beta1"
types "github.com/cosmos/cosmos-sdk/api/tendermint/types"
_ "github.com/gogo/protobuf/gogoproto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoiface "google.golang.org/protobuf/runtime/protoiface"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
anypb "google.golang.org/protobuf/types/known/anypb"
durationpb "google.golang.org/protobuf/types/known/durationpb"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
io "io"
reflect "reflect"
sync "sync"
)
var _ protoreflect.List = (*_HistoricalInfo_2_list)(nil)
type _HistoricalInfo_2_list struct {
list *[]*Validator
}
func (x *_HistoricalInfo_2_list) Len() int {
if x.list == nil {
return 0
}
return len(*x.list)
}
func (x *_HistoricalInfo_2_list) Get(i int) protoreflect.Value {
return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect())
}
func (x *_HistoricalInfo_2_list) Set(i int, value protoreflect.Value) {
valueUnwrapped := value.Message()
concreteValue := valueUnwrapped.Interface().(*Validator)
(*x.list)[i] = concreteValue
}
func (x *_HistoricalInfo_2_list) Append(value protoreflect.Value) {
valueUnwrapped := value.Message()
concreteValue := valueUnwrapped.Interface().(*Validator)
*x.list = append(*x.list, concreteValue)
}
func (x *_HistoricalInfo_2_list) AppendMutable() protoreflect.Value {
v := new(Validator)
*x.list = append(*x.list, v)
return protoreflect.ValueOfMessage(v.ProtoReflect())
}
func (x *_HistoricalInfo_2_list) Truncate(n int) {
for i := n; i < len(*x.list); i++ {
(*x.list)[i] = nil
}
*x.list = (*x.list)[:n]
}
func (x *_HistoricalInfo_2_list) NewElement() protoreflect.Value {
v := new(Validator)
return protoreflect.ValueOfMessage(v.ProtoReflect())
}
func (x *_HistoricalInfo_2_list) IsValid() bool {
return x.list != nil
}
var (
md_HistoricalInfo protoreflect.MessageDescriptor
fd_HistoricalInfo_header protoreflect.FieldDescriptor
fd_HistoricalInfo_valset protoreflect.FieldDescriptor
)
func init() {
file_cosmos_staking_v1beta1_staking_proto_init()
md_HistoricalInfo = File_cosmos_staking_v1beta1_staking_proto.Messages().ByName("HistoricalInfo")
fd_HistoricalInfo_header = md_HistoricalInfo.Fields().ByName("header")
fd_HistoricalInfo_valset = md_HistoricalInfo.Fields().ByName("valset")
}
var _ protoreflect.Message = (*fastReflection_HistoricalInfo)(nil)
type fastReflection_HistoricalInfo HistoricalInfo
func (x *HistoricalInfo) ProtoReflect() protoreflect.Message {
return (*fastReflection_HistoricalInfo)(x)
}
func (x *HistoricalInfo) slowProtoReflect() protoreflect.Message {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
var _fastReflection_HistoricalInfo_messageType fastReflection_HistoricalInfo_messageType
var _ protoreflect.MessageType = fastReflection_HistoricalInfo_messageType{}
type fastReflection_HistoricalInfo_messageType struct{}
func (x fastReflection_HistoricalInfo_messageType) Zero() protoreflect.Message {
return (*fastReflection_HistoricalInfo)(nil)
}
func (x fastReflection_HistoricalInfo_messageType) New() protoreflect.Message {
return new(fastReflection_HistoricalInfo)
}
func (x fastReflection_HistoricalInfo_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_HistoricalInfo
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_HistoricalInfo) Descriptor() protoreflect.MessageDescriptor {
return md_HistoricalInfo
}
// Type returns the message type, which encapsulates both Go and protobuf
// type information. If the Go type information is not needed,
// it is recommended that the message descriptor be used instead.
func (x *fastReflection_HistoricalInfo) Type() protoreflect.MessageType {
return _fastReflection_HistoricalInfo_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_HistoricalInfo) New() protoreflect.Message {
return new(fastReflection_HistoricalInfo)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_HistoricalInfo) Interface() protoreflect.ProtoMessage {
return (*HistoricalInfo)(x)
}
// Range iterates over every populated field in an undefined order,
// calling f for each field descriptor and value encountered.
// Range returns immediately if f returns false.
// While iterating, mutating operations may only be performed
// on the current field descriptor.
func (x *fastReflection_HistoricalInfo) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
if x.Header != nil {
value := protoreflect.ValueOfMessage(x.Header.ProtoReflect())
if !f(fd_HistoricalInfo_header, value) {
return
}
}
if len(x.Valset) != 0 {
value := protoreflect.ValueOfList(&_HistoricalInfo_2_list{list: &x.Valset})
if !f(fd_HistoricalInfo_valset, value) {
return
}
}
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_HistoricalInfo) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
case "cosmos.staking.v1beta1.HistoricalInfo.header":
return x.Header != nil
case "cosmos.staking.v1beta1.HistoricalInfo.valset":
return len(x.Valset) != 0
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.HistoricalInfo"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.HistoricalInfo does not contain field %s", fd.FullName()))
}
}
// Clear clears the field such that a subsequent Has call reports false.
//
// Clearing an extension field clears both the extension type and value
// associated with the given field number.
//
// Clear is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_HistoricalInfo) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.HistoricalInfo.header":
x.Header = nil
case "cosmos.staking.v1beta1.HistoricalInfo.valset":
x.Valset = nil
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.HistoricalInfo"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.HistoricalInfo does not contain field %s", fd.FullName()))
}
}
// Get retrieves the value for a field.
//
// For unpopulated scalars, it returns the default value, where
// the default value of a bytes scalar is guaranteed to be a copy.
// For unpopulated composite types, it returns an empty, read-only view
// of the value; to obtain a mutable reference, use Mutable.
func (x *fastReflection_HistoricalInfo) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
case "cosmos.staking.v1beta1.HistoricalInfo.header":
value := x.Header
return protoreflect.ValueOfMessage(value.ProtoReflect())
case "cosmos.staking.v1beta1.HistoricalInfo.valset":
if len(x.Valset) == 0 {
return protoreflect.ValueOfList(&_HistoricalInfo_2_list{})
}
listValue := &_HistoricalInfo_2_list{list: &x.Valset}
return protoreflect.ValueOfList(listValue)
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.HistoricalInfo"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.HistoricalInfo does not contain field %s", descriptor.FullName()))
}
}
// Set stores the value for a field.
//
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType.
// When setting a composite type, it is unspecified whether the stored value
// aliases the source's memory in any way. If the composite value is an
// empty, read-only value, then it panics.
//
// Set is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_HistoricalInfo) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.HistoricalInfo.header":
x.Header = value.Message().Interface().(*types.Header)
case "cosmos.staking.v1beta1.HistoricalInfo.valset":
lv := value.List()
clv := lv.(*_HistoricalInfo_2_list)
x.Valset = *clv.list
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.HistoricalInfo"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.HistoricalInfo does not contain field %s", fd.FullName()))
}
}
// Mutable returns a mutable reference to a composite type.
//
// If the field is unpopulated, it may allocate a composite value.
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType
// if not already stored.
// It panics if the field does not contain a composite type.
//
// Mutable is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_HistoricalInfo) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.HistoricalInfo.header":
if x.Header == nil {
x.Header = new(types.Header)
}
return protoreflect.ValueOfMessage(x.Header.ProtoReflect())
case "cosmos.staking.v1beta1.HistoricalInfo.valset":
if x.Valset == nil {
x.Valset = []*Validator{}
}
value := &_HistoricalInfo_2_list{list: &x.Valset}
return protoreflect.ValueOfList(value)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.HistoricalInfo"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.HistoricalInfo does not contain field %s", fd.FullName()))
}
}
// NewField returns a new value that is assignable to the field
// for the given descriptor. For scalars, this returns the default value.
// For lists, maps, and messages, this returns a new, empty, mutable value.
func (x *fastReflection_HistoricalInfo) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.HistoricalInfo.header":
m := new(types.Header)
return protoreflect.ValueOfMessage(m.ProtoReflect())
case "cosmos.staking.v1beta1.HistoricalInfo.valset":
list := []*Validator{}
return protoreflect.ValueOfList(&_HistoricalInfo_2_list{list: &list})
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.HistoricalInfo"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.HistoricalInfo does not contain field %s", fd.FullName()))
}
}
// WhichOneof reports which field within the oneof is populated,
// returning nil if none are populated.
// It panics if the oneof descriptor does not belong to this message.
func (x *fastReflection_HistoricalInfo) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in cosmos.staking.v1beta1.HistoricalInfo", d.FullName()))
}
panic("unreachable")
}
// GetUnknown retrieves the entire list of unknown fields.
// The caller may only mutate the contents of the RawFields
// if the mutated bytes are stored back into the message with SetUnknown.
func (x *fastReflection_HistoricalInfo) GetUnknown() protoreflect.RawFields {
return x.unknownFields
}
// SetUnknown stores an entire list of unknown fields.
// The raw fields must be syntactically valid according to the wire format.
// An implementation may panic if this is not the case.
// Once stored, the caller must not mutate the content of the RawFields.
// An empty RawFields may be passed to clear the fields.
//
// SetUnknown is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_HistoricalInfo) SetUnknown(fields protoreflect.RawFields) {
x.unknownFields = fields
}
// IsValid reports whether the message is valid.
//
// An invalid message is an empty, read-only value.
//
// An invalid message often corresponds to a nil pointer of the concrete
// message type, but the details are implementation dependent.
// Validity is not part of the protobuf data model, and may not
// be preserved in marshaling or other operations.
func (x *fastReflection_HistoricalInfo) IsValid() bool {
return x != nil
}
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
// This method may return nil.
//
// The returned methods type is identical to
// "google.golang.org/protobuf/runtime/protoiface".Methods.
// Consult the protoiface package documentation for details.
func (x *fastReflection_HistoricalInfo) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*HistoricalInfo)
if x == nil {
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: 0,
}
}
options := runtime.SizeInputToOptions(input)
_ = options
var n int
var l int
_ = l
if x.Header != nil {
l = options.Size(x.Header)
n += 1 + l + runtime.Sov(uint64(l))
}
if len(x.Valset) > 0 {
for _, e := range x.Valset {
l = options.Size(e)
n += 1 + l + runtime.Sov(uint64(l))
}
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: n,
}
}
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
x := input.Message.Interface().(*HistoricalInfo)
if x == nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
options := runtime.MarshalInputToOptions(input)
_ = options
size := options.Size(x)
dAtA := make([]byte, size)
i := len(dAtA)
_ = i
var l int
_ = l
if x.unknownFields != nil {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if len(x.Valset) > 0 {
for iNdEx := len(x.Valset) - 1; iNdEx >= 0; iNdEx-- {
encoded, err := options.Marshal(x.Valset[iNdEx])
if err != nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, err
}
i -= len(encoded)
copy(dAtA[i:], encoded)
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
i--
dAtA[i] = 0x12
}
}
if x.Header != nil {
encoded, err := options.Marshal(x.Header)
if err != nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, err
}
i -= len(encoded)
copy(dAtA[i:], encoded)
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
i--
dAtA[i] = 0xa
}
if input.Buf != nil {
input.Buf = append(input.Buf, dAtA...)
} else {
input.Buf = dAtA
}
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
x := input.Message.Interface().(*HistoricalInfo)
if x == nil {
return protoiface.UnmarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Flags: input.Flags,
}, nil
}
options := runtime.UnmarshalInputToOptions(input)
_ = options
dAtA := input.Buf
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: HistoricalInfo: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: HistoricalInfo: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if x.Header == nil {
x.Header = &types.Header{}
}
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Header); err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Valset", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.Valset = append(x.Valset, &Validator{})
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Valset[len(x.Valset)-1]); err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
var (
md_CommissionRates protoreflect.MessageDescriptor
fd_CommissionRates_rate protoreflect.FieldDescriptor
fd_CommissionRates_max_rate protoreflect.FieldDescriptor
fd_CommissionRates_max_change_rate protoreflect.FieldDescriptor
)
func init() {
file_cosmos_staking_v1beta1_staking_proto_init()
md_CommissionRates = File_cosmos_staking_v1beta1_staking_proto.Messages().ByName("CommissionRates")
fd_CommissionRates_rate = md_CommissionRates.Fields().ByName("rate")
fd_CommissionRates_max_rate = md_CommissionRates.Fields().ByName("max_rate")
fd_CommissionRates_max_change_rate = md_CommissionRates.Fields().ByName("max_change_rate")
}
var _ protoreflect.Message = (*fastReflection_CommissionRates)(nil)
type fastReflection_CommissionRates CommissionRates
func (x *CommissionRates) ProtoReflect() protoreflect.Message {
return (*fastReflection_CommissionRates)(x)
}
func (x *CommissionRates) slowProtoReflect() protoreflect.Message {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
var _fastReflection_CommissionRates_messageType fastReflection_CommissionRates_messageType
var _ protoreflect.MessageType = fastReflection_CommissionRates_messageType{}
type fastReflection_CommissionRates_messageType struct{}
func (x fastReflection_CommissionRates_messageType) Zero() protoreflect.Message {
return (*fastReflection_CommissionRates)(nil)
}
func (x fastReflection_CommissionRates_messageType) New() protoreflect.Message {
return new(fastReflection_CommissionRates)
}
func (x fastReflection_CommissionRates_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_CommissionRates
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_CommissionRates) Descriptor() protoreflect.MessageDescriptor {
return md_CommissionRates
}
// Type returns the message type, which encapsulates both Go and protobuf
// type information. If the Go type information is not needed,
// it is recommended that the message descriptor be used instead.
func (x *fastReflection_CommissionRates) Type() protoreflect.MessageType {
return _fastReflection_CommissionRates_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_CommissionRates) New() protoreflect.Message {
return new(fastReflection_CommissionRates)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_CommissionRates) Interface() protoreflect.ProtoMessage {
return (*CommissionRates)(x)
}
// Range iterates over every populated field in an undefined order,
// calling f for each field descriptor and value encountered.
// Range returns immediately if f returns false.
// While iterating, mutating operations may only be performed
// on the current field descriptor.
func (x *fastReflection_CommissionRates) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
if x.Rate != "" {
value := protoreflect.ValueOfString(x.Rate)
if !f(fd_CommissionRates_rate, value) {
return
}
}
if x.MaxRate != "" {
value := protoreflect.ValueOfString(x.MaxRate)
if !f(fd_CommissionRates_max_rate, value) {
return
}
}
if x.MaxChangeRate != "" {
value := protoreflect.ValueOfString(x.MaxChangeRate)
if !f(fd_CommissionRates_max_change_rate, value) {
return
}
}
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_CommissionRates) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
case "cosmos.staking.v1beta1.CommissionRates.rate":
return x.Rate != ""
case "cosmos.staking.v1beta1.CommissionRates.max_rate":
return x.MaxRate != ""
case "cosmos.staking.v1beta1.CommissionRates.max_change_rate":
return x.MaxChangeRate != ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.CommissionRates"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.CommissionRates does not contain field %s", fd.FullName()))
}
}
// Clear clears the field such that a subsequent Has call reports false.
//
// Clearing an extension field clears both the extension type and value
// associated with the given field number.
//
// Clear is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_CommissionRates) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.CommissionRates.rate":
x.Rate = ""
case "cosmos.staking.v1beta1.CommissionRates.max_rate":
x.MaxRate = ""
case "cosmos.staking.v1beta1.CommissionRates.max_change_rate":
x.MaxChangeRate = ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.CommissionRates"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.CommissionRates does not contain field %s", fd.FullName()))
}
}
// Get retrieves the value for a field.
//
// For unpopulated scalars, it returns the default value, where
// the default value of a bytes scalar is guaranteed to be a copy.
// For unpopulated composite types, it returns an empty, read-only view
// of the value; to obtain a mutable reference, use Mutable.
func (x *fastReflection_CommissionRates) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
case "cosmos.staking.v1beta1.CommissionRates.rate":
value := x.Rate
return protoreflect.ValueOfString(value)
case "cosmos.staking.v1beta1.CommissionRates.max_rate":
value := x.MaxRate
return protoreflect.ValueOfString(value)
case "cosmos.staking.v1beta1.CommissionRates.max_change_rate":
value := x.MaxChangeRate
return protoreflect.ValueOfString(value)
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.CommissionRates"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.CommissionRates does not contain field %s", descriptor.FullName()))
}
}
// Set stores the value for a field.
//
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType.
// When setting a composite type, it is unspecified whether the stored value
// aliases the source's memory in any way. If the composite value is an
// empty, read-only value, then it panics.
//
// Set is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_CommissionRates) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.CommissionRates.rate":
x.Rate = value.Interface().(string)
case "cosmos.staking.v1beta1.CommissionRates.max_rate":
x.MaxRate = value.Interface().(string)
case "cosmos.staking.v1beta1.CommissionRates.max_change_rate":
x.MaxChangeRate = value.Interface().(string)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.CommissionRates"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.CommissionRates does not contain field %s", fd.FullName()))
}
}
// Mutable returns a mutable reference to a composite type.
//
// If the field is unpopulated, it may allocate a composite value.
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType
// if not already stored.
// It panics if the field does not contain a composite type.
//
// Mutable is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_CommissionRates) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.CommissionRates.rate":
panic(fmt.Errorf("field rate of message cosmos.staking.v1beta1.CommissionRates is not mutable"))
case "cosmos.staking.v1beta1.CommissionRates.max_rate":
panic(fmt.Errorf("field max_rate of message cosmos.staking.v1beta1.CommissionRates is not mutable"))
case "cosmos.staking.v1beta1.CommissionRates.max_change_rate":
panic(fmt.Errorf("field max_change_rate of message cosmos.staking.v1beta1.CommissionRates is not mutable"))
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.CommissionRates"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.CommissionRates does not contain field %s", fd.FullName()))
}
}
// NewField returns a new value that is assignable to the field
// for the given descriptor. For scalars, this returns the default value.
// For lists, maps, and messages, this returns a new, empty, mutable value.
func (x *fastReflection_CommissionRates) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.CommissionRates.rate":
return protoreflect.ValueOfString("")
case "cosmos.staking.v1beta1.CommissionRates.max_rate":
return protoreflect.ValueOfString("")
case "cosmos.staking.v1beta1.CommissionRates.max_change_rate":
return protoreflect.ValueOfString("")
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.CommissionRates"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.CommissionRates does not contain field %s", fd.FullName()))
}
}
// WhichOneof reports which field within the oneof is populated,
// returning nil if none are populated.
// It panics if the oneof descriptor does not belong to this message.
func (x *fastReflection_CommissionRates) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in cosmos.staking.v1beta1.CommissionRates", d.FullName()))
}
panic("unreachable")
}
// GetUnknown retrieves the entire list of unknown fields.
// The caller may only mutate the contents of the RawFields
// if the mutated bytes are stored back into the message with SetUnknown.
func (x *fastReflection_CommissionRates) GetUnknown() protoreflect.RawFields {
return x.unknownFields
}
// SetUnknown stores an entire list of unknown fields.
// The raw fields must be syntactically valid according to the wire format.
// An implementation may panic if this is not the case.
// Once stored, the caller must not mutate the content of the RawFields.
// An empty RawFields may be passed to clear the fields.
//
// SetUnknown is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_CommissionRates) SetUnknown(fields protoreflect.RawFields) {
x.unknownFields = fields
}
// IsValid reports whether the message is valid.
//
// An invalid message is an empty, read-only value.
//
// An invalid message often corresponds to a nil pointer of the concrete
// message type, but the details are implementation dependent.
// Validity is not part of the protobuf data model, and may not
// be preserved in marshaling or other operations.
func (x *fastReflection_CommissionRates) IsValid() bool {
return x != nil
}
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
// This method may return nil.
//
// The returned methods type is identical to
// "google.golang.org/protobuf/runtime/protoiface".Methods.
// Consult the protoiface package documentation for details.
func (x *fastReflection_CommissionRates) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*CommissionRates)
if x == nil {
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: 0,
}
}
options := runtime.SizeInputToOptions(input)
_ = options
var n int
var l int
_ = l
l = len(x.Rate)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.MaxRate)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.MaxChangeRate)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: n,
}
}
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
x := input.Message.Interface().(*CommissionRates)
if x == nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
options := runtime.MarshalInputToOptions(input)
_ = options
size := options.Size(x)
dAtA := make([]byte, size)
i := len(dAtA)
_ = i
var l int
_ = l
if x.unknownFields != nil {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if len(x.MaxChangeRate) > 0 {
i -= len(x.MaxChangeRate)
copy(dAtA[i:], x.MaxChangeRate)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MaxChangeRate)))
i--
dAtA[i] = 0x1a
}
if len(x.MaxRate) > 0 {
i -= len(x.MaxRate)
copy(dAtA[i:], x.MaxRate)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MaxRate)))
i--
dAtA[i] = 0x12
}
if len(x.Rate) > 0 {
i -= len(x.Rate)
copy(dAtA[i:], x.Rate)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Rate)))
i--
dAtA[i] = 0xa
}
if input.Buf != nil {
input.Buf = append(input.Buf, dAtA...)
} else {
input.Buf = dAtA
}
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
x := input.Message.Interface().(*CommissionRates)
if x == nil {
return protoiface.UnmarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Flags: input.Flags,
}, nil
}
options := runtime.UnmarshalInputToOptions(input)
_ = options
dAtA := input.Buf
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: CommissionRates: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: CommissionRates: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Rate", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.Rate = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxRate", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.MaxRate = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxChangeRate", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.MaxChangeRate = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
var (
md_Commission protoreflect.MessageDescriptor
fd_Commission_commission_rates protoreflect.FieldDescriptor
fd_Commission_update_time protoreflect.FieldDescriptor
)
func init() {
file_cosmos_staking_v1beta1_staking_proto_init()
md_Commission = File_cosmos_staking_v1beta1_staking_proto.Messages().ByName("Commission")
fd_Commission_commission_rates = md_Commission.Fields().ByName("commission_rates")
fd_Commission_update_time = md_Commission.Fields().ByName("update_time")
}
var _ protoreflect.Message = (*fastReflection_Commission)(nil)
type fastReflection_Commission Commission
func (x *Commission) ProtoReflect() protoreflect.Message {
return (*fastReflection_Commission)(x)
}
func (x *Commission) slowProtoReflect() protoreflect.Message {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
var _fastReflection_Commission_messageType fastReflection_Commission_messageType
var _ protoreflect.MessageType = fastReflection_Commission_messageType{}
type fastReflection_Commission_messageType struct{}
func (x fastReflection_Commission_messageType) Zero() protoreflect.Message {
return (*fastReflection_Commission)(nil)
}
func (x fastReflection_Commission_messageType) New() protoreflect.Message {
return new(fastReflection_Commission)
}
func (x fastReflection_Commission_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_Commission
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_Commission) Descriptor() protoreflect.MessageDescriptor {
return md_Commission
}
// Type returns the message type, which encapsulates both Go and protobuf
// type information. If the Go type information is not needed,
// it is recommended that the message descriptor be used instead.
func (x *fastReflection_Commission) Type() protoreflect.MessageType {
return _fastReflection_Commission_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_Commission) New() protoreflect.Message {
return new(fastReflection_Commission)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_Commission) Interface() protoreflect.ProtoMessage {
return (*Commission)(x)
}
// Range iterates over every populated field in an undefined order,
// calling f for each field descriptor and value encountered.
// Range returns immediately if f returns false.
// While iterating, mutating operations may only be performed
// on the current field descriptor.
func (x *fastReflection_Commission) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
if x.CommissionRates != nil {
value := protoreflect.ValueOfMessage(x.CommissionRates.ProtoReflect())
if !f(fd_Commission_commission_rates, value) {
return
}
}
if x.UpdateTime != nil {
value := protoreflect.ValueOfMessage(x.UpdateTime.ProtoReflect())
if !f(fd_Commission_update_time, value) {
return
}
}
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_Commission) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Commission.commission_rates":
return x.CommissionRates != nil
case "cosmos.staking.v1beta1.Commission.update_time":
return x.UpdateTime != nil
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Commission"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Commission does not contain field %s", fd.FullName()))
}
}
// Clear clears the field such that a subsequent Has call reports false.
//
// Clearing an extension field clears both the extension type and value
// associated with the given field number.
//
// Clear is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Commission) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Commission.commission_rates":
x.CommissionRates = nil
case "cosmos.staking.v1beta1.Commission.update_time":
x.UpdateTime = nil
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Commission"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Commission does not contain field %s", fd.FullName()))
}
}
// Get retrieves the value for a field.
//
// For unpopulated scalars, it returns the default value, where
// the default value of a bytes scalar is guaranteed to be a copy.
// For unpopulated composite types, it returns an empty, read-only view
// of the value; to obtain a mutable reference, use Mutable.
func (x *fastReflection_Commission) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
case "cosmos.staking.v1beta1.Commission.commission_rates":
value := x.CommissionRates
return protoreflect.ValueOfMessage(value.ProtoReflect())
case "cosmos.staking.v1beta1.Commission.update_time":
value := x.UpdateTime
return protoreflect.ValueOfMessage(value.ProtoReflect())
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Commission"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Commission does not contain field %s", descriptor.FullName()))
}
}
// Set stores the value for a field.
//
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType.
// When setting a composite type, it is unspecified whether the stored value
// aliases the source's memory in any way. If the composite value is an
// empty, read-only value, then it panics.
//
// Set is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Commission) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Commission.commission_rates":
x.CommissionRates = value.Message().Interface().(*CommissionRates)
case "cosmos.staking.v1beta1.Commission.update_time":
x.UpdateTime = value.Message().Interface().(*timestamppb.Timestamp)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Commission"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Commission does not contain field %s", fd.FullName()))
}
}
// Mutable returns a mutable reference to a composite type.
//
// If the field is unpopulated, it may allocate a composite value.
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType
// if not already stored.
// It panics if the field does not contain a composite type.
//
// Mutable is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Commission) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Commission.commission_rates":
if x.CommissionRates == nil {
x.CommissionRates = new(CommissionRates)
}
return protoreflect.ValueOfMessage(x.CommissionRates.ProtoReflect())
case "cosmos.staking.v1beta1.Commission.update_time":
if x.UpdateTime == nil {
x.UpdateTime = new(timestamppb.Timestamp)
}
return protoreflect.ValueOfMessage(x.UpdateTime.ProtoReflect())
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Commission"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Commission does not contain field %s", fd.FullName()))
}
}
// NewField returns a new value that is assignable to the field
// for the given descriptor. For scalars, this returns the default value.
// For lists, maps, and messages, this returns a new, empty, mutable value.
func (x *fastReflection_Commission) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Commission.commission_rates":
m := new(CommissionRates)
return protoreflect.ValueOfMessage(m.ProtoReflect())
case "cosmos.staking.v1beta1.Commission.update_time":
m := new(timestamppb.Timestamp)
return protoreflect.ValueOfMessage(m.ProtoReflect())
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Commission"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Commission does not contain field %s", fd.FullName()))
}
}
// WhichOneof reports which field within the oneof is populated,
// returning nil if none are populated.
// It panics if the oneof descriptor does not belong to this message.
func (x *fastReflection_Commission) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in cosmos.staking.v1beta1.Commission", d.FullName()))
}
panic("unreachable")
}
// GetUnknown retrieves the entire list of unknown fields.
// The caller may only mutate the contents of the RawFields
// if the mutated bytes are stored back into the message with SetUnknown.
func (x *fastReflection_Commission) GetUnknown() protoreflect.RawFields {
return x.unknownFields
}
// SetUnknown stores an entire list of unknown fields.
// The raw fields must be syntactically valid according to the wire format.
// An implementation may panic if this is not the case.
// Once stored, the caller must not mutate the content of the RawFields.
// An empty RawFields may be passed to clear the fields.
//
// SetUnknown is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Commission) SetUnknown(fields protoreflect.RawFields) {
x.unknownFields = fields
}
// IsValid reports whether the message is valid.
//
// An invalid message is an empty, read-only value.
//
// An invalid message often corresponds to a nil pointer of the concrete
// message type, but the details are implementation dependent.
// Validity is not part of the protobuf data model, and may not
// be preserved in marshaling or other operations.
func (x *fastReflection_Commission) IsValid() bool {
return x != nil
}
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
// This method may return nil.
//
// The returned methods type is identical to
// "google.golang.org/protobuf/runtime/protoiface".Methods.
// Consult the protoiface package documentation for details.
func (x *fastReflection_Commission) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*Commission)
if x == nil {
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: 0,
}
}
options := runtime.SizeInputToOptions(input)
_ = options
var n int
var l int
_ = l
if x.CommissionRates != nil {
l = options.Size(x.CommissionRates)
n += 1 + l + runtime.Sov(uint64(l))
}
if x.UpdateTime != nil {
l = options.Size(x.UpdateTime)
n += 1 + l + runtime.Sov(uint64(l))
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: n,
}
}
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
x := input.Message.Interface().(*Commission)
if x == nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
options := runtime.MarshalInputToOptions(input)
_ = options
size := options.Size(x)
dAtA := make([]byte, size)
i := len(dAtA)
_ = i
var l int
_ = l
if x.unknownFields != nil {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if x.UpdateTime != nil {
encoded, err := options.Marshal(x.UpdateTime)
if err != nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, err
}
i -= len(encoded)
copy(dAtA[i:], encoded)
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
i--
dAtA[i] = 0x12
}
if x.CommissionRates != nil {
encoded, err := options.Marshal(x.CommissionRates)
if err != nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, err
}
i -= len(encoded)
copy(dAtA[i:], encoded)
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
i--
dAtA[i] = 0xa
}
if input.Buf != nil {
input.Buf = append(input.Buf, dAtA...)
} else {
input.Buf = dAtA
}
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
x := input.Message.Interface().(*Commission)
if x == nil {
return protoiface.UnmarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Flags: input.Flags,
}, nil
}
options := runtime.UnmarshalInputToOptions(input)
_ = options
dAtA := input.Buf
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Commission: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Commission: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CommissionRates", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if x.CommissionRates == nil {
x.CommissionRates = &CommissionRates{}
}
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.CommissionRates); err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UpdateTime", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if x.UpdateTime == nil {
x.UpdateTime = ×tamppb.Timestamp{}
}
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.UpdateTime); err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
var (
md_Description protoreflect.MessageDescriptor
fd_Description_moniker protoreflect.FieldDescriptor
fd_Description_identity protoreflect.FieldDescriptor
fd_Description_website protoreflect.FieldDescriptor
fd_Description_security_contact protoreflect.FieldDescriptor
fd_Description_details protoreflect.FieldDescriptor
)
func init() {
file_cosmos_staking_v1beta1_staking_proto_init()
md_Description = File_cosmos_staking_v1beta1_staking_proto.Messages().ByName("Description")
fd_Description_moniker = md_Description.Fields().ByName("moniker")
fd_Description_identity = md_Description.Fields().ByName("identity")
fd_Description_website = md_Description.Fields().ByName("website")
fd_Description_security_contact = md_Description.Fields().ByName("security_contact")
fd_Description_details = md_Description.Fields().ByName("details")
}
var _ protoreflect.Message = (*fastReflection_Description)(nil)
type fastReflection_Description Description
func (x *Description) ProtoReflect() protoreflect.Message {
return (*fastReflection_Description)(x)
}
func (x *Description) slowProtoReflect() protoreflect.Message {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
var _fastReflection_Description_messageType fastReflection_Description_messageType
var _ protoreflect.MessageType = fastReflection_Description_messageType{}
type fastReflection_Description_messageType struct{}
func (x fastReflection_Description_messageType) Zero() protoreflect.Message {
return (*fastReflection_Description)(nil)
}
func (x fastReflection_Description_messageType) New() protoreflect.Message {
return new(fastReflection_Description)
}
func (x fastReflection_Description_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_Description
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_Description) Descriptor() protoreflect.MessageDescriptor {
return md_Description
}
// Type returns the message type, which encapsulates both Go and protobuf
// type information. If the Go type information is not needed,
// it is recommended that the message descriptor be used instead.
func (x *fastReflection_Description) Type() protoreflect.MessageType {
return _fastReflection_Description_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_Description) New() protoreflect.Message {
return new(fastReflection_Description)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_Description) Interface() protoreflect.ProtoMessage {
return (*Description)(x)
}
// Range iterates over every populated field in an undefined order,
// calling f for each field descriptor and value encountered.
// Range returns immediately if f returns false.
// While iterating, mutating operations may only be performed
// on the current field descriptor.
func (x *fastReflection_Description) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
if x.Moniker != "" {
value := protoreflect.ValueOfString(x.Moniker)
if !f(fd_Description_moniker, value) {
return
}
}
if x.Identity != "" {
value := protoreflect.ValueOfString(x.Identity)
if !f(fd_Description_identity, value) {
return
}
}
if x.Website != "" {
value := protoreflect.ValueOfString(x.Website)
if !f(fd_Description_website, value) {
return
}
}
if x.SecurityContact != "" {
value := protoreflect.ValueOfString(x.SecurityContact)
if !f(fd_Description_security_contact, value) {
return
}
}
if x.Details != "" {
value := protoreflect.ValueOfString(x.Details)
if !f(fd_Description_details, value) {
return
}
}
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_Description) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Description.moniker":
return x.Moniker != ""
case "cosmos.staking.v1beta1.Description.identity":
return x.Identity != ""
case "cosmos.staking.v1beta1.Description.website":
return x.Website != ""
case "cosmos.staking.v1beta1.Description.security_contact":
return x.SecurityContact != ""
case "cosmos.staking.v1beta1.Description.details":
return x.Details != ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Description"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Description does not contain field %s", fd.FullName()))
}
}
// Clear clears the field such that a subsequent Has call reports false.
//
// Clearing an extension field clears both the extension type and value
// associated with the given field number.
//
// Clear is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Description) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Description.moniker":
x.Moniker = ""
case "cosmos.staking.v1beta1.Description.identity":
x.Identity = ""
case "cosmos.staking.v1beta1.Description.website":
x.Website = ""
case "cosmos.staking.v1beta1.Description.security_contact":
x.SecurityContact = ""
case "cosmos.staking.v1beta1.Description.details":
x.Details = ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Description"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Description does not contain field %s", fd.FullName()))
}
}
// Get retrieves the value for a field.
//
// For unpopulated scalars, it returns the default value, where
// the default value of a bytes scalar is guaranteed to be a copy.
// For unpopulated composite types, it returns an empty, read-only view
// of the value; to obtain a mutable reference, use Mutable.
func (x *fastReflection_Description) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
case "cosmos.staking.v1beta1.Description.moniker":
value := x.Moniker
return protoreflect.ValueOfString(value)
case "cosmos.staking.v1beta1.Description.identity":
value := x.Identity
return protoreflect.ValueOfString(value)
case "cosmos.staking.v1beta1.Description.website":
value := x.Website
return protoreflect.ValueOfString(value)
case "cosmos.staking.v1beta1.Description.security_contact":
value := x.SecurityContact
return protoreflect.ValueOfString(value)
case "cosmos.staking.v1beta1.Description.details":
value := x.Details
return protoreflect.ValueOfString(value)
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Description"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Description does not contain field %s", descriptor.FullName()))
}
}
// Set stores the value for a field.
//
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType.
// When setting a composite type, it is unspecified whether the stored value
// aliases the source's memory in any way. If the composite value is an
// empty, read-only value, then it panics.
//
// Set is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Description) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Description.moniker":
x.Moniker = value.Interface().(string)
case "cosmos.staking.v1beta1.Description.identity":
x.Identity = value.Interface().(string)
case "cosmos.staking.v1beta1.Description.website":
x.Website = value.Interface().(string)
case "cosmos.staking.v1beta1.Description.security_contact":
x.SecurityContact = value.Interface().(string)
case "cosmos.staking.v1beta1.Description.details":
x.Details = value.Interface().(string)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Description"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Description does not contain field %s", fd.FullName()))
}
}
// Mutable returns a mutable reference to a composite type.
//
// If the field is unpopulated, it may allocate a composite value.
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType
// if not already stored.
// It panics if the field does not contain a composite type.
//
// Mutable is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Description) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Description.moniker":
panic(fmt.Errorf("field moniker of message cosmos.staking.v1beta1.Description is not mutable"))
case "cosmos.staking.v1beta1.Description.identity":
panic(fmt.Errorf("field identity of message cosmos.staking.v1beta1.Description is not mutable"))
case "cosmos.staking.v1beta1.Description.website":
panic(fmt.Errorf("field website of message cosmos.staking.v1beta1.Description is not mutable"))
case "cosmos.staking.v1beta1.Description.security_contact":
panic(fmt.Errorf("field security_contact of message cosmos.staking.v1beta1.Description is not mutable"))
case "cosmos.staking.v1beta1.Description.details":
panic(fmt.Errorf("field details of message cosmos.staking.v1beta1.Description is not mutable"))
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Description"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Description does not contain field %s", fd.FullName()))
}
}
// NewField returns a new value that is assignable to the field
// for the given descriptor. For scalars, this returns the default value.
// For lists, maps, and messages, this returns a new, empty, mutable value.
func (x *fastReflection_Description) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Description.moniker":
return protoreflect.ValueOfString("")
case "cosmos.staking.v1beta1.Description.identity":
return protoreflect.ValueOfString("")
case "cosmos.staking.v1beta1.Description.website":
return protoreflect.ValueOfString("")
case "cosmos.staking.v1beta1.Description.security_contact":
return protoreflect.ValueOfString("")
case "cosmos.staking.v1beta1.Description.details":
return protoreflect.ValueOfString("")
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Description"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Description does not contain field %s", fd.FullName()))
}
}
// WhichOneof reports which field within the oneof is populated,
// returning nil if none are populated.
// It panics if the oneof descriptor does not belong to this message.
func (x *fastReflection_Description) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in cosmos.staking.v1beta1.Description", d.FullName()))
}
panic("unreachable")
}
// GetUnknown retrieves the entire list of unknown fields.
// The caller may only mutate the contents of the RawFields
// if the mutated bytes are stored back into the message with SetUnknown.
func (x *fastReflection_Description) GetUnknown() protoreflect.RawFields {
return x.unknownFields
}
// SetUnknown stores an entire list of unknown fields.
// The raw fields must be syntactically valid according to the wire format.
// An implementation may panic if this is not the case.
// Once stored, the caller must not mutate the content of the RawFields.
// An empty RawFields may be passed to clear the fields.
//
// SetUnknown is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Description) SetUnknown(fields protoreflect.RawFields) {
x.unknownFields = fields
}
// IsValid reports whether the message is valid.
//
// An invalid message is an empty, read-only value.
//
// An invalid message often corresponds to a nil pointer of the concrete
// message type, but the details are implementation dependent.
// Validity is not part of the protobuf data model, and may not
// be preserved in marshaling or other operations.
func (x *fastReflection_Description) IsValid() bool {
return x != nil
}
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
// This method may return nil.
//
// The returned methods type is identical to
// "google.golang.org/protobuf/runtime/protoiface".Methods.
// Consult the protoiface package documentation for details.
func (x *fastReflection_Description) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*Description)
if x == nil {
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: 0,
}
}
options := runtime.SizeInputToOptions(input)
_ = options
var n int
var l int
_ = l
l = len(x.Moniker)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.Identity)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.Website)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.SecurityContact)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.Details)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: n,
}
}
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
x := input.Message.Interface().(*Description)
if x == nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
options := runtime.MarshalInputToOptions(input)
_ = options
size := options.Size(x)
dAtA := make([]byte, size)
i := len(dAtA)
_ = i
var l int
_ = l
if x.unknownFields != nil {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if len(x.Details) > 0 {
i -= len(x.Details)
copy(dAtA[i:], x.Details)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Details)))
i--
dAtA[i] = 0x2a
}
if len(x.SecurityContact) > 0 {
i -= len(x.SecurityContact)
copy(dAtA[i:], x.SecurityContact)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SecurityContact)))
i--
dAtA[i] = 0x22
}
if len(x.Website) > 0 {
i -= len(x.Website)
copy(dAtA[i:], x.Website)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Website)))
i--
dAtA[i] = 0x1a
}
if len(x.Identity) > 0 {
i -= len(x.Identity)
copy(dAtA[i:], x.Identity)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Identity)))
i--
dAtA[i] = 0x12
}
if len(x.Moniker) > 0 {
i -= len(x.Moniker)
copy(dAtA[i:], x.Moniker)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Moniker)))
i--
dAtA[i] = 0xa
}
if input.Buf != nil {
input.Buf = append(input.Buf, dAtA...)
} else {
input.Buf = dAtA
}
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
x := input.Message.Interface().(*Description)
if x == nil {
return protoiface.UnmarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Flags: input.Flags,
}, nil
}
options := runtime.UnmarshalInputToOptions(input)
_ = options
dAtA := input.Buf
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Description: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Description: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Moniker", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.Moniker = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Identity", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.Identity = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Website", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.Website = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 4:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SecurityContact", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.SecurityContact = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 5:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Details", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.Details = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
var (
md_Validator protoreflect.MessageDescriptor
fd_Validator_operator_address protoreflect.FieldDescriptor
fd_Validator_consensus_pubkey protoreflect.FieldDescriptor
fd_Validator_jailed protoreflect.FieldDescriptor
fd_Validator_status protoreflect.FieldDescriptor
fd_Validator_tokens protoreflect.FieldDescriptor
fd_Validator_delegator_shares protoreflect.FieldDescriptor
fd_Validator_description protoreflect.FieldDescriptor
fd_Validator_unbonding_height protoreflect.FieldDescriptor
fd_Validator_unbonding_time protoreflect.FieldDescriptor
fd_Validator_commission protoreflect.FieldDescriptor
fd_Validator_min_self_delegation protoreflect.FieldDescriptor
)
func init() {
file_cosmos_staking_v1beta1_staking_proto_init()
md_Validator = File_cosmos_staking_v1beta1_staking_proto.Messages().ByName("Validator")
fd_Validator_operator_address = md_Validator.Fields().ByName("operator_address")
fd_Validator_consensus_pubkey = md_Validator.Fields().ByName("consensus_pubkey")
fd_Validator_jailed = md_Validator.Fields().ByName("jailed")
fd_Validator_status = md_Validator.Fields().ByName("status")
fd_Validator_tokens = md_Validator.Fields().ByName("tokens")
fd_Validator_delegator_shares = md_Validator.Fields().ByName("delegator_shares")
fd_Validator_description = md_Validator.Fields().ByName("description")
fd_Validator_unbonding_height = md_Validator.Fields().ByName("unbonding_height")
fd_Validator_unbonding_time = md_Validator.Fields().ByName("unbonding_time")
fd_Validator_commission = md_Validator.Fields().ByName("commission")
fd_Validator_min_self_delegation = md_Validator.Fields().ByName("min_self_delegation")
}
var _ protoreflect.Message = (*fastReflection_Validator)(nil)
type fastReflection_Validator Validator
func (x *Validator) ProtoReflect() protoreflect.Message {
return (*fastReflection_Validator)(x)
}
func (x *Validator) slowProtoReflect() protoreflect.Message {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
var _fastReflection_Validator_messageType fastReflection_Validator_messageType
var _ protoreflect.MessageType = fastReflection_Validator_messageType{}
type fastReflection_Validator_messageType struct{}
func (x fastReflection_Validator_messageType) Zero() protoreflect.Message {
return (*fastReflection_Validator)(nil)
}
func (x fastReflection_Validator_messageType) New() protoreflect.Message {
return new(fastReflection_Validator)
}
func (x fastReflection_Validator_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_Validator
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_Validator) Descriptor() protoreflect.MessageDescriptor {
return md_Validator
}
// Type returns the message type, which encapsulates both Go and protobuf
// type information. If the Go type information is not needed,
// it is recommended that the message descriptor be used instead.
func (x *fastReflection_Validator) Type() protoreflect.MessageType {
return _fastReflection_Validator_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_Validator) New() protoreflect.Message {
return new(fastReflection_Validator)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_Validator) Interface() protoreflect.ProtoMessage {
return (*Validator)(x)
}
// Range iterates over every populated field in an undefined order,
// calling f for each field descriptor and value encountered.
// Range returns immediately if f returns false.
// While iterating, mutating operations may only be performed
// on the current field descriptor.
func (x *fastReflection_Validator) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
if x.OperatorAddress != "" {
value := protoreflect.ValueOfString(x.OperatorAddress)
if !f(fd_Validator_operator_address, value) {
return
}
}
if x.ConsensusPubkey != nil {
value := protoreflect.ValueOfMessage(x.ConsensusPubkey.ProtoReflect())
if !f(fd_Validator_consensus_pubkey, value) {
return
}
}
if x.Jailed != false {
value := protoreflect.ValueOfBool(x.Jailed)
if !f(fd_Validator_jailed, value) {
return
}
}
if x.Status != 0 {
value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Status))
if !f(fd_Validator_status, value) {
return
}
}
if x.Tokens != "" {
value := protoreflect.ValueOfString(x.Tokens)
if !f(fd_Validator_tokens, value) {
return
}
}
if x.DelegatorShares != "" {
value := protoreflect.ValueOfString(x.DelegatorShares)
if !f(fd_Validator_delegator_shares, value) {
return
}
}
if x.Description != nil {
value := protoreflect.ValueOfMessage(x.Description.ProtoReflect())
if !f(fd_Validator_description, value) {
return
}
}
if x.UnbondingHeight != int64(0) {
value := protoreflect.ValueOfInt64(x.UnbondingHeight)
if !f(fd_Validator_unbonding_height, value) {
return
}
}
if x.UnbondingTime != nil {
value := protoreflect.ValueOfMessage(x.UnbondingTime.ProtoReflect())
if !f(fd_Validator_unbonding_time, value) {
return
}
}
if x.Commission != nil {
value := protoreflect.ValueOfMessage(x.Commission.ProtoReflect())
if !f(fd_Validator_commission, value) {
return
}
}
if x.MinSelfDelegation != "" {
value := protoreflect.ValueOfString(x.MinSelfDelegation)
if !f(fd_Validator_min_self_delegation, value) {
return
}
}
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_Validator) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Validator.operator_address":
return x.OperatorAddress != ""
case "cosmos.staking.v1beta1.Validator.consensus_pubkey":
return x.ConsensusPubkey != nil
case "cosmos.staking.v1beta1.Validator.jailed":
return x.Jailed != false
case "cosmos.staking.v1beta1.Validator.status":
return x.Status != 0
case "cosmos.staking.v1beta1.Validator.tokens":
return x.Tokens != ""
case "cosmos.staking.v1beta1.Validator.delegator_shares":
return x.DelegatorShares != ""
case "cosmos.staking.v1beta1.Validator.description":
return x.Description != nil
case "cosmos.staking.v1beta1.Validator.unbonding_height":
return x.UnbondingHeight != int64(0)
case "cosmos.staking.v1beta1.Validator.unbonding_time":
return x.UnbondingTime != nil
case "cosmos.staking.v1beta1.Validator.commission":
return x.Commission != nil
case "cosmos.staking.v1beta1.Validator.min_self_delegation":
return x.MinSelfDelegation != ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Validator"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Validator does not contain field %s", fd.FullName()))
}
}
// Clear clears the field such that a subsequent Has call reports false.
//
// Clearing an extension field clears both the extension type and value
// associated with the given field number.
//
// Clear is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Validator) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Validator.operator_address":
x.OperatorAddress = ""
case "cosmos.staking.v1beta1.Validator.consensus_pubkey":
x.ConsensusPubkey = nil
case "cosmos.staking.v1beta1.Validator.jailed":
x.Jailed = false
case "cosmos.staking.v1beta1.Validator.status":
x.Status = 0
case "cosmos.staking.v1beta1.Validator.tokens":
x.Tokens = ""
case "cosmos.staking.v1beta1.Validator.delegator_shares":
x.DelegatorShares = ""
case "cosmos.staking.v1beta1.Validator.description":
x.Description = nil
case "cosmos.staking.v1beta1.Validator.unbonding_height":
x.UnbondingHeight = int64(0)
case "cosmos.staking.v1beta1.Validator.unbonding_time":
x.UnbondingTime = nil
case "cosmos.staking.v1beta1.Validator.commission":
x.Commission = nil
case "cosmos.staking.v1beta1.Validator.min_self_delegation":
x.MinSelfDelegation = ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Validator"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Validator does not contain field %s", fd.FullName()))
}
}
// Get retrieves the value for a field.
//
// For unpopulated scalars, it returns the default value, where
// the default value of a bytes scalar is guaranteed to be a copy.
// For unpopulated composite types, it returns an empty, read-only view
// of the value; to obtain a mutable reference, use Mutable.
func (x *fastReflection_Validator) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
case "cosmos.staking.v1beta1.Validator.operator_address":
value := x.OperatorAddress
return protoreflect.ValueOfString(value)
case "cosmos.staking.v1beta1.Validator.consensus_pubkey":
value := x.ConsensusPubkey
return protoreflect.ValueOfMessage(value.ProtoReflect())
case "cosmos.staking.v1beta1.Validator.jailed":
value := x.Jailed
return protoreflect.ValueOfBool(value)
case "cosmos.staking.v1beta1.Validator.status":
value := x.Status
return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value))
case "cosmos.staking.v1beta1.Validator.tokens":
value := x.Tokens
return protoreflect.ValueOfString(value)
case "cosmos.staking.v1beta1.Validator.delegator_shares":
value := x.DelegatorShares
return protoreflect.ValueOfString(value)
case "cosmos.staking.v1beta1.Validator.description":
value := x.Description
return protoreflect.ValueOfMessage(value.ProtoReflect())
case "cosmos.staking.v1beta1.Validator.unbonding_height":
value := x.UnbondingHeight
return protoreflect.ValueOfInt64(value)
case "cosmos.staking.v1beta1.Validator.unbonding_time":
value := x.UnbondingTime
return protoreflect.ValueOfMessage(value.ProtoReflect())
case "cosmos.staking.v1beta1.Validator.commission":
value := x.Commission
return protoreflect.ValueOfMessage(value.ProtoReflect())
case "cosmos.staking.v1beta1.Validator.min_self_delegation":
value := x.MinSelfDelegation
return protoreflect.ValueOfString(value)
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Validator"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Validator does not contain field %s", descriptor.FullName()))
}
}
// Set stores the value for a field.
//
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType.
// When setting a composite type, it is unspecified whether the stored value
// aliases the source's memory in any way. If the composite value is an
// empty, read-only value, then it panics.
//
// Set is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Validator) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Validator.operator_address":
x.OperatorAddress = value.Interface().(string)
case "cosmos.staking.v1beta1.Validator.consensus_pubkey":
x.ConsensusPubkey = value.Message().Interface().(*anypb.Any)
case "cosmos.staking.v1beta1.Validator.jailed":
x.Jailed = value.Bool()
case "cosmos.staking.v1beta1.Validator.status":
x.Status = (BondStatus)(value.Enum())
case "cosmos.staking.v1beta1.Validator.tokens":
x.Tokens = value.Interface().(string)
case "cosmos.staking.v1beta1.Validator.delegator_shares":
x.DelegatorShares = value.Interface().(string)
case "cosmos.staking.v1beta1.Validator.description":
x.Description = value.Message().Interface().(*Description)
case "cosmos.staking.v1beta1.Validator.unbonding_height":
x.UnbondingHeight = value.Int()
case "cosmos.staking.v1beta1.Validator.unbonding_time":
x.UnbondingTime = value.Message().Interface().(*timestamppb.Timestamp)
case "cosmos.staking.v1beta1.Validator.commission":
x.Commission = value.Message().Interface().(*Commission)
case "cosmos.staking.v1beta1.Validator.min_self_delegation":
x.MinSelfDelegation = value.Interface().(string)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Validator"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Validator does not contain field %s", fd.FullName()))
}
}
// Mutable returns a mutable reference to a composite type.
//
// If the field is unpopulated, it may allocate a composite value.
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType
// if not already stored.
// It panics if the field does not contain a composite type.
//
// Mutable is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Validator) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Validator.consensus_pubkey":
if x.ConsensusPubkey == nil {
x.ConsensusPubkey = new(anypb.Any)
}
return protoreflect.ValueOfMessage(x.ConsensusPubkey.ProtoReflect())
case "cosmos.staking.v1beta1.Validator.description":
if x.Description == nil {
x.Description = new(Description)
}
return protoreflect.ValueOfMessage(x.Description.ProtoReflect())
case "cosmos.staking.v1beta1.Validator.unbonding_time":
if x.UnbondingTime == nil {
x.UnbondingTime = new(timestamppb.Timestamp)
}
return protoreflect.ValueOfMessage(x.UnbondingTime.ProtoReflect())
case "cosmos.staking.v1beta1.Validator.commission":
if x.Commission == nil {
x.Commission = new(Commission)
}
return protoreflect.ValueOfMessage(x.Commission.ProtoReflect())
case "cosmos.staking.v1beta1.Validator.operator_address":
panic(fmt.Errorf("field operator_address of message cosmos.staking.v1beta1.Validator is not mutable"))
case "cosmos.staking.v1beta1.Validator.jailed":
panic(fmt.Errorf("field jailed of message cosmos.staking.v1beta1.Validator is not mutable"))
case "cosmos.staking.v1beta1.Validator.status":
panic(fmt.Errorf("field status of message cosmos.staking.v1beta1.Validator is not mutable"))
case "cosmos.staking.v1beta1.Validator.tokens":
panic(fmt.Errorf("field tokens of message cosmos.staking.v1beta1.Validator is not mutable"))
case "cosmos.staking.v1beta1.Validator.delegator_shares":
panic(fmt.Errorf("field delegator_shares of message cosmos.staking.v1beta1.Validator is not mutable"))
case "cosmos.staking.v1beta1.Validator.unbonding_height":
panic(fmt.Errorf("field unbonding_height of message cosmos.staking.v1beta1.Validator is not mutable"))
case "cosmos.staking.v1beta1.Validator.min_self_delegation":
panic(fmt.Errorf("field min_self_delegation of message cosmos.staking.v1beta1.Validator is not mutable"))
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Validator"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Validator does not contain field %s", fd.FullName()))
}
}
// NewField returns a new value that is assignable to the field
// for the given descriptor. For scalars, this returns the default value.
// For lists, maps, and messages, this returns a new, empty, mutable value.
func (x *fastReflection_Validator) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Validator.operator_address":
return protoreflect.ValueOfString("")
case "cosmos.staking.v1beta1.Validator.consensus_pubkey":
m := new(anypb.Any)
return protoreflect.ValueOfMessage(m.ProtoReflect())
case "cosmos.staking.v1beta1.Validator.jailed":
return protoreflect.ValueOfBool(false)
case "cosmos.staking.v1beta1.Validator.status":
return protoreflect.ValueOfEnum(0)
case "cosmos.staking.v1beta1.Validator.tokens":
return protoreflect.ValueOfString("")
case "cosmos.staking.v1beta1.Validator.delegator_shares":
return protoreflect.ValueOfString("")
case "cosmos.staking.v1beta1.Validator.description":
m := new(Description)
return protoreflect.ValueOfMessage(m.ProtoReflect())
case "cosmos.staking.v1beta1.Validator.unbonding_height":
return protoreflect.ValueOfInt64(int64(0))
case "cosmos.staking.v1beta1.Validator.unbonding_time":
m := new(timestamppb.Timestamp)
return protoreflect.ValueOfMessage(m.ProtoReflect())
case "cosmos.staking.v1beta1.Validator.commission":
m := new(Commission)
return protoreflect.ValueOfMessage(m.ProtoReflect())
case "cosmos.staking.v1beta1.Validator.min_self_delegation":
return protoreflect.ValueOfString("")
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Validator"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Validator does not contain field %s", fd.FullName()))
}
}
// WhichOneof reports which field within the oneof is populated,
// returning nil if none are populated.
// It panics if the oneof descriptor does not belong to this message.
func (x *fastReflection_Validator) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in cosmos.staking.v1beta1.Validator", d.FullName()))
}
panic("unreachable")
}
// GetUnknown retrieves the entire list of unknown fields.
// The caller may only mutate the contents of the RawFields
// if the mutated bytes are stored back into the message with SetUnknown.
func (x *fastReflection_Validator) GetUnknown() protoreflect.RawFields {
return x.unknownFields
}
// SetUnknown stores an entire list of unknown fields.
// The raw fields must be syntactically valid according to the wire format.
// An implementation may panic if this is not the case.
// Once stored, the caller must not mutate the content of the RawFields.
// An empty RawFields may be passed to clear the fields.
//
// SetUnknown is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Validator) SetUnknown(fields protoreflect.RawFields) {
x.unknownFields = fields
}
// IsValid reports whether the message is valid.
//
// An invalid message is an empty, read-only value.
//
// An invalid message often corresponds to a nil pointer of the concrete
// message type, but the details are implementation dependent.
// Validity is not part of the protobuf data model, and may not
// be preserved in marshaling or other operations.
func (x *fastReflection_Validator) IsValid() bool {
return x != nil
}
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
// This method may return nil.
//
// The returned methods type is identical to
// "google.golang.org/protobuf/runtime/protoiface".Methods.
// Consult the protoiface package documentation for details.
func (x *fastReflection_Validator) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*Validator)
if x == nil {
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: 0,
}
}
options := runtime.SizeInputToOptions(input)
_ = options
var n int
var l int
_ = l
l = len(x.OperatorAddress)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
if x.ConsensusPubkey != nil {
l = options.Size(x.ConsensusPubkey)
n += 1 + l + runtime.Sov(uint64(l))
}
if x.Jailed {
n += 2
}
if x.Status != 0 {
n += 1 + runtime.Sov(uint64(x.Status))
}
l = len(x.Tokens)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.DelegatorShares)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
if x.Description != nil {
l = options.Size(x.Description)
n += 1 + l + runtime.Sov(uint64(l))
}
if x.UnbondingHeight != 0 {
n += 1 + runtime.Sov(uint64(x.UnbondingHeight))
}
if x.UnbondingTime != nil {
l = options.Size(x.UnbondingTime)
n += 1 + l + runtime.Sov(uint64(l))
}
if x.Commission != nil {
l = options.Size(x.Commission)
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.MinSelfDelegation)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: n,
}
}
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
x := input.Message.Interface().(*Validator)
if x == nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
options := runtime.MarshalInputToOptions(input)
_ = options
size := options.Size(x)
dAtA := make([]byte, size)
i := len(dAtA)
_ = i
var l int
_ = l
if x.unknownFields != nil {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if len(x.MinSelfDelegation) > 0 {
i -= len(x.MinSelfDelegation)
copy(dAtA[i:], x.MinSelfDelegation)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MinSelfDelegation)))
i--
dAtA[i] = 0x5a
}
if x.Commission != nil {
encoded, err := options.Marshal(x.Commission)
if err != nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, err
}
i -= len(encoded)
copy(dAtA[i:], encoded)
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
i--
dAtA[i] = 0x52
}
if x.UnbondingTime != nil {
encoded, err := options.Marshal(x.UnbondingTime)
if err != nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, err
}
i -= len(encoded)
copy(dAtA[i:], encoded)
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
i--
dAtA[i] = 0x4a
}
if x.UnbondingHeight != 0 {
i = runtime.EncodeVarint(dAtA, i, uint64(x.UnbondingHeight))
i--
dAtA[i] = 0x40
}
if x.Description != nil {
encoded, err := options.Marshal(x.Description)
if err != nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, err
}
i -= len(encoded)
copy(dAtA[i:], encoded)
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
i--
dAtA[i] = 0x3a
}
if len(x.DelegatorShares) > 0 {
i -= len(x.DelegatorShares)
copy(dAtA[i:], x.DelegatorShares)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DelegatorShares)))
i--
dAtA[i] = 0x32
}
if len(x.Tokens) > 0 {
i -= len(x.Tokens)
copy(dAtA[i:], x.Tokens)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Tokens)))
i--
dAtA[i] = 0x2a
}
if x.Status != 0 {
i = runtime.EncodeVarint(dAtA, i, uint64(x.Status))
i--
dAtA[i] = 0x20
}
if x.Jailed {
i--
if x.Jailed {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x18
}
if x.ConsensusPubkey != nil {
encoded, err := options.Marshal(x.ConsensusPubkey)
if err != nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, err
}
i -= len(encoded)
copy(dAtA[i:], encoded)
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
i--
dAtA[i] = 0x12
}
if len(x.OperatorAddress) > 0 {
i -= len(x.OperatorAddress)
copy(dAtA[i:], x.OperatorAddress)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.OperatorAddress)))
i--
dAtA[i] = 0xa
}
if input.Buf != nil {
input.Buf = append(input.Buf, dAtA...)
} else {
input.Buf = dAtA
}
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
x := input.Message.Interface().(*Validator)
if x == nil {
return protoiface.UnmarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Flags: input.Flags,
}, nil
}
options := runtime.UnmarshalInputToOptions(input)
_ = options
dAtA := input.Buf
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Validator: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Validator: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OperatorAddress", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.OperatorAddress = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ConsensusPubkey", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if x.ConsensusPubkey == nil {
x.ConsensusPubkey = &anypb.Any{}
}
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ConsensusPubkey); err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
iNdEx = postIndex
case 3:
if wireType != 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Jailed", wireType)
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
x.Jailed = bool(v != 0)
case 4:
if wireType != 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
}
x.Status = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
x.Status |= BondStatus(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 5:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Tokens", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.Tokens = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 6:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DelegatorShares", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.DelegatorShares = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 7:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Description", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if x.Description == nil {
x.Description = &Description{}
}
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Description); err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
iNdEx = postIndex
case 8:
if wireType != 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UnbondingHeight", wireType)
}
x.UnbondingHeight = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
x.UnbondingHeight |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 9:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UnbondingTime", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if x.UnbondingTime == nil {
x.UnbondingTime = ×tamppb.Timestamp{}
}
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.UnbondingTime); err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
iNdEx = postIndex
case 10:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Commission", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if x.Commission == nil {
x.Commission = &Commission{}
}
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Commission); err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
iNdEx = postIndex
case 11:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MinSelfDelegation", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.MinSelfDelegation = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
var _ protoreflect.List = (*_ValAddresses_1_list)(nil)
type _ValAddresses_1_list struct {
list *[]string
}
func (x *_ValAddresses_1_list) Len() int {
if x.list == nil {
return 0
}
return len(*x.list)
}
func (x *_ValAddresses_1_list) Get(i int) protoreflect.Value {
return protoreflect.ValueOfString((*x.list)[i])
}
func (x *_ValAddresses_1_list) Set(i int, value protoreflect.Value) {
valueUnwrapped := value.String()
concreteValue := valueUnwrapped
(*x.list)[i] = concreteValue
}
func (x *_ValAddresses_1_list) Append(value protoreflect.Value) {
valueUnwrapped := value.String()
concreteValue := valueUnwrapped
*x.list = append(*x.list, concreteValue)
}
func (x *_ValAddresses_1_list) AppendMutable() protoreflect.Value {
panic(fmt.Errorf("AppendMutable can not be called on message ValAddresses at list field Addresses as it is not of Message kind"))
}
func (x *_ValAddresses_1_list) Truncate(n int) {
*x.list = (*x.list)[:n]
}
func (x *_ValAddresses_1_list) NewElement() protoreflect.Value {
v := ""
return protoreflect.ValueOfString(v)
}
func (x *_ValAddresses_1_list) IsValid() bool {
return x.list != nil
}
var (
md_ValAddresses protoreflect.MessageDescriptor
fd_ValAddresses_addresses protoreflect.FieldDescriptor
)
func init() {
file_cosmos_staking_v1beta1_staking_proto_init()
md_ValAddresses = File_cosmos_staking_v1beta1_staking_proto.Messages().ByName("ValAddresses")
fd_ValAddresses_addresses = md_ValAddresses.Fields().ByName("addresses")
}
var _ protoreflect.Message = (*fastReflection_ValAddresses)(nil)
type fastReflection_ValAddresses ValAddresses
func (x *ValAddresses) ProtoReflect() protoreflect.Message {
return (*fastReflection_ValAddresses)(x)
}
func (x *ValAddresses) slowProtoReflect() protoreflect.Message {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
var _fastReflection_ValAddresses_messageType fastReflection_ValAddresses_messageType
var _ protoreflect.MessageType = fastReflection_ValAddresses_messageType{}
type fastReflection_ValAddresses_messageType struct{}
func (x fastReflection_ValAddresses_messageType) Zero() protoreflect.Message {
return (*fastReflection_ValAddresses)(nil)
}
func (x fastReflection_ValAddresses_messageType) New() protoreflect.Message {
return new(fastReflection_ValAddresses)
}
func (x fastReflection_ValAddresses_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_ValAddresses
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_ValAddresses) Descriptor() protoreflect.MessageDescriptor {
return md_ValAddresses
}
// Type returns the message type, which encapsulates both Go and protobuf
// type information. If the Go type information is not needed,
// it is recommended that the message descriptor be used instead.
func (x *fastReflection_ValAddresses) Type() protoreflect.MessageType {
return _fastReflection_ValAddresses_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_ValAddresses) New() protoreflect.Message {
return new(fastReflection_ValAddresses)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_ValAddresses) Interface() protoreflect.ProtoMessage {
return (*ValAddresses)(x)
}
// Range iterates over every populated field in an undefined order,
// calling f for each field descriptor and value encountered.
// Range returns immediately if f returns false.
// While iterating, mutating operations may only be performed
// on the current field descriptor.
func (x *fastReflection_ValAddresses) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
if len(x.Addresses) != 0 {
value := protoreflect.ValueOfList(&_ValAddresses_1_list{list: &x.Addresses})
if !f(fd_ValAddresses_addresses, value) {
return
}
}
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_ValAddresses) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
case "cosmos.staking.v1beta1.ValAddresses.addresses":
return len(x.Addresses) != 0
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.ValAddresses"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.ValAddresses does not contain field %s", fd.FullName()))
}
}
// Clear clears the field such that a subsequent Has call reports false.
//
// Clearing an extension field clears both the extension type and value
// associated with the given field number.
//
// Clear is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_ValAddresses) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.ValAddresses.addresses":
x.Addresses = nil
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.ValAddresses"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.ValAddresses does not contain field %s", fd.FullName()))
}
}
// Get retrieves the value for a field.
//
// For unpopulated scalars, it returns the default value, where
// the default value of a bytes scalar is guaranteed to be a copy.
// For unpopulated composite types, it returns an empty, read-only view
// of the value; to obtain a mutable reference, use Mutable.
func (x *fastReflection_ValAddresses) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
case "cosmos.staking.v1beta1.ValAddresses.addresses":
if len(x.Addresses) == 0 {
return protoreflect.ValueOfList(&_ValAddresses_1_list{})
}
listValue := &_ValAddresses_1_list{list: &x.Addresses}
return protoreflect.ValueOfList(listValue)
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.ValAddresses"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.ValAddresses does not contain field %s", descriptor.FullName()))
}
}
// Set stores the value for a field.
//
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType.
// When setting a composite type, it is unspecified whether the stored value
// aliases the source's memory in any way. If the composite value is an
// empty, read-only value, then it panics.
//
// Set is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_ValAddresses) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.ValAddresses.addresses":
lv := value.List()
clv := lv.(*_ValAddresses_1_list)
x.Addresses = *clv.list
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.ValAddresses"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.ValAddresses does not contain field %s", fd.FullName()))
}
}
// Mutable returns a mutable reference to a composite type.
//
// If the field is unpopulated, it may allocate a composite value.
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType
// if not already stored.
// It panics if the field does not contain a composite type.
//
// Mutable is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_ValAddresses) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.ValAddresses.addresses":
if x.Addresses == nil {
x.Addresses = []string{}
}
value := &_ValAddresses_1_list{list: &x.Addresses}
return protoreflect.ValueOfList(value)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.ValAddresses"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.ValAddresses does not contain field %s", fd.FullName()))
}
}
// NewField returns a new value that is assignable to the field
// for the given descriptor. For scalars, this returns the default value.
// For lists, maps, and messages, this returns a new, empty, mutable value.
func (x *fastReflection_ValAddresses) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.ValAddresses.addresses":
list := []string{}
return protoreflect.ValueOfList(&_ValAddresses_1_list{list: &list})
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.ValAddresses"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.ValAddresses does not contain field %s", fd.FullName()))
}
}
// WhichOneof reports which field within the oneof is populated,
// returning nil if none are populated.
// It panics if the oneof descriptor does not belong to this message.
func (x *fastReflection_ValAddresses) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in cosmos.staking.v1beta1.ValAddresses", d.FullName()))
}
panic("unreachable")
}
// GetUnknown retrieves the entire list of unknown fields.
// The caller may only mutate the contents of the RawFields
// if the mutated bytes are stored back into the message with SetUnknown.
func (x *fastReflection_ValAddresses) GetUnknown() protoreflect.RawFields {
return x.unknownFields
}
// SetUnknown stores an entire list of unknown fields.
// The raw fields must be syntactically valid according to the wire format.
// An implementation may panic if this is not the case.
// Once stored, the caller must not mutate the content of the RawFields.
// An empty RawFields may be passed to clear the fields.
//
// SetUnknown is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_ValAddresses) SetUnknown(fields protoreflect.RawFields) {
x.unknownFields = fields
}
// IsValid reports whether the message is valid.
//
// An invalid message is an empty, read-only value.
//
// An invalid message often corresponds to a nil pointer of the concrete
// message type, but the details are implementation dependent.
// Validity is not part of the protobuf data model, and may not
// be preserved in marshaling or other operations.
func (x *fastReflection_ValAddresses) IsValid() bool {
return x != nil
}
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
// This method may return nil.
//
// The returned methods type is identical to
// "google.golang.org/protobuf/runtime/protoiface".Methods.
// Consult the protoiface package documentation for details.
func (x *fastReflection_ValAddresses) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*ValAddresses)
if x == nil {
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: 0,
}
}
options := runtime.SizeInputToOptions(input)
_ = options
var n int
var l int
_ = l
if len(x.Addresses) > 0 {
for _, s := range x.Addresses {
l = len(s)
n += 1 + l + runtime.Sov(uint64(l))
}
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: n,
}
}
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
x := input.Message.Interface().(*ValAddresses)
if x == nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
options := runtime.MarshalInputToOptions(input)
_ = options
size := options.Size(x)
dAtA := make([]byte, size)
i := len(dAtA)
_ = i
var l int
_ = l
if x.unknownFields != nil {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if len(x.Addresses) > 0 {
for iNdEx := len(x.Addresses) - 1; iNdEx >= 0; iNdEx-- {
i -= len(x.Addresses[iNdEx])
copy(dAtA[i:], x.Addresses[iNdEx])
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Addresses[iNdEx])))
i--
dAtA[i] = 0xa
}
}
if input.Buf != nil {
input.Buf = append(input.Buf, dAtA...)
} else {
input.Buf = dAtA
}
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
x := input.Message.Interface().(*ValAddresses)
if x == nil {
return protoiface.UnmarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Flags: input.Flags,
}, nil
}
options := runtime.UnmarshalInputToOptions(input)
_ = options
dAtA := input.Buf
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ValAddresses: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ValAddresses: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Addresses", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.Addresses = append(x.Addresses, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
var (
md_DVPair protoreflect.MessageDescriptor
fd_DVPair_delegator_address protoreflect.FieldDescriptor
fd_DVPair_validator_address protoreflect.FieldDescriptor
)
func init() {
file_cosmos_staking_v1beta1_staking_proto_init()
md_DVPair = File_cosmos_staking_v1beta1_staking_proto.Messages().ByName("DVPair")
fd_DVPair_delegator_address = md_DVPair.Fields().ByName("delegator_address")
fd_DVPair_validator_address = md_DVPair.Fields().ByName("validator_address")
}
var _ protoreflect.Message = (*fastReflection_DVPair)(nil)
type fastReflection_DVPair DVPair
func (x *DVPair) ProtoReflect() protoreflect.Message {
return (*fastReflection_DVPair)(x)
}
func (x *DVPair) slowProtoReflect() protoreflect.Message {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
var _fastReflection_DVPair_messageType fastReflection_DVPair_messageType
var _ protoreflect.MessageType = fastReflection_DVPair_messageType{}
type fastReflection_DVPair_messageType struct{}
func (x fastReflection_DVPair_messageType) Zero() protoreflect.Message {
return (*fastReflection_DVPair)(nil)
}
func (x fastReflection_DVPair_messageType) New() protoreflect.Message {
return new(fastReflection_DVPair)
}
func (x fastReflection_DVPair_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_DVPair
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_DVPair) Descriptor() protoreflect.MessageDescriptor {
return md_DVPair
}
// Type returns the message type, which encapsulates both Go and protobuf
// type information. If the Go type information is not needed,
// it is recommended that the message descriptor be used instead.
func (x *fastReflection_DVPair) Type() protoreflect.MessageType {
return _fastReflection_DVPair_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_DVPair) New() protoreflect.Message {
return new(fastReflection_DVPair)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_DVPair) Interface() protoreflect.ProtoMessage {
return (*DVPair)(x)
}
// Range iterates over every populated field in an undefined order,
// calling f for each field descriptor and value encountered.
// Range returns immediately if f returns false.
// While iterating, mutating operations may only be performed
// on the current field descriptor.
func (x *fastReflection_DVPair) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
if x.DelegatorAddress != "" {
value := protoreflect.ValueOfString(x.DelegatorAddress)
if !f(fd_DVPair_delegator_address, value) {
return
}
}
if x.ValidatorAddress != "" {
value := protoreflect.ValueOfString(x.ValidatorAddress)
if !f(fd_DVPair_validator_address, value) {
return
}
}
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_DVPair) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
case "cosmos.staking.v1beta1.DVPair.delegator_address":
return x.DelegatorAddress != ""
case "cosmos.staking.v1beta1.DVPair.validator_address":
return x.ValidatorAddress != ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DVPair"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DVPair does not contain field %s", fd.FullName()))
}
}
// Clear clears the field such that a subsequent Has call reports false.
//
// Clearing an extension field clears both the extension type and value
// associated with the given field number.
//
// Clear is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_DVPair) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.DVPair.delegator_address":
x.DelegatorAddress = ""
case "cosmos.staking.v1beta1.DVPair.validator_address":
x.ValidatorAddress = ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DVPair"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DVPair does not contain field %s", fd.FullName()))
}
}
// Get retrieves the value for a field.
//
// For unpopulated scalars, it returns the default value, where
// the default value of a bytes scalar is guaranteed to be a copy.
// For unpopulated composite types, it returns an empty, read-only view
// of the value; to obtain a mutable reference, use Mutable.
func (x *fastReflection_DVPair) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
case "cosmos.staking.v1beta1.DVPair.delegator_address":
value := x.DelegatorAddress
return protoreflect.ValueOfString(value)
case "cosmos.staking.v1beta1.DVPair.validator_address":
value := x.ValidatorAddress
return protoreflect.ValueOfString(value)
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DVPair"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DVPair does not contain field %s", descriptor.FullName()))
}
}
// Set stores the value for a field.
//
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType.
// When setting a composite type, it is unspecified whether the stored value
// aliases the source's memory in any way. If the composite value is an
// empty, read-only value, then it panics.
//
// Set is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_DVPair) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.DVPair.delegator_address":
x.DelegatorAddress = value.Interface().(string)
case "cosmos.staking.v1beta1.DVPair.validator_address":
x.ValidatorAddress = value.Interface().(string)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DVPair"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DVPair does not contain field %s", fd.FullName()))
}
}
// Mutable returns a mutable reference to a composite type.
//
// If the field is unpopulated, it may allocate a composite value.
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType
// if not already stored.
// It panics if the field does not contain a composite type.
//
// Mutable is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_DVPair) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.DVPair.delegator_address":
panic(fmt.Errorf("field delegator_address of message cosmos.staking.v1beta1.DVPair is not mutable"))
case "cosmos.staking.v1beta1.DVPair.validator_address":
panic(fmt.Errorf("field validator_address of message cosmos.staking.v1beta1.DVPair is not mutable"))
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DVPair"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DVPair does not contain field %s", fd.FullName()))
}
}
// NewField returns a new value that is assignable to the field
// for the given descriptor. For scalars, this returns the default value.
// For lists, maps, and messages, this returns a new, empty, mutable value.
func (x *fastReflection_DVPair) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.DVPair.delegator_address":
return protoreflect.ValueOfString("")
case "cosmos.staking.v1beta1.DVPair.validator_address":
return protoreflect.ValueOfString("")
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DVPair"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DVPair does not contain field %s", fd.FullName()))
}
}
// WhichOneof reports which field within the oneof is populated,
// returning nil if none are populated.
// It panics if the oneof descriptor does not belong to this message.
func (x *fastReflection_DVPair) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in cosmos.staking.v1beta1.DVPair", d.FullName()))
}
panic("unreachable")
}
// GetUnknown retrieves the entire list of unknown fields.
// The caller may only mutate the contents of the RawFields
// if the mutated bytes are stored back into the message with SetUnknown.
func (x *fastReflection_DVPair) GetUnknown() protoreflect.RawFields {
return x.unknownFields
}
// SetUnknown stores an entire list of unknown fields.
// The raw fields must be syntactically valid according to the wire format.
// An implementation may panic if this is not the case.
// Once stored, the caller must not mutate the content of the RawFields.
// An empty RawFields may be passed to clear the fields.
//
// SetUnknown is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_DVPair) SetUnknown(fields protoreflect.RawFields) {
x.unknownFields = fields
}
// IsValid reports whether the message is valid.
//
// An invalid message is an empty, read-only value.
//
// An invalid message often corresponds to a nil pointer of the concrete
// message type, but the details are implementation dependent.
// Validity is not part of the protobuf data model, and may not
// be preserved in marshaling or other operations.
func (x *fastReflection_DVPair) IsValid() bool {
return x != nil
}
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
// This method may return nil.
//
// The returned methods type is identical to
// "google.golang.org/protobuf/runtime/protoiface".Methods.
// Consult the protoiface package documentation for details.
func (x *fastReflection_DVPair) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*DVPair)
if x == nil {
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: 0,
}
}
options := runtime.SizeInputToOptions(input)
_ = options
var n int
var l int
_ = l
l = len(x.DelegatorAddress)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.ValidatorAddress)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: n,
}
}
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
x := input.Message.Interface().(*DVPair)
if x == nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
options := runtime.MarshalInputToOptions(input)
_ = options
size := options.Size(x)
dAtA := make([]byte, size)
i := len(dAtA)
_ = i
var l int
_ = l
if x.unknownFields != nil {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if len(x.ValidatorAddress) > 0 {
i -= len(x.ValidatorAddress)
copy(dAtA[i:], x.ValidatorAddress)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorAddress)))
i--
dAtA[i] = 0x12
}
if len(x.DelegatorAddress) > 0 {
i -= len(x.DelegatorAddress)
copy(dAtA[i:], x.DelegatorAddress)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DelegatorAddress)))
i--
dAtA[i] = 0xa
}
if input.Buf != nil {
input.Buf = append(input.Buf, dAtA...)
} else {
input.Buf = dAtA
}
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
x := input.Message.Interface().(*DVPair)
if x == nil {
return protoiface.UnmarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Flags: input.Flags,
}, nil
}
options := runtime.UnmarshalInputToOptions(input)
_ = options
dAtA := input.Buf
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DVPair: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DVPair: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.DelegatorAddress = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.ValidatorAddress = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
var _ protoreflect.List = (*_DVPairs_1_list)(nil)
type _DVPairs_1_list struct {
list *[]*DVPair
}
func (x *_DVPairs_1_list) Len() int {
if x.list == nil {
return 0
}
return len(*x.list)
}
func (x *_DVPairs_1_list) Get(i int) protoreflect.Value {
return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect())
}
func (x *_DVPairs_1_list) Set(i int, value protoreflect.Value) {
valueUnwrapped := value.Message()
concreteValue := valueUnwrapped.Interface().(*DVPair)
(*x.list)[i] = concreteValue
}
func (x *_DVPairs_1_list) Append(value protoreflect.Value) {
valueUnwrapped := value.Message()
concreteValue := valueUnwrapped.Interface().(*DVPair)
*x.list = append(*x.list, concreteValue)
}
func (x *_DVPairs_1_list) AppendMutable() protoreflect.Value {
v := new(DVPair)
*x.list = append(*x.list, v)
return protoreflect.ValueOfMessage(v.ProtoReflect())
}
func (x *_DVPairs_1_list) Truncate(n int) {
for i := n; i < len(*x.list); i++ {
(*x.list)[i] = nil
}
*x.list = (*x.list)[:n]
}
func (x *_DVPairs_1_list) NewElement() protoreflect.Value {
v := new(DVPair)
return protoreflect.ValueOfMessage(v.ProtoReflect())
}
func (x *_DVPairs_1_list) IsValid() bool {
return x.list != nil
}
var (
md_DVPairs protoreflect.MessageDescriptor
fd_DVPairs_pairs protoreflect.FieldDescriptor
)
func init() {
file_cosmos_staking_v1beta1_staking_proto_init()
md_DVPairs = File_cosmos_staking_v1beta1_staking_proto.Messages().ByName("DVPairs")
fd_DVPairs_pairs = md_DVPairs.Fields().ByName("pairs")
}
var _ protoreflect.Message = (*fastReflection_DVPairs)(nil)
type fastReflection_DVPairs DVPairs
func (x *DVPairs) ProtoReflect() protoreflect.Message {
return (*fastReflection_DVPairs)(x)
}
func (x *DVPairs) slowProtoReflect() protoreflect.Message {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
var _fastReflection_DVPairs_messageType fastReflection_DVPairs_messageType
var _ protoreflect.MessageType = fastReflection_DVPairs_messageType{}
type fastReflection_DVPairs_messageType struct{}
func (x fastReflection_DVPairs_messageType) Zero() protoreflect.Message {
return (*fastReflection_DVPairs)(nil)
}
func (x fastReflection_DVPairs_messageType) New() protoreflect.Message {
return new(fastReflection_DVPairs)
}
func (x fastReflection_DVPairs_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_DVPairs
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_DVPairs) Descriptor() protoreflect.MessageDescriptor {
return md_DVPairs
}
// Type returns the message type, which encapsulates both Go and protobuf
// type information. If the Go type information is not needed,
// it is recommended that the message descriptor be used instead.
func (x *fastReflection_DVPairs) Type() protoreflect.MessageType {
return _fastReflection_DVPairs_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_DVPairs) New() protoreflect.Message {
return new(fastReflection_DVPairs)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_DVPairs) Interface() protoreflect.ProtoMessage {
return (*DVPairs)(x)
}
// Range iterates over every populated field in an undefined order,
// calling f for each field descriptor and value encountered.
// Range returns immediately if f returns false.
// While iterating, mutating operations may only be performed
// on the current field descriptor.
func (x *fastReflection_DVPairs) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
if len(x.Pairs) != 0 {
value := protoreflect.ValueOfList(&_DVPairs_1_list{list: &x.Pairs})
if !f(fd_DVPairs_pairs, value) {
return
}
}
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_DVPairs) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
case "cosmos.staking.v1beta1.DVPairs.pairs":
return len(x.Pairs) != 0
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DVPairs"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DVPairs does not contain field %s", fd.FullName()))
}
}
// Clear clears the field such that a subsequent Has call reports false.
//
// Clearing an extension field clears both the extension type and value
// associated with the given field number.
//
// Clear is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_DVPairs) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.DVPairs.pairs":
x.Pairs = nil
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DVPairs"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DVPairs does not contain field %s", fd.FullName()))
}
}
// Get retrieves the value for a field.
//
// For unpopulated scalars, it returns the default value, where
// the default value of a bytes scalar is guaranteed to be a copy.
// For unpopulated composite types, it returns an empty, read-only view
// of the value; to obtain a mutable reference, use Mutable.
func (x *fastReflection_DVPairs) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
case "cosmos.staking.v1beta1.DVPairs.pairs":
if len(x.Pairs) == 0 {
return protoreflect.ValueOfList(&_DVPairs_1_list{})
}
listValue := &_DVPairs_1_list{list: &x.Pairs}
return protoreflect.ValueOfList(listValue)
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DVPairs"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DVPairs does not contain field %s", descriptor.FullName()))
}
}
// Set stores the value for a field.
//
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType.
// When setting a composite type, it is unspecified whether the stored value
// aliases the source's memory in any way. If the composite value is an
// empty, read-only value, then it panics.
//
// Set is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_DVPairs) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.DVPairs.pairs":
lv := value.List()
clv := lv.(*_DVPairs_1_list)
x.Pairs = *clv.list
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DVPairs"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DVPairs does not contain field %s", fd.FullName()))
}
}
// Mutable returns a mutable reference to a composite type.
//
// If the field is unpopulated, it may allocate a composite value.
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType
// if not already stored.
// It panics if the field does not contain a composite type.
//
// Mutable is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_DVPairs) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.DVPairs.pairs":
if x.Pairs == nil {
x.Pairs = []*DVPair{}
}
value := &_DVPairs_1_list{list: &x.Pairs}
return protoreflect.ValueOfList(value)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DVPairs"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DVPairs does not contain field %s", fd.FullName()))
}
}
// NewField returns a new value that is assignable to the field
// for the given descriptor. For scalars, this returns the default value.
// For lists, maps, and messages, this returns a new, empty, mutable value.
func (x *fastReflection_DVPairs) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.DVPairs.pairs":
list := []*DVPair{}
return protoreflect.ValueOfList(&_DVPairs_1_list{list: &list})
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DVPairs"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DVPairs does not contain field %s", fd.FullName()))
}
}
// WhichOneof reports which field within the oneof is populated,
// returning nil if none are populated.
// It panics if the oneof descriptor does not belong to this message.
func (x *fastReflection_DVPairs) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in cosmos.staking.v1beta1.DVPairs", d.FullName()))
}
panic("unreachable")
}
// GetUnknown retrieves the entire list of unknown fields.
// The caller may only mutate the contents of the RawFields
// if the mutated bytes are stored back into the message with SetUnknown.
func (x *fastReflection_DVPairs) GetUnknown() protoreflect.RawFields {
return x.unknownFields
}
// SetUnknown stores an entire list of unknown fields.
// The raw fields must be syntactically valid according to the wire format.
// An implementation may panic if this is not the case.
// Once stored, the caller must not mutate the content of the RawFields.
// An empty RawFields may be passed to clear the fields.
//
// SetUnknown is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_DVPairs) SetUnknown(fields protoreflect.RawFields) {
x.unknownFields = fields
}
// IsValid reports whether the message is valid.
//
// An invalid message is an empty, read-only value.
//
// An invalid message often corresponds to a nil pointer of the concrete
// message type, but the details are implementation dependent.
// Validity is not part of the protobuf data model, and may not
// be preserved in marshaling or other operations.
func (x *fastReflection_DVPairs) IsValid() bool {
return x != nil
}
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
// This method may return nil.
//
// The returned methods type is identical to
// "google.golang.org/protobuf/runtime/protoiface".Methods.
// Consult the protoiface package documentation for details.
func (x *fastReflection_DVPairs) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*DVPairs)
if x == nil {
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: 0,
}
}
options := runtime.SizeInputToOptions(input)
_ = options
var n int
var l int
_ = l
if len(x.Pairs) > 0 {
for _, e := range x.Pairs {
l = options.Size(e)
n += 1 + l + runtime.Sov(uint64(l))
}
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: n,
}
}
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
x := input.Message.Interface().(*DVPairs)
if x == nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
options := runtime.MarshalInputToOptions(input)
_ = options
size := options.Size(x)
dAtA := make([]byte, size)
i := len(dAtA)
_ = i
var l int
_ = l
if x.unknownFields != nil {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if len(x.Pairs) > 0 {
for iNdEx := len(x.Pairs) - 1; iNdEx >= 0; iNdEx-- {
encoded, err := options.Marshal(x.Pairs[iNdEx])
if err != nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, err
}
i -= len(encoded)
copy(dAtA[i:], encoded)
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
i--
dAtA[i] = 0xa
}
}
if input.Buf != nil {
input.Buf = append(input.Buf, dAtA...)
} else {
input.Buf = dAtA
}
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
x := input.Message.Interface().(*DVPairs)
if x == nil {
return protoiface.UnmarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Flags: input.Flags,
}, nil
}
options := runtime.UnmarshalInputToOptions(input)
_ = options
dAtA := input.Buf
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DVPairs: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DVPairs: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pairs", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.Pairs = append(x.Pairs, &DVPair{})
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pairs[len(x.Pairs)-1]); err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
var (
md_DVVTriplet protoreflect.MessageDescriptor
fd_DVVTriplet_delegator_address protoreflect.FieldDescriptor
fd_DVVTriplet_validator_src_address protoreflect.FieldDescriptor
fd_DVVTriplet_validator_dst_address protoreflect.FieldDescriptor
)
func init() {
file_cosmos_staking_v1beta1_staking_proto_init()
md_DVVTriplet = File_cosmos_staking_v1beta1_staking_proto.Messages().ByName("DVVTriplet")
fd_DVVTriplet_delegator_address = md_DVVTriplet.Fields().ByName("delegator_address")
fd_DVVTriplet_validator_src_address = md_DVVTriplet.Fields().ByName("validator_src_address")
fd_DVVTriplet_validator_dst_address = md_DVVTriplet.Fields().ByName("validator_dst_address")
}
var _ protoreflect.Message = (*fastReflection_DVVTriplet)(nil)
type fastReflection_DVVTriplet DVVTriplet
func (x *DVVTriplet) ProtoReflect() protoreflect.Message {
return (*fastReflection_DVVTriplet)(x)
}
func (x *DVVTriplet) slowProtoReflect() protoreflect.Message {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
var _fastReflection_DVVTriplet_messageType fastReflection_DVVTriplet_messageType
var _ protoreflect.MessageType = fastReflection_DVVTriplet_messageType{}
type fastReflection_DVVTriplet_messageType struct{}
func (x fastReflection_DVVTriplet_messageType) Zero() protoreflect.Message {
return (*fastReflection_DVVTriplet)(nil)
}
func (x fastReflection_DVVTriplet_messageType) New() protoreflect.Message {
return new(fastReflection_DVVTriplet)
}
func (x fastReflection_DVVTriplet_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_DVVTriplet
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_DVVTriplet) Descriptor() protoreflect.MessageDescriptor {
return md_DVVTriplet
}
// Type returns the message type, which encapsulates both Go and protobuf
// type information. If the Go type information is not needed,
// it is recommended that the message descriptor be used instead.
func (x *fastReflection_DVVTriplet) Type() protoreflect.MessageType {
return _fastReflection_DVVTriplet_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_DVVTriplet) New() protoreflect.Message {
return new(fastReflection_DVVTriplet)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_DVVTriplet) Interface() protoreflect.ProtoMessage {
return (*DVVTriplet)(x)
}
// Range iterates over every populated field in an undefined order,
// calling f for each field descriptor and value encountered.
// Range returns immediately if f returns false.
// While iterating, mutating operations may only be performed
// on the current field descriptor.
func (x *fastReflection_DVVTriplet) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
if x.DelegatorAddress != "" {
value := protoreflect.ValueOfString(x.DelegatorAddress)
if !f(fd_DVVTriplet_delegator_address, value) {
return
}
}
if x.ValidatorSrcAddress != "" {
value := protoreflect.ValueOfString(x.ValidatorSrcAddress)
if !f(fd_DVVTriplet_validator_src_address, value) {
return
}
}
if x.ValidatorDstAddress != "" {
value := protoreflect.ValueOfString(x.ValidatorDstAddress)
if !f(fd_DVVTriplet_validator_dst_address, value) {
return
}
}
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_DVVTriplet) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
case "cosmos.staking.v1beta1.DVVTriplet.delegator_address":
return x.DelegatorAddress != ""
case "cosmos.staking.v1beta1.DVVTriplet.validator_src_address":
return x.ValidatorSrcAddress != ""
case "cosmos.staking.v1beta1.DVVTriplet.validator_dst_address":
return x.ValidatorDstAddress != ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DVVTriplet"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DVVTriplet does not contain field %s", fd.FullName()))
}
}
// Clear clears the field such that a subsequent Has call reports false.
//
// Clearing an extension field clears both the extension type and value
// associated with the given field number.
//
// Clear is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_DVVTriplet) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.DVVTriplet.delegator_address":
x.DelegatorAddress = ""
case "cosmos.staking.v1beta1.DVVTriplet.validator_src_address":
x.ValidatorSrcAddress = ""
case "cosmos.staking.v1beta1.DVVTriplet.validator_dst_address":
x.ValidatorDstAddress = ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DVVTriplet"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DVVTriplet does not contain field %s", fd.FullName()))
}
}
// Get retrieves the value for a field.
//
// For unpopulated scalars, it returns the default value, where
// the default value of a bytes scalar is guaranteed to be a copy.
// For unpopulated composite types, it returns an empty, read-only view
// of the value; to obtain a mutable reference, use Mutable.
func (x *fastReflection_DVVTriplet) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
case "cosmos.staking.v1beta1.DVVTriplet.delegator_address":
value := x.DelegatorAddress
return protoreflect.ValueOfString(value)
case "cosmos.staking.v1beta1.DVVTriplet.validator_src_address":
value := x.ValidatorSrcAddress
return protoreflect.ValueOfString(value)
case "cosmos.staking.v1beta1.DVVTriplet.validator_dst_address":
value := x.ValidatorDstAddress
return protoreflect.ValueOfString(value)
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DVVTriplet"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DVVTriplet does not contain field %s", descriptor.FullName()))
}
}
// Set stores the value for a field.
//
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType.
// When setting a composite type, it is unspecified whether the stored value
// aliases the source's memory in any way. If the composite value is an
// empty, read-only value, then it panics.
//
// Set is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_DVVTriplet) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.DVVTriplet.delegator_address":
x.DelegatorAddress = value.Interface().(string)
case "cosmos.staking.v1beta1.DVVTriplet.validator_src_address":
x.ValidatorSrcAddress = value.Interface().(string)
case "cosmos.staking.v1beta1.DVVTriplet.validator_dst_address":
x.ValidatorDstAddress = value.Interface().(string)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DVVTriplet"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DVVTriplet does not contain field %s", fd.FullName()))
}
}
// Mutable returns a mutable reference to a composite type.
//
// If the field is unpopulated, it may allocate a composite value.
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType
// if not already stored.
// It panics if the field does not contain a composite type.
//
// Mutable is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_DVVTriplet) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.DVVTriplet.delegator_address":
panic(fmt.Errorf("field delegator_address of message cosmos.staking.v1beta1.DVVTriplet is not mutable"))
case "cosmos.staking.v1beta1.DVVTriplet.validator_src_address":
panic(fmt.Errorf("field validator_src_address of message cosmos.staking.v1beta1.DVVTriplet is not mutable"))
case "cosmos.staking.v1beta1.DVVTriplet.validator_dst_address":
panic(fmt.Errorf("field validator_dst_address of message cosmos.staking.v1beta1.DVVTriplet is not mutable"))
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DVVTriplet"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DVVTriplet does not contain field %s", fd.FullName()))
}
}
// NewField returns a new value that is assignable to the field
// for the given descriptor. For scalars, this returns the default value.
// For lists, maps, and messages, this returns a new, empty, mutable value.
func (x *fastReflection_DVVTriplet) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.DVVTriplet.delegator_address":
return protoreflect.ValueOfString("")
case "cosmos.staking.v1beta1.DVVTriplet.validator_src_address":
return protoreflect.ValueOfString("")
case "cosmos.staking.v1beta1.DVVTriplet.validator_dst_address":
return protoreflect.ValueOfString("")
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DVVTriplet"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DVVTriplet does not contain field %s", fd.FullName()))
}
}
// WhichOneof reports which field within the oneof is populated,
// returning nil if none are populated.
// It panics if the oneof descriptor does not belong to this message.
func (x *fastReflection_DVVTriplet) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in cosmos.staking.v1beta1.DVVTriplet", d.FullName()))
}
panic("unreachable")
}
// GetUnknown retrieves the entire list of unknown fields.
// The caller may only mutate the contents of the RawFields
// if the mutated bytes are stored back into the message with SetUnknown.
func (x *fastReflection_DVVTriplet) GetUnknown() protoreflect.RawFields {
return x.unknownFields
}
// SetUnknown stores an entire list of unknown fields.
// The raw fields must be syntactically valid according to the wire format.
// An implementation may panic if this is not the case.
// Once stored, the caller must not mutate the content of the RawFields.
// An empty RawFields may be passed to clear the fields.
//
// SetUnknown is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_DVVTriplet) SetUnknown(fields protoreflect.RawFields) {
x.unknownFields = fields
}
// IsValid reports whether the message is valid.
//
// An invalid message is an empty, read-only value.
//
// An invalid message often corresponds to a nil pointer of the concrete
// message type, but the details are implementation dependent.
// Validity is not part of the protobuf data model, and may not
// be preserved in marshaling or other operations.
func (x *fastReflection_DVVTriplet) IsValid() bool {
return x != nil
}
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
// This method may return nil.
//
// The returned methods type is identical to
// "google.golang.org/protobuf/runtime/protoiface".Methods.
// Consult the protoiface package documentation for details.
func (x *fastReflection_DVVTriplet) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*DVVTriplet)
if x == nil {
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: 0,
}
}
options := runtime.SizeInputToOptions(input)
_ = options
var n int
var l int
_ = l
l = len(x.DelegatorAddress)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.ValidatorSrcAddress)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.ValidatorDstAddress)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: n,
}
}
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
x := input.Message.Interface().(*DVVTriplet)
if x == nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
options := runtime.MarshalInputToOptions(input)
_ = options
size := options.Size(x)
dAtA := make([]byte, size)
i := len(dAtA)
_ = i
var l int
_ = l
if x.unknownFields != nil {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if len(x.ValidatorDstAddress) > 0 {
i -= len(x.ValidatorDstAddress)
copy(dAtA[i:], x.ValidatorDstAddress)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorDstAddress)))
i--
dAtA[i] = 0x1a
}
if len(x.ValidatorSrcAddress) > 0 {
i -= len(x.ValidatorSrcAddress)
copy(dAtA[i:], x.ValidatorSrcAddress)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorSrcAddress)))
i--
dAtA[i] = 0x12
}
if len(x.DelegatorAddress) > 0 {
i -= len(x.DelegatorAddress)
copy(dAtA[i:], x.DelegatorAddress)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DelegatorAddress)))
i--
dAtA[i] = 0xa
}
if input.Buf != nil {
input.Buf = append(input.Buf, dAtA...)
} else {
input.Buf = dAtA
}
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
x := input.Message.Interface().(*DVVTriplet)
if x == nil {
return protoiface.UnmarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Flags: input.Flags,
}, nil
}
options := runtime.UnmarshalInputToOptions(input)
_ = options
dAtA := input.Buf
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DVVTriplet: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DVVTriplet: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.DelegatorAddress = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ValidatorSrcAddress", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.ValidatorSrcAddress = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ValidatorDstAddress", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.ValidatorDstAddress = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
var _ protoreflect.List = (*_DVVTriplets_1_list)(nil)
type _DVVTriplets_1_list struct {
list *[]*DVVTriplet
}
func (x *_DVVTriplets_1_list) Len() int {
if x.list == nil {
return 0
}
return len(*x.list)
}
func (x *_DVVTriplets_1_list) Get(i int) protoreflect.Value {
return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect())
}
func (x *_DVVTriplets_1_list) Set(i int, value protoreflect.Value) {
valueUnwrapped := value.Message()
concreteValue := valueUnwrapped.Interface().(*DVVTriplet)
(*x.list)[i] = concreteValue
}
func (x *_DVVTriplets_1_list) Append(value protoreflect.Value) {
valueUnwrapped := value.Message()
concreteValue := valueUnwrapped.Interface().(*DVVTriplet)
*x.list = append(*x.list, concreteValue)
}
func (x *_DVVTriplets_1_list) AppendMutable() protoreflect.Value {
v := new(DVVTriplet)
*x.list = append(*x.list, v)
return protoreflect.ValueOfMessage(v.ProtoReflect())
}
func (x *_DVVTriplets_1_list) Truncate(n int) {
for i := n; i < len(*x.list); i++ {
(*x.list)[i] = nil
}
*x.list = (*x.list)[:n]
}
func (x *_DVVTriplets_1_list) NewElement() protoreflect.Value {
v := new(DVVTriplet)
return protoreflect.ValueOfMessage(v.ProtoReflect())
}
func (x *_DVVTriplets_1_list) IsValid() bool {
return x.list != nil
}
var (
md_DVVTriplets protoreflect.MessageDescriptor
fd_DVVTriplets_triplets protoreflect.FieldDescriptor
)
func init() {
file_cosmos_staking_v1beta1_staking_proto_init()
md_DVVTriplets = File_cosmos_staking_v1beta1_staking_proto.Messages().ByName("DVVTriplets")
fd_DVVTriplets_triplets = md_DVVTriplets.Fields().ByName("triplets")
}
var _ protoreflect.Message = (*fastReflection_DVVTriplets)(nil)
type fastReflection_DVVTriplets DVVTriplets
func (x *DVVTriplets) ProtoReflect() protoreflect.Message {
return (*fastReflection_DVVTriplets)(x)
}
func (x *DVVTriplets) slowProtoReflect() protoreflect.Message {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
var _fastReflection_DVVTriplets_messageType fastReflection_DVVTriplets_messageType
var _ protoreflect.MessageType = fastReflection_DVVTriplets_messageType{}
type fastReflection_DVVTriplets_messageType struct{}
func (x fastReflection_DVVTriplets_messageType) Zero() protoreflect.Message {
return (*fastReflection_DVVTriplets)(nil)
}
func (x fastReflection_DVVTriplets_messageType) New() protoreflect.Message {
return new(fastReflection_DVVTriplets)
}
func (x fastReflection_DVVTriplets_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_DVVTriplets
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_DVVTriplets) Descriptor() protoreflect.MessageDescriptor {
return md_DVVTriplets
}
// Type returns the message type, which encapsulates both Go and protobuf
// type information. If the Go type information is not needed,
// it is recommended that the message descriptor be used instead.
func (x *fastReflection_DVVTriplets) Type() protoreflect.MessageType {
return _fastReflection_DVVTriplets_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_DVVTriplets) New() protoreflect.Message {
return new(fastReflection_DVVTriplets)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_DVVTriplets) Interface() protoreflect.ProtoMessage {
return (*DVVTriplets)(x)
}
// Range iterates over every populated field in an undefined order,
// calling f for each field descriptor and value encountered.
// Range returns immediately if f returns false.
// While iterating, mutating operations may only be performed
// on the current field descriptor.
func (x *fastReflection_DVVTriplets) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
if len(x.Triplets) != 0 {
value := protoreflect.ValueOfList(&_DVVTriplets_1_list{list: &x.Triplets})
if !f(fd_DVVTriplets_triplets, value) {
return
}
}
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_DVVTriplets) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
case "cosmos.staking.v1beta1.DVVTriplets.triplets":
return len(x.Triplets) != 0
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DVVTriplets"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DVVTriplets does not contain field %s", fd.FullName()))
}
}
// Clear clears the field such that a subsequent Has call reports false.
//
// Clearing an extension field clears both the extension type and value
// associated with the given field number.
//
// Clear is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_DVVTriplets) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.DVVTriplets.triplets":
x.Triplets = nil
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DVVTriplets"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DVVTriplets does not contain field %s", fd.FullName()))
}
}
// Get retrieves the value for a field.
//
// For unpopulated scalars, it returns the default value, where
// the default value of a bytes scalar is guaranteed to be a copy.
// For unpopulated composite types, it returns an empty, read-only view
// of the value; to obtain a mutable reference, use Mutable.
func (x *fastReflection_DVVTriplets) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
case "cosmos.staking.v1beta1.DVVTriplets.triplets":
if len(x.Triplets) == 0 {
return protoreflect.ValueOfList(&_DVVTriplets_1_list{})
}
listValue := &_DVVTriplets_1_list{list: &x.Triplets}
return protoreflect.ValueOfList(listValue)
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DVVTriplets"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DVVTriplets does not contain field %s", descriptor.FullName()))
}
}
// Set stores the value for a field.
//
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType.
// When setting a composite type, it is unspecified whether the stored value
// aliases the source's memory in any way. If the composite value is an
// empty, read-only value, then it panics.
//
// Set is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_DVVTriplets) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.DVVTriplets.triplets":
lv := value.List()
clv := lv.(*_DVVTriplets_1_list)
x.Triplets = *clv.list
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DVVTriplets"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DVVTriplets does not contain field %s", fd.FullName()))
}
}
// Mutable returns a mutable reference to a composite type.
//
// If the field is unpopulated, it may allocate a composite value.
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType
// if not already stored.
// It panics if the field does not contain a composite type.
//
// Mutable is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_DVVTriplets) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.DVVTriplets.triplets":
if x.Triplets == nil {
x.Triplets = []*DVVTriplet{}
}
value := &_DVVTriplets_1_list{list: &x.Triplets}
return protoreflect.ValueOfList(value)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DVVTriplets"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DVVTriplets does not contain field %s", fd.FullName()))
}
}
// NewField returns a new value that is assignable to the field
// for the given descriptor. For scalars, this returns the default value.
// For lists, maps, and messages, this returns a new, empty, mutable value.
func (x *fastReflection_DVVTriplets) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.DVVTriplets.triplets":
list := []*DVVTriplet{}
return protoreflect.ValueOfList(&_DVVTriplets_1_list{list: &list})
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DVVTriplets"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DVVTriplets does not contain field %s", fd.FullName()))
}
}
// WhichOneof reports which field within the oneof is populated,
// returning nil if none are populated.
// It panics if the oneof descriptor does not belong to this message.
func (x *fastReflection_DVVTriplets) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in cosmos.staking.v1beta1.DVVTriplets", d.FullName()))
}
panic("unreachable")
}
// GetUnknown retrieves the entire list of unknown fields.
// The caller may only mutate the contents of the RawFields
// if the mutated bytes are stored back into the message with SetUnknown.
func (x *fastReflection_DVVTriplets) GetUnknown() protoreflect.RawFields {
return x.unknownFields
}
// SetUnknown stores an entire list of unknown fields.
// The raw fields must be syntactically valid according to the wire format.
// An implementation may panic if this is not the case.
// Once stored, the caller must not mutate the content of the RawFields.
// An empty RawFields may be passed to clear the fields.
//
// SetUnknown is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_DVVTriplets) SetUnknown(fields protoreflect.RawFields) {
x.unknownFields = fields
}
// IsValid reports whether the message is valid.
//
// An invalid message is an empty, read-only value.
//
// An invalid message often corresponds to a nil pointer of the concrete
// message type, but the details are implementation dependent.
// Validity is not part of the protobuf data model, and may not
// be preserved in marshaling or other operations.
func (x *fastReflection_DVVTriplets) IsValid() bool {
return x != nil
}
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
// This method may return nil.
//
// The returned methods type is identical to
// "google.golang.org/protobuf/runtime/protoiface".Methods.
// Consult the protoiface package documentation for details.
func (x *fastReflection_DVVTriplets) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*DVVTriplets)
if x == nil {
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: 0,
}
}
options := runtime.SizeInputToOptions(input)
_ = options
var n int
var l int
_ = l
if len(x.Triplets) > 0 {
for _, e := range x.Triplets {
l = options.Size(e)
n += 1 + l + runtime.Sov(uint64(l))
}
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: n,
}
}
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
x := input.Message.Interface().(*DVVTriplets)
if x == nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
options := runtime.MarshalInputToOptions(input)
_ = options
size := options.Size(x)
dAtA := make([]byte, size)
i := len(dAtA)
_ = i
var l int
_ = l
if x.unknownFields != nil {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if len(x.Triplets) > 0 {
for iNdEx := len(x.Triplets) - 1; iNdEx >= 0; iNdEx-- {
encoded, err := options.Marshal(x.Triplets[iNdEx])
if err != nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, err
}
i -= len(encoded)
copy(dAtA[i:], encoded)
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
i--
dAtA[i] = 0xa
}
}
if input.Buf != nil {
input.Buf = append(input.Buf, dAtA...)
} else {
input.Buf = dAtA
}
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
x := input.Message.Interface().(*DVVTriplets)
if x == nil {
return protoiface.UnmarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Flags: input.Flags,
}, nil
}
options := runtime.UnmarshalInputToOptions(input)
_ = options
dAtA := input.Buf
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DVVTriplets: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DVVTriplets: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Triplets", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.Triplets = append(x.Triplets, &DVVTriplet{})
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Triplets[len(x.Triplets)-1]); err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
var (
md_Delegation protoreflect.MessageDescriptor
fd_Delegation_delegator_address protoreflect.FieldDescriptor
fd_Delegation_validator_address protoreflect.FieldDescriptor
fd_Delegation_shares protoreflect.FieldDescriptor
)
func init() {
file_cosmos_staking_v1beta1_staking_proto_init()
md_Delegation = File_cosmos_staking_v1beta1_staking_proto.Messages().ByName("Delegation")
fd_Delegation_delegator_address = md_Delegation.Fields().ByName("delegator_address")
fd_Delegation_validator_address = md_Delegation.Fields().ByName("validator_address")
fd_Delegation_shares = md_Delegation.Fields().ByName("shares")
}
var _ protoreflect.Message = (*fastReflection_Delegation)(nil)
type fastReflection_Delegation Delegation
func (x *Delegation) ProtoReflect() protoreflect.Message {
return (*fastReflection_Delegation)(x)
}
func (x *Delegation) slowProtoReflect() protoreflect.Message {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
var _fastReflection_Delegation_messageType fastReflection_Delegation_messageType
var _ protoreflect.MessageType = fastReflection_Delegation_messageType{}
type fastReflection_Delegation_messageType struct{}
func (x fastReflection_Delegation_messageType) Zero() protoreflect.Message {
return (*fastReflection_Delegation)(nil)
}
func (x fastReflection_Delegation_messageType) New() protoreflect.Message {
return new(fastReflection_Delegation)
}
func (x fastReflection_Delegation_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_Delegation
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_Delegation) Descriptor() protoreflect.MessageDescriptor {
return md_Delegation
}
// Type returns the message type, which encapsulates both Go and protobuf
// type information. If the Go type information is not needed,
// it is recommended that the message descriptor be used instead.
func (x *fastReflection_Delegation) Type() protoreflect.MessageType {
return _fastReflection_Delegation_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_Delegation) New() protoreflect.Message {
return new(fastReflection_Delegation)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_Delegation) Interface() protoreflect.ProtoMessage {
return (*Delegation)(x)
}
// Range iterates over every populated field in an undefined order,
// calling f for each field descriptor and value encountered.
// Range returns immediately if f returns false.
// While iterating, mutating operations may only be performed
// on the current field descriptor.
func (x *fastReflection_Delegation) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
if x.DelegatorAddress != "" {
value := protoreflect.ValueOfString(x.DelegatorAddress)
if !f(fd_Delegation_delegator_address, value) {
return
}
}
if x.ValidatorAddress != "" {
value := protoreflect.ValueOfString(x.ValidatorAddress)
if !f(fd_Delegation_validator_address, value) {
return
}
}
if x.Shares != "" {
value := protoreflect.ValueOfString(x.Shares)
if !f(fd_Delegation_shares, value) {
return
}
}
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_Delegation) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Delegation.delegator_address":
return x.DelegatorAddress != ""
case "cosmos.staking.v1beta1.Delegation.validator_address":
return x.ValidatorAddress != ""
case "cosmos.staking.v1beta1.Delegation.shares":
return x.Shares != ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Delegation"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Delegation does not contain field %s", fd.FullName()))
}
}
// Clear clears the field such that a subsequent Has call reports false.
//
// Clearing an extension field clears both the extension type and value
// associated with the given field number.
//
// Clear is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Delegation) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Delegation.delegator_address":
x.DelegatorAddress = ""
case "cosmos.staking.v1beta1.Delegation.validator_address":
x.ValidatorAddress = ""
case "cosmos.staking.v1beta1.Delegation.shares":
x.Shares = ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Delegation"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Delegation does not contain field %s", fd.FullName()))
}
}
// Get retrieves the value for a field.
//
// For unpopulated scalars, it returns the default value, where
// the default value of a bytes scalar is guaranteed to be a copy.
// For unpopulated composite types, it returns an empty, read-only view
// of the value; to obtain a mutable reference, use Mutable.
func (x *fastReflection_Delegation) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
case "cosmos.staking.v1beta1.Delegation.delegator_address":
value := x.DelegatorAddress
return protoreflect.ValueOfString(value)
case "cosmos.staking.v1beta1.Delegation.validator_address":
value := x.ValidatorAddress
return protoreflect.ValueOfString(value)
case "cosmos.staking.v1beta1.Delegation.shares":
value := x.Shares
return protoreflect.ValueOfString(value)
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Delegation"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Delegation does not contain field %s", descriptor.FullName()))
}
}
// Set stores the value for a field.
//
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType.
// When setting a composite type, it is unspecified whether the stored value
// aliases the source's memory in any way. If the composite value is an
// empty, read-only value, then it panics.
//
// Set is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Delegation) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Delegation.delegator_address":
x.DelegatorAddress = value.Interface().(string)
case "cosmos.staking.v1beta1.Delegation.validator_address":
x.ValidatorAddress = value.Interface().(string)
case "cosmos.staking.v1beta1.Delegation.shares":
x.Shares = value.Interface().(string)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Delegation"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Delegation does not contain field %s", fd.FullName()))
}
}
// Mutable returns a mutable reference to a composite type.
//
// If the field is unpopulated, it may allocate a composite value.
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType
// if not already stored.
// It panics if the field does not contain a composite type.
//
// Mutable is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Delegation) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Delegation.delegator_address":
panic(fmt.Errorf("field delegator_address of message cosmos.staking.v1beta1.Delegation is not mutable"))
case "cosmos.staking.v1beta1.Delegation.validator_address":
panic(fmt.Errorf("field validator_address of message cosmos.staking.v1beta1.Delegation is not mutable"))
case "cosmos.staking.v1beta1.Delegation.shares":
panic(fmt.Errorf("field shares of message cosmos.staking.v1beta1.Delegation is not mutable"))
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Delegation"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Delegation does not contain field %s", fd.FullName()))
}
}
// NewField returns a new value that is assignable to the field
// for the given descriptor. For scalars, this returns the default value.
// For lists, maps, and messages, this returns a new, empty, mutable value.
func (x *fastReflection_Delegation) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Delegation.delegator_address":
return protoreflect.ValueOfString("")
case "cosmos.staking.v1beta1.Delegation.validator_address":
return protoreflect.ValueOfString("")
case "cosmos.staking.v1beta1.Delegation.shares":
return protoreflect.ValueOfString("")
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Delegation"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Delegation does not contain field %s", fd.FullName()))
}
}
// WhichOneof reports which field within the oneof is populated,
// returning nil if none are populated.
// It panics if the oneof descriptor does not belong to this message.
func (x *fastReflection_Delegation) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in cosmos.staking.v1beta1.Delegation", d.FullName()))
}
panic("unreachable")
}
// GetUnknown retrieves the entire list of unknown fields.
// The caller may only mutate the contents of the RawFields
// if the mutated bytes are stored back into the message with SetUnknown.
func (x *fastReflection_Delegation) GetUnknown() protoreflect.RawFields {
return x.unknownFields
}
// SetUnknown stores an entire list of unknown fields.
// The raw fields must be syntactically valid according to the wire format.
// An implementation may panic if this is not the case.
// Once stored, the caller must not mutate the content of the RawFields.
// An empty RawFields may be passed to clear the fields.
//
// SetUnknown is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Delegation) SetUnknown(fields protoreflect.RawFields) {
x.unknownFields = fields
}
// IsValid reports whether the message is valid.
//
// An invalid message is an empty, read-only value.
//
// An invalid message often corresponds to a nil pointer of the concrete
// message type, but the details are implementation dependent.
// Validity is not part of the protobuf data model, and may not
// be preserved in marshaling or other operations.
func (x *fastReflection_Delegation) IsValid() bool {
return x != nil
}
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
// This method may return nil.
//
// The returned methods type is identical to
// "google.golang.org/protobuf/runtime/protoiface".Methods.
// Consult the protoiface package documentation for details.
func (x *fastReflection_Delegation) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*Delegation)
if x == nil {
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: 0,
}
}
options := runtime.SizeInputToOptions(input)
_ = options
var n int
var l int
_ = l
l = len(x.DelegatorAddress)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.ValidatorAddress)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.Shares)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: n,
}
}
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
x := input.Message.Interface().(*Delegation)
if x == nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
options := runtime.MarshalInputToOptions(input)
_ = options
size := options.Size(x)
dAtA := make([]byte, size)
i := len(dAtA)
_ = i
var l int
_ = l
if x.unknownFields != nil {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if len(x.Shares) > 0 {
i -= len(x.Shares)
copy(dAtA[i:], x.Shares)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Shares)))
i--
dAtA[i] = 0x1a
}
if len(x.ValidatorAddress) > 0 {
i -= len(x.ValidatorAddress)
copy(dAtA[i:], x.ValidatorAddress)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorAddress)))
i--
dAtA[i] = 0x12
}
if len(x.DelegatorAddress) > 0 {
i -= len(x.DelegatorAddress)
copy(dAtA[i:], x.DelegatorAddress)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DelegatorAddress)))
i--
dAtA[i] = 0xa
}
if input.Buf != nil {
input.Buf = append(input.Buf, dAtA...)
} else {
input.Buf = dAtA
}
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
x := input.Message.Interface().(*Delegation)
if x == nil {
return protoiface.UnmarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Flags: input.Flags,
}, nil
}
options := runtime.UnmarshalInputToOptions(input)
_ = options
dAtA := input.Buf
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Delegation: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Delegation: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.DelegatorAddress = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.ValidatorAddress = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Shares", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.Shares = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
var _ protoreflect.List = (*_UnbondingDelegation_3_list)(nil)
type _UnbondingDelegation_3_list struct {
list *[]*UnbondingDelegationEntry
}
func (x *_UnbondingDelegation_3_list) Len() int {
if x.list == nil {
return 0
}
return len(*x.list)
}
func (x *_UnbondingDelegation_3_list) Get(i int) protoreflect.Value {
return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect())
}
func (x *_UnbondingDelegation_3_list) Set(i int, value protoreflect.Value) {
valueUnwrapped := value.Message()
concreteValue := valueUnwrapped.Interface().(*UnbondingDelegationEntry)
(*x.list)[i] = concreteValue
}
func (x *_UnbondingDelegation_3_list) Append(value protoreflect.Value) {
valueUnwrapped := value.Message()
concreteValue := valueUnwrapped.Interface().(*UnbondingDelegationEntry)
*x.list = append(*x.list, concreteValue)
}
func (x *_UnbondingDelegation_3_list) AppendMutable() protoreflect.Value {
v := new(UnbondingDelegationEntry)
*x.list = append(*x.list, v)
return protoreflect.ValueOfMessage(v.ProtoReflect())
}
func (x *_UnbondingDelegation_3_list) Truncate(n int) {
for i := n; i < len(*x.list); i++ {
(*x.list)[i] = nil
}
*x.list = (*x.list)[:n]
}
func (x *_UnbondingDelegation_3_list) NewElement() protoreflect.Value {
v := new(UnbondingDelegationEntry)
return protoreflect.ValueOfMessage(v.ProtoReflect())
}
func (x *_UnbondingDelegation_3_list) IsValid() bool {
return x.list != nil
}
var (
md_UnbondingDelegation protoreflect.MessageDescriptor
fd_UnbondingDelegation_delegator_address protoreflect.FieldDescriptor
fd_UnbondingDelegation_validator_address protoreflect.FieldDescriptor
fd_UnbondingDelegation_entries protoreflect.FieldDescriptor
)
func init() {
file_cosmos_staking_v1beta1_staking_proto_init()
md_UnbondingDelegation = File_cosmos_staking_v1beta1_staking_proto.Messages().ByName("UnbondingDelegation")
fd_UnbondingDelegation_delegator_address = md_UnbondingDelegation.Fields().ByName("delegator_address")
fd_UnbondingDelegation_validator_address = md_UnbondingDelegation.Fields().ByName("validator_address")
fd_UnbondingDelegation_entries = md_UnbondingDelegation.Fields().ByName("entries")
}
var _ protoreflect.Message = (*fastReflection_UnbondingDelegation)(nil)
type fastReflection_UnbondingDelegation UnbondingDelegation
func (x *UnbondingDelegation) ProtoReflect() protoreflect.Message {
return (*fastReflection_UnbondingDelegation)(x)
}
func (x *UnbondingDelegation) slowProtoReflect() protoreflect.Message {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
var _fastReflection_UnbondingDelegation_messageType fastReflection_UnbondingDelegation_messageType
var _ protoreflect.MessageType = fastReflection_UnbondingDelegation_messageType{}
type fastReflection_UnbondingDelegation_messageType struct{}
func (x fastReflection_UnbondingDelegation_messageType) Zero() protoreflect.Message {
return (*fastReflection_UnbondingDelegation)(nil)
}
func (x fastReflection_UnbondingDelegation_messageType) New() protoreflect.Message {
return new(fastReflection_UnbondingDelegation)
}
func (x fastReflection_UnbondingDelegation_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_UnbondingDelegation
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_UnbondingDelegation) Descriptor() protoreflect.MessageDescriptor {
return md_UnbondingDelegation
}
// Type returns the message type, which encapsulates both Go and protobuf
// type information. If the Go type information is not needed,
// it is recommended that the message descriptor be used instead.
func (x *fastReflection_UnbondingDelegation) Type() protoreflect.MessageType {
return _fastReflection_UnbondingDelegation_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_UnbondingDelegation) New() protoreflect.Message {
return new(fastReflection_UnbondingDelegation)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_UnbondingDelegation) Interface() protoreflect.ProtoMessage {
return (*UnbondingDelegation)(x)
}
// Range iterates over every populated field in an undefined order,
// calling f for each field descriptor and value encountered.
// Range returns immediately if f returns false.
// While iterating, mutating operations may only be performed
// on the current field descriptor.
func (x *fastReflection_UnbondingDelegation) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
if x.DelegatorAddress != "" {
value := protoreflect.ValueOfString(x.DelegatorAddress)
if !f(fd_UnbondingDelegation_delegator_address, value) {
return
}
}
if x.ValidatorAddress != "" {
value := protoreflect.ValueOfString(x.ValidatorAddress)
if !f(fd_UnbondingDelegation_validator_address, value) {
return
}
}
if len(x.Entries) != 0 {
value := protoreflect.ValueOfList(&_UnbondingDelegation_3_list{list: &x.Entries})
if !f(fd_UnbondingDelegation_entries, value) {
return
}
}
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_UnbondingDelegation) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
case "cosmos.staking.v1beta1.UnbondingDelegation.delegator_address":
return x.DelegatorAddress != ""
case "cosmos.staking.v1beta1.UnbondingDelegation.validator_address":
return x.ValidatorAddress != ""
case "cosmos.staking.v1beta1.UnbondingDelegation.entries":
return len(x.Entries) != 0
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.UnbondingDelegation"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.UnbondingDelegation does not contain field %s", fd.FullName()))
}
}
// Clear clears the field such that a subsequent Has call reports false.
//
// Clearing an extension field clears both the extension type and value
// associated with the given field number.
//
// Clear is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_UnbondingDelegation) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.UnbondingDelegation.delegator_address":
x.DelegatorAddress = ""
case "cosmos.staking.v1beta1.UnbondingDelegation.validator_address":
x.ValidatorAddress = ""
case "cosmos.staking.v1beta1.UnbondingDelegation.entries":
x.Entries = nil
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.UnbondingDelegation"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.UnbondingDelegation does not contain field %s", fd.FullName()))
}
}
// Get retrieves the value for a field.
//
// For unpopulated scalars, it returns the default value, where
// the default value of a bytes scalar is guaranteed to be a copy.
// For unpopulated composite types, it returns an empty, read-only view
// of the value; to obtain a mutable reference, use Mutable.
func (x *fastReflection_UnbondingDelegation) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
case "cosmos.staking.v1beta1.UnbondingDelegation.delegator_address":
value := x.DelegatorAddress
return protoreflect.ValueOfString(value)
case "cosmos.staking.v1beta1.UnbondingDelegation.validator_address":
value := x.ValidatorAddress
return protoreflect.ValueOfString(value)
case "cosmos.staking.v1beta1.UnbondingDelegation.entries":
if len(x.Entries) == 0 {
return protoreflect.ValueOfList(&_UnbondingDelegation_3_list{})
}
listValue := &_UnbondingDelegation_3_list{list: &x.Entries}
return protoreflect.ValueOfList(listValue)
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.UnbondingDelegation"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.UnbondingDelegation does not contain field %s", descriptor.FullName()))
}
}
// Set stores the value for a field.
//
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType.
// When setting a composite type, it is unspecified whether the stored value
// aliases the source's memory in any way. If the composite value is an
// empty, read-only value, then it panics.
//
// Set is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_UnbondingDelegation) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.UnbondingDelegation.delegator_address":
x.DelegatorAddress = value.Interface().(string)
case "cosmos.staking.v1beta1.UnbondingDelegation.validator_address":
x.ValidatorAddress = value.Interface().(string)
case "cosmos.staking.v1beta1.UnbondingDelegation.entries":
lv := value.List()
clv := lv.(*_UnbondingDelegation_3_list)
x.Entries = *clv.list
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.UnbondingDelegation"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.UnbondingDelegation does not contain field %s", fd.FullName()))
}
}
// Mutable returns a mutable reference to a composite type.
//
// If the field is unpopulated, it may allocate a composite value.
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType
// if not already stored.
// It panics if the field does not contain a composite type.
//
// Mutable is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_UnbondingDelegation) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.UnbondingDelegation.entries":
if x.Entries == nil {
x.Entries = []*UnbondingDelegationEntry{}
}
value := &_UnbondingDelegation_3_list{list: &x.Entries}
return protoreflect.ValueOfList(value)
case "cosmos.staking.v1beta1.UnbondingDelegation.delegator_address":
panic(fmt.Errorf("field delegator_address of message cosmos.staking.v1beta1.UnbondingDelegation is not mutable"))
case "cosmos.staking.v1beta1.UnbondingDelegation.validator_address":
panic(fmt.Errorf("field validator_address of message cosmos.staking.v1beta1.UnbondingDelegation is not mutable"))
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.UnbondingDelegation"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.UnbondingDelegation does not contain field %s", fd.FullName()))
}
}
// NewField returns a new value that is assignable to the field
// for the given descriptor. For scalars, this returns the default value.
// For lists, maps, and messages, this returns a new, empty, mutable value.
func (x *fastReflection_UnbondingDelegation) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.UnbondingDelegation.delegator_address":
return protoreflect.ValueOfString("")
case "cosmos.staking.v1beta1.UnbondingDelegation.validator_address":
return protoreflect.ValueOfString("")
case "cosmos.staking.v1beta1.UnbondingDelegation.entries":
list := []*UnbondingDelegationEntry{}
return protoreflect.ValueOfList(&_UnbondingDelegation_3_list{list: &list})
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.UnbondingDelegation"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.UnbondingDelegation does not contain field %s", fd.FullName()))
}
}
// WhichOneof reports which field within the oneof is populated,
// returning nil if none are populated.
// It panics if the oneof descriptor does not belong to this message.
func (x *fastReflection_UnbondingDelegation) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in cosmos.staking.v1beta1.UnbondingDelegation", d.FullName()))
}
panic("unreachable")
}
// GetUnknown retrieves the entire list of unknown fields.
// The caller may only mutate the contents of the RawFields
// if the mutated bytes are stored back into the message with SetUnknown.
func (x *fastReflection_UnbondingDelegation) GetUnknown() protoreflect.RawFields {
return x.unknownFields
}
// SetUnknown stores an entire list of unknown fields.
// The raw fields must be syntactically valid according to the wire format.
// An implementation may panic if this is not the case.
// Once stored, the caller must not mutate the content of the RawFields.
// An empty RawFields may be passed to clear the fields.
//
// SetUnknown is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_UnbondingDelegation) SetUnknown(fields protoreflect.RawFields) {
x.unknownFields = fields
}
// IsValid reports whether the message is valid.
//
// An invalid message is an empty, read-only value.
//
// An invalid message often corresponds to a nil pointer of the concrete
// message type, but the details are implementation dependent.
// Validity is not part of the protobuf data model, and may not
// be preserved in marshaling or other operations.
func (x *fastReflection_UnbondingDelegation) IsValid() bool {
return x != nil
}
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
// This method may return nil.
//
// The returned methods type is identical to
// "google.golang.org/protobuf/runtime/protoiface".Methods.
// Consult the protoiface package documentation for details.
func (x *fastReflection_UnbondingDelegation) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*UnbondingDelegation)
if x == nil {
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: 0,
}
}
options := runtime.SizeInputToOptions(input)
_ = options
var n int
var l int
_ = l
l = len(x.DelegatorAddress)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.ValidatorAddress)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
if len(x.Entries) > 0 {
for _, e := range x.Entries {
l = options.Size(e)
n += 1 + l + runtime.Sov(uint64(l))
}
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: n,
}
}
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
x := input.Message.Interface().(*UnbondingDelegation)
if x == nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
options := runtime.MarshalInputToOptions(input)
_ = options
size := options.Size(x)
dAtA := make([]byte, size)
i := len(dAtA)
_ = i
var l int
_ = l
if x.unknownFields != nil {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if len(x.Entries) > 0 {
for iNdEx := len(x.Entries) - 1; iNdEx >= 0; iNdEx-- {
encoded, err := options.Marshal(x.Entries[iNdEx])
if err != nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, err
}
i -= len(encoded)
copy(dAtA[i:], encoded)
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
i--
dAtA[i] = 0x1a
}
}
if len(x.ValidatorAddress) > 0 {
i -= len(x.ValidatorAddress)
copy(dAtA[i:], x.ValidatorAddress)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorAddress)))
i--
dAtA[i] = 0x12
}
if len(x.DelegatorAddress) > 0 {
i -= len(x.DelegatorAddress)
copy(dAtA[i:], x.DelegatorAddress)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DelegatorAddress)))
i--
dAtA[i] = 0xa
}
if input.Buf != nil {
input.Buf = append(input.Buf, dAtA...)
} else {
input.Buf = dAtA
}
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
x := input.Message.Interface().(*UnbondingDelegation)
if x == nil {
return protoiface.UnmarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Flags: input.Flags,
}, nil
}
options := runtime.UnmarshalInputToOptions(input)
_ = options
dAtA := input.Buf
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: UnbondingDelegation: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: UnbondingDelegation: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.DelegatorAddress = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.ValidatorAddress = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.Entries = append(x.Entries, &UnbondingDelegationEntry{})
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Entries[len(x.Entries)-1]); err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
var (
md_UnbondingDelegationEntry protoreflect.MessageDescriptor
fd_UnbondingDelegationEntry_creation_height protoreflect.FieldDescriptor
fd_UnbondingDelegationEntry_completion_time protoreflect.FieldDescriptor
fd_UnbondingDelegationEntry_initial_balance protoreflect.FieldDescriptor
fd_UnbondingDelegationEntry_balance protoreflect.FieldDescriptor
)
func init() {
file_cosmos_staking_v1beta1_staking_proto_init()
md_UnbondingDelegationEntry = File_cosmos_staking_v1beta1_staking_proto.Messages().ByName("UnbondingDelegationEntry")
fd_UnbondingDelegationEntry_creation_height = md_UnbondingDelegationEntry.Fields().ByName("creation_height")
fd_UnbondingDelegationEntry_completion_time = md_UnbondingDelegationEntry.Fields().ByName("completion_time")
fd_UnbondingDelegationEntry_initial_balance = md_UnbondingDelegationEntry.Fields().ByName("initial_balance")
fd_UnbondingDelegationEntry_balance = md_UnbondingDelegationEntry.Fields().ByName("balance")
}
var _ protoreflect.Message = (*fastReflection_UnbondingDelegationEntry)(nil)
type fastReflection_UnbondingDelegationEntry UnbondingDelegationEntry
func (x *UnbondingDelegationEntry) ProtoReflect() protoreflect.Message {
return (*fastReflection_UnbondingDelegationEntry)(x)
}
func (x *UnbondingDelegationEntry) slowProtoReflect() protoreflect.Message {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
var _fastReflection_UnbondingDelegationEntry_messageType fastReflection_UnbondingDelegationEntry_messageType
var _ protoreflect.MessageType = fastReflection_UnbondingDelegationEntry_messageType{}
type fastReflection_UnbondingDelegationEntry_messageType struct{}
func (x fastReflection_UnbondingDelegationEntry_messageType) Zero() protoreflect.Message {
return (*fastReflection_UnbondingDelegationEntry)(nil)
}
func (x fastReflection_UnbondingDelegationEntry_messageType) New() protoreflect.Message {
return new(fastReflection_UnbondingDelegationEntry)
}
func (x fastReflection_UnbondingDelegationEntry_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_UnbondingDelegationEntry
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_UnbondingDelegationEntry) Descriptor() protoreflect.MessageDescriptor {
return md_UnbondingDelegationEntry
}
// Type returns the message type, which encapsulates both Go and protobuf
// type information. If the Go type information is not needed,
// it is recommended that the message descriptor be used instead.
func (x *fastReflection_UnbondingDelegationEntry) Type() protoreflect.MessageType {
return _fastReflection_UnbondingDelegationEntry_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_UnbondingDelegationEntry) New() protoreflect.Message {
return new(fastReflection_UnbondingDelegationEntry)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_UnbondingDelegationEntry) Interface() protoreflect.ProtoMessage {
return (*UnbondingDelegationEntry)(x)
}
// Range iterates over every populated field in an undefined order,
// calling f for each field descriptor and value encountered.
// Range returns immediately if f returns false.
// While iterating, mutating operations may only be performed
// on the current field descriptor.
func (x *fastReflection_UnbondingDelegationEntry) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
if x.CreationHeight != int64(0) {
value := protoreflect.ValueOfInt64(x.CreationHeight)
if !f(fd_UnbondingDelegationEntry_creation_height, value) {
return
}
}
if x.CompletionTime != nil {
value := protoreflect.ValueOfMessage(x.CompletionTime.ProtoReflect())
if !f(fd_UnbondingDelegationEntry_completion_time, value) {
return
}
}
if x.InitialBalance != "" {
value := protoreflect.ValueOfString(x.InitialBalance)
if !f(fd_UnbondingDelegationEntry_initial_balance, value) {
return
}
}
if x.Balance != "" {
value := protoreflect.ValueOfString(x.Balance)
if !f(fd_UnbondingDelegationEntry_balance, value) {
return
}
}
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_UnbondingDelegationEntry) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
case "cosmos.staking.v1beta1.UnbondingDelegationEntry.creation_height":
return x.CreationHeight != int64(0)
case "cosmos.staking.v1beta1.UnbondingDelegationEntry.completion_time":
return x.CompletionTime != nil
case "cosmos.staking.v1beta1.UnbondingDelegationEntry.initial_balance":
return x.InitialBalance != ""
case "cosmos.staking.v1beta1.UnbondingDelegationEntry.balance":
return x.Balance != ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.UnbondingDelegationEntry"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.UnbondingDelegationEntry does not contain field %s", fd.FullName()))
}
}
// Clear clears the field such that a subsequent Has call reports false.
//
// Clearing an extension field clears both the extension type and value
// associated with the given field number.
//
// Clear is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_UnbondingDelegationEntry) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.UnbondingDelegationEntry.creation_height":
x.CreationHeight = int64(0)
case "cosmos.staking.v1beta1.UnbondingDelegationEntry.completion_time":
x.CompletionTime = nil
case "cosmos.staking.v1beta1.UnbondingDelegationEntry.initial_balance":
x.InitialBalance = ""
case "cosmos.staking.v1beta1.UnbondingDelegationEntry.balance":
x.Balance = ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.UnbondingDelegationEntry"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.UnbondingDelegationEntry does not contain field %s", fd.FullName()))
}
}
// Get retrieves the value for a field.
//
// For unpopulated scalars, it returns the default value, where
// the default value of a bytes scalar is guaranteed to be a copy.
// For unpopulated composite types, it returns an empty, read-only view
// of the value; to obtain a mutable reference, use Mutable.
func (x *fastReflection_UnbondingDelegationEntry) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
case "cosmos.staking.v1beta1.UnbondingDelegationEntry.creation_height":
value := x.CreationHeight
return protoreflect.ValueOfInt64(value)
case "cosmos.staking.v1beta1.UnbondingDelegationEntry.completion_time":
value := x.CompletionTime
return protoreflect.ValueOfMessage(value.ProtoReflect())
case "cosmos.staking.v1beta1.UnbondingDelegationEntry.initial_balance":
value := x.InitialBalance
return protoreflect.ValueOfString(value)
case "cosmos.staking.v1beta1.UnbondingDelegationEntry.balance":
value := x.Balance
return protoreflect.ValueOfString(value)
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.UnbondingDelegationEntry"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.UnbondingDelegationEntry does not contain field %s", descriptor.FullName()))
}
}
// Set stores the value for a field.
//
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType.
// When setting a composite type, it is unspecified whether the stored value
// aliases the source's memory in any way. If the composite value is an
// empty, read-only value, then it panics.
//
// Set is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_UnbondingDelegationEntry) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.UnbondingDelegationEntry.creation_height":
x.CreationHeight = value.Int()
case "cosmos.staking.v1beta1.UnbondingDelegationEntry.completion_time":
x.CompletionTime = value.Message().Interface().(*timestamppb.Timestamp)
case "cosmos.staking.v1beta1.UnbondingDelegationEntry.initial_balance":
x.InitialBalance = value.Interface().(string)
case "cosmos.staking.v1beta1.UnbondingDelegationEntry.balance":
x.Balance = value.Interface().(string)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.UnbondingDelegationEntry"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.UnbondingDelegationEntry does not contain field %s", fd.FullName()))
}
}
// Mutable returns a mutable reference to a composite type.
//
// If the field is unpopulated, it may allocate a composite value.
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType
// if not already stored.
// It panics if the field does not contain a composite type.
//
// Mutable is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_UnbondingDelegationEntry) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.UnbondingDelegationEntry.completion_time":
if x.CompletionTime == nil {
x.CompletionTime = new(timestamppb.Timestamp)
}
return protoreflect.ValueOfMessage(x.CompletionTime.ProtoReflect())
case "cosmos.staking.v1beta1.UnbondingDelegationEntry.creation_height":
panic(fmt.Errorf("field creation_height of message cosmos.staking.v1beta1.UnbondingDelegationEntry is not mutable"))
case "cosmos.staking.v1beta1.UnbondingDelegationEntry.initial_balance":
panic(fmt.Errorf("field initial_balance of message cosmos.staking.v1beta1.UnbondingDelegationEntry is not mutable"))
case "cosmos.staking.v1beta1.UnbondingDelegationEntry.balance":
panic(fmt.Errorf("field balance of message cosmos.staking.v1beta1.UnbondingDelegationEntry is not mutable"))
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.UnbondingDelegationEntry"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.UnbondingDelegationEntry does not contain field %s", fd.FullName()))
}
}
// NewField returns a new value that is assignable to the field
// for the given descriptor. For scalars, this returns the default value.
// For lists, maps, and messages, this returns a new, empty, mutable value.
func (x *fastReflection_UnbondingDelegationEntry) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.UnbondingDelegationEntry.creation_height":
return protoreflect.ValueOfInt64(int64(0))
case "cosmos.staking.v1beta1.UnbondingDelegationEntry.completion_time":
m := new(timestamppb.Timestamp)
return protoreflect.ValueOfMessage(m.ProtoReflect())
case "cosmos.staking.v1beta1.UnbondingDelegationEntry.initial_balance":
return protoreflect.ValueOfString("")
case "cosmos.staking.v1beta1.UnbondingDelegationEntry.balance":
return protoreflect.ValueOfString("")
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.UnbondingDelegationEntry"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.UnbondingDelegationEntry does not contain field %s", fd.FullName()))
}
}
// WhichOneof reports which field within the oneof is populated,
// returning nil if none are populated.
// It panics if the oneof descriptor does not belong to this message.
func (x *fastReflection_UnbondingDelegationEntry) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in cosmos.staking.v1beta1.UnbondingDelegationEntry", d.FullName()))
}
panic("unreachable")
}
// GetUnknown retrieves the entire list of unknown fields.
// The caller may only mutate the contents of the RawFields
// if the mutated bytes are stored back into the message with SetUnknown.
func (x *fastReflection_UnbondingDelegationEntry) GetUnknown() protoreflect.RawFields {
return x.unknownFields
}
// SetUnknown stores an entire list of unknown fields.
// The raw fields must be syntactically valid according to the wire format.
// An implementation may panic if this is not the case.
// Once stored, the caller must not mutate the content of the RawFields.
// An empty RawFields may be passed to clear the fields.
//
// SetUnknown is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_UnbondingDelegationEntry) SetUnknown(fields protoreflect.RawFields) {
x.unknownFields = fields
}
// IsValid reports whether the message is valid.
//
// An invalid message is an empty, read-only value.
//
// An invalid message often corresponds to a nil pointer of the concrete
// message type, but the details are implementation dependent.
// Validity is not part of the protobuf data model, and may not
// be preserved in marshaling or other operations.
func (x *fastReflection_UnbondingDelegationEntry) IsValid() bool {
return x != nil
}
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
// This method may return nil.
//
// The returned methods type is identical to
// "google.golang.org/protobuf/runtime/protoiface".Methods.
// Consult the protoiface package documentation for details.
func (x *fastReflection_UnbondingDelegationEntry) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*UnbondingDelegationEntry)
if x == nil {
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: 0,
}
}
options := runtime.SizeInputToOptions(input)
_ = options
var n int
var l int
_ = l
if x.CreationHeight != 0 {
n += 1 + runtime.Sov(uint64(x.CreationHeight))
}
if x.CompletionTime != nil {
l = options.Size(x.CompletionTime)
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.InitialBalance)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.Balance)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: n,
}
}
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
x := input.Message.Interface().(*UnbondingDelegationEntry)
if x == nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
options := runtime.MarshalInputToOptions(input)
_ = options
size := options.Size(x)
dAtA := make([]byte, size)
i := len(dAtA)
_ = i
var l int
_ = l
if x.unknownFields != nil {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if len(x.Balance) > 0 {
i -= len(x.Balance)
copy(dAtA[i:], x.Balance)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Balance)))
i--
dAtA[i] = 0x22
}
if len(x.InitialBalance) > 0 {
i -= len(x.InitialBalance)
copy(dAtA[i:], x.InitialBalance)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.InitialBalance)))
i--
dAtA[i] = 0x1a
}
if x.CompletionTime != nil {
encoded, err := options.Marshal(x.CompletionTime)
if err != nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, err
}
i -= len(encoded)
copy(dAtA[i:], encoded)
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
i--
dAtA[i] = 0x12
}
if x.CreationHeight != 0 {
i = runtime.EncodeVarint(dAtA, i, uint64(x.CreationHeight))
i--
dAtA[i] = 0x8
}
if input.Buf != nil {
input.Buf = append(input.Buf, dAtA...)
} else {
input.Buf = dAtA
}
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
x := input.Message.Interface().(*UnbondingDelegationEntry)
if x == nil {
return protoiface.UnmarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Flags: input.Flags,
}, nil
}
options := runtime.UnmarshalInputToOptions(input)
_ = options
dAtA := input.Buf
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: UnbondingDelegationEntry: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: UnbondingDelegationEntry: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CreationHeight", wireType)
}
x.CreationHeight = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
x.CreationHeight |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CompletionTime", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if x.CompletionTime == nil {
x.CompletionTime = ×tamppb.Timestamp{}
}
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.CompletionTime); err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
iNdEx = postIndex
case 3:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field InitialBalance", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.InitialBalance = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 4:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Balance", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.Balance = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
var (
md_RedelegationEntry protoreflect.MessageDescriptor
fd_RedelegationEntry_creation_height protoreflect.FieldDescriptor
fd_RedelegationEntry_completion_time protoreflect.FieldDescriptor
fd_RedelegationEntry_initial_balance protoreflect.FieldDescriptor
fd_RedelegationEntry_shares_dst protoreflect.FieldDescriptor
)
func init() {
file_cosmos_staking_v1beta1_staking_proto_init()
md_RedelegationEntry = File_cosmos_staking_v1beta1_staking_proto.Messages().ByName("RedelegationEntry")
fd_RedelegationEntry_creation_height = md_RedelegationEntry.Fields().ByName("creation_height")
fd_RedelegationEntry_completion_time = md_RedelegationEntry.Fields().ByName("completion_time")
fd_RedelegationEntry_initial_balance = md_RedelegationEntry.Fields().ByName("initial_balance")
fd_RedelegationEntry_shares_dst = md_RedelegationEntry.Fields().ByName("shares_dst")
}
var _ protoreflect.Message = (*fastReflection_RedelegationEntry)(nil)
type fastReflection_RedelegationEntry RedelegationEntry
func (x *RedelegationEntry) ProtoReflect() protoreflect.Message {
return (*fastReflection_RedelegationEntry)(x)
}
func (x *RedelegationEntry) slowProtoReflect() protoreflect.Message {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[13]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
var _fastReflection_RedelegationEntry_messageType fastReflection_RedelegationEntry_messageType
var _ protoreflect.MessageType = fastReflection_RedelegationEntry_messageType{}
type fastReflection_RedelegationEntry_messageType struct{}
func (x fastReflection_RedelegationEntry_messageType) Zero() protoreflect.Message {
return (*fastReflection_RedelegationEntry)(nil)
}
func (x fastReflection_RedelegationEntry_messageType) New() protoreflect.Message {
return new(fastReflection_RedelegationEntry)
}
func (x fastReflection_RedelegationEntry_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_RedelegationEntry
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_RedelegationEntry) Descriptor() protoreflect.MessageDescriptor {
return md_RedelegationEntry
}
// Type returns the message type, which encapsulates both Go and protobuf
// type information. If the Go type information is not needed,
// it is recommended that the message descriptor be used instead.
func (x *fastReflection_RedelegationEntry) Type() protoreflect.MessageType {
return _fastReflection_RedelegationEntry_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_RedelegationEntry) New() protoreflect.Message {
return new(fastReflection_RedelegationEntry)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_RedelegationEntry) Interface() protoreflect.ProtoMessage {
return (*RedelegationEntry)(x)
}
// Range iterates over every populated field in an undefined order,
// calling f for each field descriptor and value encountered.
// Range returns immediately if f returns false.
// While iterating, mutating operations may only be performed
// on the current field descriptor.
func (x *fastReflection_RedelegationEntry) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
if x.CreationHeight != int64(0) {
value := protoreflect.ValueOfInt64(x.CreationHeight)
if !f(fd_RedelegationEntry_creation_height, value) {
return
}
}
if x.CompletionTime != nil {
value := protoreflect.ValueOfMessage(x.CompletionTime.ProtoReflect())
if !f(fd_RedelegationEntry_completion_time, value) {
return
}
}
if x.InitialBalance != "" {
value := protoreflect.ValueOfString(x.InitialBalance)
if !f(fd_RedelegationEntry_initial_balance, value) {
return
}
}
if x.SharesDst != "" {
value := protoreflect.ValueOfString(x.SharesDst)
if !f(fd_RedelegationEntry_shares_dst, value) {
return
}
}
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_RedelegationEntry) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
case "cosmos.staking.v1beta1.RedelegationEntry.creation_height":
return x.CreationHeight != int64(0)
case "cosmos.staking.v1beta1.RedelegationEntry.completion_time":
return x.CompletionTime != nil
case "cosmos.staking.v1beta1.RedelegationEntry.initial_balance":
return x.InitialBalance != ""
case "cosmos.staking.v1beta1.RedelegationEntry.shares_dst":
return x.SharesDst != ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.RedelegationEntry"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.RedelegationEntry does not contain field %s", fd.FullName()))
}
}
// Clear clears the field such that a subsequent Has call reports false.
//
// Clearing an extension field clears both the extension type and value
// associated with the given field number.
//
// Clear is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_RedelegationEntry) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.RedelegationEntry.creation_height":
x.CreationHeight = int64(0)
case "cosmos.staking.v1beta1.RedelegationEntry.completion_time":
x.CompletionTime = nil
case "cosmos.staking.v1beta1.RedelegationEntry.initial_balance":
x.InitialBalance = ""
case "cosmos.staking.v1beta1.RedelegationEntry.shares_dst":
x.SharesDst = ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.RedelegationEntry"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.RedelegationEntry does not contain field %s", fd.FullName()))
}
}
// Get retrieves the value for a field.
//
// For unpopulated scalars, it returns the default value, where
// the default value of a bytes scalar is guaranteed to be a copy.
// For unpopulated composite types, it returns an empty, read-only view
// of the value; to obtain a mutable reference, use Mutable.
func (x *fastReflection_RedelegationEntry) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
case "cosmos.staking.v1beta1.RedelegationEntry.creation_height":
value := x.CreationHeight
return protoreflect.ValueOfInt64(value)
case "cosmos.staking.v1beta1.RedelegationEntry.completion_time":
value := x.CompletionTime
return protoreflect.ValueOfMessage(value.ProtoReflect())
case "cosmos.staking.v1beta1.RedelegationEntry.initial_balance":
value := x.InitialBalance
return protoreflect.ValueOfString(value)
case "cosmos.staking.v1beta1.RedelegationEntry.shares_dst":
value := x.SharesDst
return protoreflect.ValueOfString(value)
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.RedelegationEntry"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.RedelegationEntry does not contain field %s", descriptor.FullName()))
}
}
// Set stores the value for a field.
//
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType.
// When setting a composite type, it is unspecified whether the stored value
// aliases the source's memory in any way. If the composite value is an
// empty, read-only value, then it panics.
//
// Set is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_RedelegationEntry) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.RedelegationEntry.creation_height":
x.CreationHeight = value.Int()
case "cosmos.staking.v1beta1.RedelegationEntry.completion_time":
x.CompletionTime = value.Message().Interface().(*timestamppb.Timestamp)
case "cosmos.staking.v1beta1.RedelegationEntry.initial_balance":
x.InitialBalance = value.Interface().(string)
case "cosmos.staking.v1beta1.RedelegationEntry.shares_dst":
x.SharesDst = value.Interface().(string)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.RedelegationEntry"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.RedelegationEntry does not contain field %s", fd.FullName()))
}
}
// Mutable returns a mutable reference to a composite type.
//
// If the field is unpopulated, it may allocate a composite value.
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType
// if not already stored.
// It panics if the field does not contain a composite type.
//
// Mutable is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_RedelegationEntry) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.RedelegationEntry.completion_time":
if x.CompletionTime == nil {
x.CompletionTime = new(timestamppb.Timestamp)
}
return protoreflect.ValueOfMessage(x.CompletionTime.ProtoReflect())
case "cosmos.staking.v1beta1.RedelegationEntry.creation_height":
panic(fmt.Errorf("field creation_height of message cosmos.staking.v1beta1.RedelegationEntry is not mutable"))
case "cosmos.staking.v1beta1.RedelegationEntry.initial_balance":
panic(fmt.Errorf("field initial_balance of message cosmos.staking.v1beta1.RedelegationEntry is not mutable"))
case "cosmos.staking.v1beta1.RedelegationEntry.shares_dst":
panic(fmt.Errorf("field shares_dst of message cosmos.staking.v1beta1.RedelegationEntry is not mutable"))
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.RedelegationEntry"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.RedelegationEntry does not contain field %s", fd.FullName()))
}
}
// NewField returns a new value that is assignable to the field
// for the given descriptor. For scalars, this returns the default value.
// For lists, maps, and messages, this returns a new, empty, mutable value.
func (x *fastReflection_RedelegationEntry) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.RedelegationEntry.creation_height":
return protoreflect.ValueOfInt64(int64(0))
case "cosmos.staking.v1beta1.RedelegationEntry.completion_time":
m := new(timestamppb.Timestamp)
return protoreflect.ValueOfMessage(m.ProtoReflect())
case "cosmos.staking.v1beta1.RedelegationEntry.initial_balance":
return protoreflect.ValueOfString("")
case "cosmos.staking.v1beta1.RedelegationEntry.shares_dst":
return protoreflect.ValueOfString("")
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.RedelegationEntry"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.RedelegationEntry does not contain field %s", fd.FullName()))
}
}
// WhichOneof reports which field within the oneof is populated,
// returning nil if none are populated.
// It panics if the oneof descriptor does not belong to this message.
func (x *fastReflection_RedelegationEntry) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in cosmos.staking.v1beta1.RedelegationEntry", d.FullName()))
}
panic("unreachable")
}
// GetUnknown retrieves the entire list of unknown fields.
// The caller may only mutate the contents of the RawFields
// if the mutated bytes are stored back into the message with SetUnknown.
func (x *fastReflection_RedelegationEntry) GetUnknown() protoreflect.RawFields {
return x.unknownFields
}
// SetUnknown stores an entire list of unknown fields.
// The raw fields must be syntactically valid according to the wire format.
// An implementation may panic if this is not the case.
// Once stored, the caller must not mutate the content of the RawFields.
// An empty RawFields may be passed to clear the fields.
//
// SetUnknown is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_RedelegationEntry) SetUnknown(fields protoreflect.RawFields) {
x.unknownFields = fields
}
// IsValid reports whether the message is valid.
//
// An invalid message is an empty, read-only value.
//
// An invalid message often corresponds to a nil pointer of the concrete
// message type, but the details are implementation dependent.
// Validity is not part of the protobuf data model, and may not
// be preserved in marshaling or other operations.
func (x *fastReflection_RedelegationEntry) IsValid() bool {
return x != nil
}
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
// This method may return nil.
//
// The returned methods type is identical to
// "google.golang.org/protobuf/runtime/protoiface".Methods.
// Consult the protoiface package documentation for details.
func (x *fastReflection_RedelegationEntry) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*RedelegationEntry)
if x == nil {
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: 0,
}
}
options := runtime.SizeInputToOptions(input)
_ = options
var n int
var l int
_ = l
if x.CreationHeight != 0 {
n += 1 + runtime.Sov(uint64(x.CreationHeight))
}
if x.CompletionTime != nil {
l = options.Size(x.CompletionTime)
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.InitialBalance)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.SharesDst)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: n,
}
}
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
x := input.Message.Interface().(*RedelegationEntry)
if x == nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
options := runtime.MarshalInputToOptions(input)
_ = options
size := options.Size(x)
dAtA := make([]byte, size)
i := len(dAtA)
_ = i
var l int
_ = l
if x.unknownFields != nil {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if len(x.SharesDst) > 0 {
i -= len(x.SharesDst)
copy(dAtA[i:], x.SharesDst)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SharesDst)))
i--
dAtA[i] = 0x22
}
if len(x.InitialBalance) > 0 {
i -= len(x.InitialBalance)
copy(dAtA[i:], x.InitialBalance)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.InitialBalance)))
i--
dAtA[i] = 0x1a
}
if x.CompletionTime != nil {
encoded, err := options.Marshal(x.CompletionTime)
if err != nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, err
}
i -= len(encoded)
copy(dAtA[i:], encoded)
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
i--
dAtA[i] = 0x12
}
if x.CreationHeight != 0 {
i = runtime.EncodeVarint(dAtA, i, uint64(x.CreationHeight))
i--
dAtA[i] = 0x8
}
if input.Buf != nil {
input.Buf = append(input.Buf, dAtA...)
} else {
input.Buf = dAtA
}
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
x := input.Message.Interface().(*RedelegationEntry)
if x == nil {
return protoiface.UnmarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Flags: input.Flags,
}, nil
}
options := runtime.UnmarshalInputToOptions(input)
_ = options
dAtA := input.Buf
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: RedelegationEntry: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: RedelegationEntry: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CreationHeight", wireType)
}
x.CreationHeight = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
x.CreationHeight |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CompletionTime", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if x.CompletionTime == nil {
x.CompletionTime = ×tamppb.Timestamp{}
}
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.CompletionTime); err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
iNdEx = postIndex
case 3:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field InitialBalance", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.InitialBalance = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 4:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SharesDst", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.SharesDst = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
var _ protoreflect.List = (*_Redelegation_4_list)(nil)
type _Redelegation_4_list struct {
list *[]*RedelegationEntry
}
func (x *_Redelegation_4_list) Len() int {
if x.list == nil {
return 0
}
return len(*x.list)
}
func (x *_Redelegation_4_list) Get(i int) protoreflect.Value {
return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect())
}
func (x *_Redelegation_4_list) Set(i int, value protoreflect.Value) {
valueUnwrapped := value.Message()
concreteValue := valueUnwrapped.Interface().(*RedelegationEntry)
(*x.list)[i] = concreteValue
}
func (x *_Redelegation_4_list) Append(value protoreflect.Value) {
valueUnwrapped := value.Message()
concreteValue := valueUnwrapped.Interface().(*RedelegationEntry)
*x.list = append(*x.list, concreteValue)
}
func (x *_Redelegation_4_list) AppendMutable() protoreflect.Value {
v := new(RedelegationEntry)
*x.list = append(*x.list, v)
return protoreflect.ValueOfMessage(v.ProtoReflect())
}
func (x *_Redelegation_4_list) Truncate(n int) {
for i := n; i < len(*x.list); i++ {
(*x.list)[i] = nil
}
*x.list = (*x.list)[:n]
}
func (x *_Redelegation_4_list) NewElement() protoreflect.Value {
v := new(RedelegationEntry)
return protoreflect.ValueOfMessage(v.ProtoReflect())
}
func (x *_Redelegation_4_list) IsValid() bool {
return x.list != nil
}
var (
md_Redelegation protoreflect.MessageDescriptor
fd_Redelegation_delegator_address protoreflect.FieldDescriptor
fd_Redelegation_validator_src_address protoreflect.FieldDescriptor
fd_Redelegation_validator_dst_address protoreflect.FieldDescriptor
fd_Redelegation_entries protoreflect.FieldDescriptor
)
func init() {
file_cosmos_staking_v1beta1_staking_proto_init()
md_Redelegation = File_cosmos_staking_v1beta1_staking_proto.Messages().ByName("Redelegation")
fd_Redelegation_delegator_address = md_Redelegation.Fields().ByName("delegator_address")
fd_Redelegation_validator_src_address = md_Redelegation.Fields().ByName("validator_src_address")
fd_Redelegation_validator_dst_address = md_Redelegation.Fields().ByName("validator_dst_address")
fd_Redelegation_entries = md_Redelegation.Fields().ByName("entries")
}
var _ protoreflect.Message = (*fastReflection_Redelegation)(nil)
type fastReflection_Redelegation Redelegation
func (x *Redelegation) ProtoReflect() protoreflect.Message {
return (*fastReflection_Redelegation)(x)
}
func (x *Redelegation) slowProtoReflect() protoreflect.Message {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[14]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
var _fastReflection_Redelegation_messageType fastReflection_Redelegation_messageType
var _ protoreflect.MessageType = fastReflection_Redelegation_messageType{}
type fastReflection_Redelegation_messageType struct{}
func (x fastReflection_Redelegation_messageType) Zero() protoreflect.Message {
return (*fastReflection_Redelegation)(nil)
}
func (x fastReflection_Redelegation_messageType) New() protoreflect.Message {
return new(fastReflection_Redelegation)
}
func (x fastReflection_Redelegation_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_Redelegation
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_Redelegation) Descriptor() protoreflect.MessageDescriptor {
return md_Redelegation
}
// Type returns the message type, which encapsulates both Go and protobuf
// type information. If the Go type information is not needed,
// it is recommended that the message descriptor be used instead.
func (x *fastReflection_Redelegation) Type() protoreflect.MessageType {
return _fastReflection_Redelegation_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_Redelegation) New() protoreflect.Message {
return new(fastReflection_Redelegation)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_Redelegation) Interface() protoreflect.ProtoMessage {
return (*Redelegation)(x)
}
// Range iterates over every populated field in an undefined order,
// calling f for each field descriptor and value encountered.
// Range returns immediately if f returns false.
// While iterating, mutating operations may only be performed
// on the current field descriptor.
func (x *fastReflection_Redelegation) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
if x.DelegatorAddress != "" {
value := protoreflect.ValueOfString(x.DelegatorAddress)
if !f(fd_Redelegation_delegator_address, value) {
return
}
}
if x.ValidatorSrcAddress != "" {
value := protoreflect.ValueOfString(x.ValidatorSrcAddress)
if !f(fd_Redelegation_validator_src_address, value) {
return
}
}
if x.ValidatorDstAddress != "" {
value := protoreflect.ValueOfString(x.ValidatorDstAddress)
if !f(fd_Redelegation_validator_dst_address, value) {
return
}
}
if len(x.Entries) != 0 {
value := protoreflect.ValueOfList(&_Redelegation_4_list{list: &x.Entries})
if !f(fd_Redelegation_entries, value) {
return
}
}
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_Redelegation) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Redelegation.delegator_address":
return x.DelegatorAddress != ""
case "cosmos.staking.v1beta1.Redelegation.validator_src_address":
return x.ValidatorSrcAddress != ""
case "cosmos.staking.v1beta1.Redelegation.validator_dst_address":
return x.ValidatorDstAddress != ""
case "cosmos.staking.v1beta1.Redelegation.entries":
return len(x.Entries) != 0
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Redelegation"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Redelegation does not contain field %s", fd.FullName()))
}
}
// Clear clears the field such that a subsequent Has call reports false.
//
// Clearing an extension field clears both the extension type and value
// associated with the given field number.
//
// Clear is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Redelegation) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Redelegation.delegator_address":
x.DelegatorAddress = ""
case "cosmos.staking.v1beta1.Redelegation.validator_src_address":
x.ValidatorSrcAddress = ""
case "cosmos.staking.v1beta1.Redelegation.validator_dst_address":
x.ValidatorDstAddress = ""
case "cosmos.staking.v1beta1.Redelegation.entries":
x.Entries = nil
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Redelegation"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Redelegation does not contain field %s", fd.FullName()))
}
}
// Get retrieves the value for a field.
//
// For unpopulated scalars, it returns the default value, where
// the default value of a bytes scalar is guaranteed to be a copy.
// For unpopulated composite types, it returns an empty, read-only view
// of the value; to obtain a mutable reference, use Mutable.
func (x *fastReflection_Redelegation) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
case "cosmos.staking.v1beta1.Redelegation.delegator_address":
value := x.DelegatorAddress
return protoreflect.ValueOfString(value)
case "cosmos.staking.v1beta1.Redelegation.validator_src_address":
value := x.ValidatorSrcAddress
return protoreflect.ValueOfString(value)
case "cosmos.staking.v1beta1.Redelegation.validator_dst_address":
value := x.ValidatorDstAddress
return protoreflect.ValueOfString(value)
case "cosmos.staking.v1beta1.Redelegation.entries":
if len(x.Entries) == 0 {
return protoreflect.ValueOfList(&_Redelegation_4_list{})
}
listValue := &_Redelegation_4_list{list: &x.Entries}
return protoreflect.ValueOfList(listValue)
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Redelegation"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Redelegation does not contain field %s", descriptor.FullName()))
}
}
// Set stores the value for a field.
//
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType.
// When setting a composite type, it is unspecified whether the stored value
// aliases the source's memory in any way. If the composite value is an
// empty, read-only value, then it panics.
//
// Set is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Redelegation) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Redelegation.delegator_address":
x.DelegatorAddress = value.Interface().(string)
case "cosmos.staking.v1beta1.Redelegation.validator_src_address":
x.ValidatorSrcAddress = value.Interface().(string)
case "cosmos.staking.v1beta1.Redelegation.validator_dst_address":
x.ValidatorDstAddress = value.Interface().(string)
case "cosmos.staking.v1beta1.Redelegation.entries":
lv := value.List()
clv := lv.(*_Redelegation_4_list)
x.Entries = *clv.list
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Redelegation"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Redelegation does not contain field %s", fd.FullName()))
}
}
// Mutable returns a mutable reference to a composite type.
//
// If the field is unpopulated, it may allocate a composite value.
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType
// if not already stored.
// It panics if the field does not contain a composite type.
//
// Mutable is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Redelegation) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Redelegation.entries":
if x.Entries == nil {
x.Entries = []*RedelegationEntry{}
}
value := &_Redelegation_4_list{list: &x.Entries}
return protoreflect.ValueOfList(value)
case "cosmos.staking.v1beta1.Redelegation.delegator_address":
panic(fmt.Errorf("field delegator_address of message cosmos.staking.v1beta1.Redelegation is not mutable"))
case "cosmos.staking.v1beta1.Redelegation.validator_src_address":
panic(fmt.Errorf("field validator_src_address of message cosmos.staking.v1beta1.Redelegation is not mutable"))
case "cosmos.staking.v1beta1.Redelegation.validator_dst_address":
panic(fmt.Errorf("field validator_dst_address of message cosmos.staking.v1beta1.Redelegation is not mutable"))
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Redelegation"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Redelegation does not contain field %s", fd.FullName()))
}
}
// NewField returns a new value that is assignable to the field
// for the given descriptor. For scalars, this returns the default value.
// For lists, maps, and messages, this returns a new, empty, mutable value.
func (x *fastReflection_Redelegation) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Redelegation.delegator_address":
return protoreflect.ValueOfString("")
case "cosmos.staking.v1beta1.Redelegation.validator_src_address":
return protoreflect.ValueOfString("")
case "cosmos.staking.v1beta1.Redelegation.validator_dst_address":
return protoreflect.ValueOfString("")
case "cosmos.staking.v1beta1.Redelegation.entries":
list := []*RedelegationEntry{}
return protoreflect.ValueOfList(&_Redelegation_4_list{list: &list})
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Redelegation"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Redelegation does not contain field %s", fd.FullName()))
}
}
// WhichOneof reports which field within the oneof is populated,
// returning nil if none are populated.
// It panics if the oneof descriptor does not belong to this message.
func (x *fastReflection_Redelegation) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in cosmos.staking.v1beta1.Redelegation", d.FullName()))
}
panic("unreachable")
}
// GetUnknown retrieves the entire list of unknown fields.
// The caller may only mutate the contents of the RawFields
// if the mutated bytes are stored back into the message with SetUnknown.
func (x *fastReflection_Redelegation) GetUnknown() protoreflect.RawFields {
return x.unknownFields
}
// SetUnknown stores an entire list of unknown fields.
// The raw fields must be syntactically valid according to the wire format.
// An implementation may panic if this is not the case.
// Once stored, the caller must not mutate the content of the RawFields.
// An empty RawFields may be passed to clear the fields.
//
// SetUnknown is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Redelegation) SetUnknown(fields protoreflect.RawFields) {
x.unknownFields = fields
}
// IsValid reports whether the message is valid.
//
// An invalid message is an empty, read-only value.
//
// An invalid message often corresponds to a nil pointer of the concrete
// message type, but the details are implementation dependent.
// Validity is not part of the protobuf data model, and may not
// be preserved in marshaling or other operations.
func (x *fastReflection_Redelegation) IsValid() bool {
return x != nil
}
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
// This method may return nil.
//
// The returned methods type is identical to
// "google.golang.org/protobuf/runtime/protoiface".Methods.
// Consult the protoiface package documentation for details.
func (x *fastReflection_Redelegation) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*Redelegation)
if x == nil {
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: 0,
}
}
options := runtime.SizeInputToOptions(input)
_ = options
var n int
var l int
_ = l
l = len(x.DelegatorAddress)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.ValidatorSrcAddress)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.ValidatorDstAddress)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
if len(x.Entries) > 0 {
for _, e := range x.Entries {
l = options.Size(e)
n += 1 + l + runtime.Sov(uint64(l))
}
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: n,
}
}
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
x := input.Message.Interface().(*Redelegation)
if x == nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
options := runtime.MarshalInputToOptions(input)
_ = options
size := options.Size(x)
dAtA := make([]byte, size)
i := len(dAtA)
_ = i
var l int
_ = l
if x.unknownFields != nil {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if len(x.Entries) > 0 {
for iNdEx := len(x.Entries) - 1; iNdEx >= 0; iNdEx-- {
encoded, err := options.Marshal(x.Entries[iNdEx])
if err != nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, err
}
i -= len(encoded)
copy(dAtA[i:], encoded)
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
i--
dAtA[i] = 0x22
}
}
if len(x.ValidatorDstAddress) > 0 {
i -= len(x.ValidatorDstAddress)
copy(dAtA[i:], x.ValidatorDstAddress)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorDstAddress)))
i--
dAtA[i] = 0x1a
}
if len(x.ValidatorSrcAddress) > 0 {
i -= len(x.ValidatorSrcAddress)
copy(dAtA[i:], x.ValidatorSrcAddress)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorSrcAddress)))
i--
dAtA[i] = 0x12
}
if len(x.DelegatorAddress) > 0 {
i -= len(x.DelegatorAddress)
copy(dAtA[i:], x.DelegatorAddress)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DelegatorAddress)))
i--
dAtA[i] = 0xa
}
if input.Buf != nil {
input.Buf = append(input.Buf, dAtA...)
} else {
input.Buf = dAtA
}
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
x := input.Message.Interface().(*Redelegation)
if x == nil {
return protoiface.UnmarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Flags: input.Flags,
}, nil
}
options := runtime.UnmarshalInputToOptions(input)
_ = options
dAtA := input.Buf
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Redelegation: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Redelegation: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.DelegatorAddress = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ValidatorSrcAddress", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.ValidatorSrcAddress = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ValidatorDstAddress", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.ValidatorDstAddress = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 4:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.Entries = append(x.Entries, &RedelegationEntry{})
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Entries[len(x.Entries)-1]); err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
var (
md_Params protoreflect.MessageDescriptor
fd_Params_unbonding_time protoreflect.FieldDescriptor
fd_Params_max_validators protoreflect.FieldDescriptor
fd_Params_max_entries protoreflect.FieldDescriptor
fd_Params_historical_entries protoreflect.FieldDescriptor
fd_Params_bond_denom protoreflect.FieldDescriptor
fd_Params_min_commission_rate protoreflect.FieldDescriptor
)
func init() {
file_cosmos_staking_v1beta1_staking_proto_init()
md_Params = File_cosmos_staking_v1beta1_staking_proto.Messages().ByName("Params")
fd_Params_unbonding_time = md_Params.Fields().ByName("unbonding_time")
fd_Params_max_validators = md_Params.Fields().ByName("max_validators")
fd_Params_max_entries = md_Params.Fields().ByName("max_entries")
fd_Params_historical_entries = md_Params.Fields().ByName("historical_entries")
fd_Params_bond_denom = md_Params.Fields().ByName("bond_denom")
fd_Params_min_commission_rate = md_Params.Fields().ByName("min_commission_rate")
}
var _ protoreflect.Message = (*fastReflection_Params)(nil)
type fastReflection_Params Params
func (x *Params) ProtoReflect() protoreflect.Message {
return (*fastReflection_Params)(x)
}
func (x *Params) slowProtoReflect() protoreflect.Message {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[15]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
var _fastReflection_Params_messageType fastReflection_Params_messageType
var _ protoreflect.MessageType = fastReflection_Params_messageType{}
type fastReflection_Params_messageType struct{}
func (x fastReflection_Params_messageType) Zero() protoreflect.Message {
return (*fastReflection_Params)(nil)
}
func (x fastReflection_Params_messageType) New() protoreflect.Message {
return new(fastReflection_Params)
}
func (x fastReflection_Params_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_Params
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_Params) Descriptor() protoreflect.MessageDescriptor {
return md_Params
}
// Type returns the message type, which encapsulates both Go and protobuf
// type information. If the Go type information is not needed,
// it is recommended that the message descriptor be used instead.
func (x *fastReflection_Params) Type() protoreflect.MessageType {
return _fastReflection_Params_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_Params) New() protoreflect.Message {
return new(fastReflection_Params)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage {
return (*Params)(x)
}
// Range iterates over every populated field in an undefined order,
// calling f for each field descriptor and value encountered.
// Range returns immediately if f returns false.
// While iterating, mutating operations may only be performed
// on the current field descriptor.
func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
if x.UnbondingTime != nil {
value := protoreflect.ValueOfMessage(x.UnbondingTime.ProtoReflect())
if !f(fd_Params_unbonding_time, value) {
return
}
}
if x.MaxValidators != uint32(0) {
value := protoreflect.ValueOfUint32(x.MaxValidators)
if !f(fd_Params_max_validators, value) {
return
}
}
if x.MaxEntries != uint32(0) {
value := protoreflect.ValueOfUint32(x.MaxEntries)
if !f(fd_Params_max_entries, value) {
return
}
}
if x.HistoricalEntries != uint32(0) {
value := protoreflect.ValueOfUint32(x.HistoricalEntries)
if !f(fd_Params_historical_entries, value) {
return
}
}
if x.BondDenom != "" {
value := protoreflect.ValueOfString(x.BondDenom)
if !f(fd_Params_bond_denom, value) {
return
}
}
if x.MinCommissionRate != "" {
value := protoreflect.ValueOfString(x.MinCommissionRate)
if !f(fd_Params_min_commission_rate, value) {
return
}
}
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Params.unbonding_time":
return x.UnbondingTime != nil
case "cosmos.staking.v1beta1.Params.max_validators":
return x.MaxValidators != uint32(0)
case "cosmos.staking.v1beta1.Params.max_entries":
return x.MaxEntries != uint32(0)
case "cosmos.staking.v1beta1.Params.historical_entries":
return x.HistoricalEntries != uint32(0)
case "cosmos.staking.v1beta1.Params.bond_denom":
return x.BondDenom != ""
case "cosmos.staking.v1beta1.Params.min_commission_rate":
return x.MinCommissionRate != ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Params"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Params does not contain field %s", fd.FullName()))
}
}
// Clear clears the field such that a subsequent Has call reports false.
//
// Clearing an extension field clears both the extension type and value
// associated with the given field number.
//
// Clear is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Params.unbonding_time":
x.UnbondingTime = nil
case "cosmos.staking.v1beta1.Params.max_validators":
x.MaxValidators = uint32(0)
case "cosmos.staking.v1beta1.Params.max_entries":
x.MaxEntries = uint32(0)
case "cosmos.staking.v1beta1.Params.historical_entries":
x.HistoricalEntries = uint32(0)
case "cosmos.staking.v1beta1.Params.bond_denom":
x.BondDenom = ""
case "cosmos.staking.v1beta1.Params.min_commission_rate":
x.MinCommissionRate = ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Params"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Params does not contain field %s", fd.FullName()))
}
}
// Get retrieves the value for a field.
//
// For unpopulated scalars, it returns the default value, where
// the default value of a bytes scalar is guaranteed to be a copy.
// For unpopulated composite types, it returns an empty, read-only view
// of the value; to obtain a mutable reference, use Mutable.
func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
case "cosmos.staking.v1beta1.Params.unbonding_time":
value := x.UnbondingTime
return protoreflect.ValueOfMessage(value.ProtoReflect())
case "cosmos.staking.v1beta1.Params.max_validators":
value := x.MaxValidators
return protoreflect.ValueOfUint32(value)
case "cosmos.staking.v1beta1.Params.max_entries":
value := x.MaxEntries
return protoreflect.ValueOfUint32(value)
case "cosmos.staking.v1beta1.Params.historical_entries":
value := x.HistoricalEntries
return protoreflect.ValueOfUint32(value)
case "cosmos.staking.v1beta1.Params.bond_denom":
value := x.BondDenom
return protoreflect.ValueOfString(value)
case "cosmos.staking.v1beta1.Params.min_commission_rate":
value := x.MinCommissionRate
return protoreflect.ValueOfString(value)
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Params"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Params does not contain field %s", descriptor.FullName()))
}
}
// Set stores the value for a field.
//
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType.
// When setting a composite type, it is unspecified whether the stored value
// aliases the source's memory in any way. If the composite value is an
// empty, read-only value, then it panics.
//
// Set is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Params.unbonding_time":
x.UnbondingTime = value.Message().Interface().(*durationpb.Duration)
case "cosmos.staking.v1beta1.Params.max_validators":
x.MaxValidators = uint32(value.Uint())
case "cosmos.staking.v1beta1.Params.max_entries":
x.MaxEntries = uint32(value.Uint())
case "cosmos.staking.v1beta1.Params.historical_entries":
x.HistoricalEntries = uint32(value.Uint())
case "cosmos.staking.v1beta1.Params.bond_denom":
x.BondDenom = value.Interface().(string)
case "cosmos.staking.v1beta1.Params.min_commission_rate":
x.MinCommissionRate = value.Interface().(string)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Params"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Params does not contain field %s", fd.FullName()))
}
}
// Mutable returns a mutable reference to a composite type.
//
// If the field is unpopulated, it may allocate a composite value.
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType
// if not already stored.
// It panics if the field does not contain a composite type.
//
// Mutable is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Params.unbonding_time":
if x.UnbondingTime == nil {
x.UnbondingTime = new(durationpb.Duration)
}
return protoreflect.ValueOfMessage(x.UnbondingTime.ProtoReflect())
case "cosmos.staking.v1beta1.Params.max_validators":
panic(fmt.Errorf("field max_validators of message cosmos.staking.v1beta1.Params is not mutable"))
case "cosmos.staking.v1beta1.Params.max_entries":
panic(fmt.Errorf("field max_entries of message cosmos.staking.v1beta1.Params is not mutable"))
case "cosmos.staking.v1beta1.Params.historical_entries":
panic(fmt.Errorf("field historical_entries of message cosmos.staking.v1beta1.Params is not mutable"))
case "cosmos.staking.v1beta1.Params.bond_denom":
panic(fmt.Errorf("field bond_denom of message cosmos.staking.v1beta1.Params is not mutable"))
case "cosmos.staking.v1beta1.Params.min_commission_rate":
panic(fmt.Errorf("field min_commission_rate of message cosmos.staking.v1beta1.Params is not mutable"))
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Params"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Params does not contain field %s", fd.FullName()))
}
}
// NewField returns a new value that is assignable to the field
// for the given descriptor. For scalars, this returns the default value.
// For lists, maps, and messages, this returns a new, empty, mutable value.
func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Params.unbonding_time":
m := new(durationpb.Duration)
return protoreflect.ValueOfMessage(m.ProtoReflect())
case "cosmos.staking.v1beta1.Params.max_validators":
return protoreflect.ValueOfUint32(uint32(0))
case "cosmos.staking.v1beta1.Params.max_entries":
return protoreflect.ValueOfUint32(uint32(0))
case "cosmos.staking.v1beta1.Params.historical_entries":
return protoreflect.ValueOfUint32(uint32(0))
case "cosmos.staking.v1beta1.Params.bond_denom":
return protoreflect.ValueOfString("")
case "cosmos.staking.v1beta1.Params.min_commission_rate":
return protoreflect.ValueOfString("")
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Params"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Params does not contain field %s", fd.FullName()))
}
}
// WhichOneof reports which field within the oneof is populated,
// returning nil if none are populated.
// It panics if the oneof descriptor does not belong to this message.
func (x *fastReflection_Params) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in cosmos.staking.v1beta1.Params", d.FullName()))
}
panic("unreachable")
}
// GetUnknown retrieves the entire list of unknown fields.
// The caller may only mutate the contents of the RawFields
// if the mutated bytes are stored back into the message with SetUnknown.
func (x *fastReflection_Params) GetUnknown() protoreflect.RawFields {
return x.unknownFields
}
// SetUnknown stores an entire list of unknown fields.
// The raw fields must be syntactically valid according to the wire format.
// An implementation may panic if this is not the case.
// Once stored, the caller must not mutate the content of the RawFields.
// An empty RawFields may be passed to clear the fields.
//
// SetUnknown is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Params) SetUnknown(fields protoreflect.RawFields) {
x.unknownFields = fields
}
// IsValid reports whether the message is valid.
//
// An invalid message is an empty, read-only value.
//
// An invalid message often corresponds to a nil pointer of the concrete
// message type, but the details are implementation dependent.
// Validity is not part of the protobuf data model, and may not
// be preserved in marshaling or other operations.
func (x *fastReflection_Params) IsValid() bool {
return x != nil
}
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
// This method may return nil.
//
// The returned methods type is identical to
// "google.golang.org/protobuf/runtime/protoiface".Methods.
// Consult the protoiface package documentation for details.
func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*Params)
if x == nil {
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: 0,
}
}
options := runtime.SizeInputToOptions(input)
_ = options
var n int
var l int
_ = l
if x.UnbondingTime != nil {
l = options.Size(x.UnbondingTime)
n += 1 + l + runtime.Sov(uint64(l))
}
if x.MaxValidators != 0 {
n += 1 + runtime.Sov(uint64(x.MaxValidators))
}
if x.MaxEntries != 0 {
n += 1 + runtime.Sov(uint64(x.MaxEntries))
}
if x.HistoricalEntries != 0 {
n += 1 + runtime.Sov(uint64(x.HistoricalEntries))
}
l = len(x.BondDenom)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.MinCommissionRate)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: n,
}
}
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
x := input.Message.Interface().(*Params)
if x == nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
options := runtime.MarshalInputToOptions(input)
_ = options
size := options.Size(x)
dAtA := make([]byte, size)
i := len(dAtA)
_ = i
var l int
_ = l
if x.unknownFields != nil {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if len(x.MinCommissionRate) > 0 {
i -= len(x.MinCommissionRate)
copy(dAtA[i:], x.MinCommissionRate)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MinCommissionRate)))
i--
dAtA[i] = 0x32
}
if len(x.BondDenom) > 0 {
i -= len(x.BondDenom)
copy(dAtA[i:], x.BondDenom)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BondDenom)))
i--
dAtA[i] = 0x2a
}
if x.HistoricalEntries != 0 {
i = runtime.EncodeVarint(dAtA, i, uint64(x.HistoricalEntries))
i--
dAtA[i] = 0x20
}
if x.MaxEntries != 0 {
i = runtime.EncodeVarint(dAtA, i, uint64(x.MaxEntries))
i--
dAtA[i] = 0x18
}
if x.MaxValidators != 0 {
i = runtime.EncodeVarint(dAtA, i, uint64(x.MaxValidators))
i--
dAtA[i] = 0x10
}
if x.UnbondingTime != nil {
encoded, err := options.Marshal(x.UnbondingTime)
if err != nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, err
}
i -= len(encoded)
copy(dAtA[i:], encoded)
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
i--
dAtA[i] = 0xa
}
if input.Buf != nil {
input.Buf = append(input.Buf, dAtA...)
} else {
input.Buf = dAtA
}
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
x := input.Message.Interface().(*Params)
if x == nil {
return protoiface.UnmarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Flags: input.Flags,
}, nil
}
options := runtime.UnmarshalInputToOptions(input)
_ = options
dAtA := input.Buf
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UnbondingTime", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if x.UnbondingTime == nil {
x.UnbondingTime = &durationpb.Duration{}
}
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.UnbondingTime); err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
iNdEx = postIndex
case 2:
if wireType != 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxValidators", wireType)
}
x.MaxValidators = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
x.MaxValidators |= uint32(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 3:
if wireType != 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxEntries", wireType)
}
x.MaxEntries = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
x.MaxEntries |= uint32(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 4:
if wireType != 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field HistoricalEntries", wireType)
}
x.HistoricalEntries = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
x.HistoricalEntries |= uint32(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 5:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BondDenom", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.BondDenom = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 6:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MinCommissionRate", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.MinCommissionRate = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
var (
md_DelegationResponse protoreflect.MessageDescriptor
fd_DelegationResponse_delegation protoreflect.FieldDescriptor
fd_DelegationResponse_balance protoreflect.FieldDescriptor
)
func
|
() {
file_cosmos_staking_v1beta1_staking_proto_init()
md_DelegationResponse = File_cosmos_staking_v1beta1_staking_proto.Messages().ByName("DelegationResponse")
fd_DelegationResponse_delegation = md_DelegationResponse.Fields().ByName("delegation")
fd_DelegationResponse_balance = md_DelegationResponse.Fields().ByName("balance")
}
var _ protoreflect.Message = (*fastReflection_DelegationResponse)(nil)
type fastReflection_DelegationResponse DelegationResponse
func (x *DelegationResponse) ProtoReflect() protoreflect.Message {
return (*fastReflection_DelegationResponse)(x)
}
func (x *DelegationResponse) slowProtoReflect() protoreflect.Message {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[16]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
var _fastReflection_DelegationResponse_messageType fastReflection_DelegationResponse_messageType
var _ protoreflect.MessageType = fastReflection_DelegationResponse_messageType{}
type fastReflection_DelegationResponse_messageType struct{}
func (x fastReflection_DelegationResponse_messageType) Zero() protoreflect.Message {
return (*fastReflection_DelegationResponse)(nil)
}
func (x fastReflection_DelegationResponse_messageType) New() protoreflect.Message {
return new(fastReflection_DelegationResponse)
}
func (x fastReflection_DelegationResponse_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_DelegationResponse
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_DelegationResponse) Descriptor() protoreflect.MessageDescriptor {
return md_DelegationResponse
}
// Type returns the message type, which encapsulates both Go and protobuf
// type information. If the Go type information is not needed,
// it is recommended that the message descriptor be used instead.
func (x *fastReflection_DelegationResponse) Type() protoreflect.MessageType {
return _fastReflection_DelegationResponse_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_DelegationResponse) New() protoreflect.Message {
return new(fastReflection_DelegationResponse)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_DelegationResponse) Interface() protoreflect.ProtoMessage {
return (*DelegationResponse)(x)
}
// Range iterates over every populated field in an undefined order,
// calling f for each field descriptor and value encountered.
// Range returns immediately if f returns false.
// While iterating, mutating operations may only be performed
// on the current field descriptor.
func (x *fastReflection_DelegationResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
if x.Delegation != nil {
value := protoreflect.ValueOfMessage(x.Delegation.ProtoReflect())
if !f(fd_DelegationResponse_delegation, value) {
return
}
}
if x.Balance != nil {
value := protoreflect.ValueOfMessage(x.Balance.ProtoReflect())
if !f(fd_DelegationResponse_balance, value) {
return
}
}
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_DelegationResponse) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
case "cosmos.staking.v1beta1.DelegationResponse.delegation":
return x.Delegation != nil
case "cosmos.staking.v1beta1.DelegationResponse.balance":
return x.Balance != nil
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DelegationResponse"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DelegationResponse does not contain field %s", fd.FullName()))
}
}
// Clear clears the field such that a subsequent Has call reports false.
//
// Clearing an extension field clears both the extension type and value
// associated with the given field number.
//
// Clear is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_DelegationResponse) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.DelegationResponse.delegation":
x.Delegation = nil
case "cosmos.staking.v1beta1.DelegationResponse.balance":
x.Balance = nil
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DelegationResponse"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DelegationResponse does not contain field %s", fd.FullName()))
}
}
// Get retrieves the value for a field.
//
// For unpopulated scalars, it returns the default value, where
// the default value of a bytes scalar is guaranteed to be a copy.
// For unpopulated composite types, it returns an empty, read-only view
// of the value; to obtain a mutable reference, use Mutable.
func (x *fastReflection_DelegationResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
case "cosmos.staking.v1beta1.DelegationResponse.delegation":
value := x.Delegation
return protoreflect.ValueOfMessage(value.ProtoReflect())
case "cosmos.staking.v1beta1.DelegationResponse.balance":
value := x.Balance
return protoreflect.ValueOfMessage(value.ProtoReflect())
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DelegationResponse"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DelegationResponse does not contain field %s", descriptor.FullName()))
}
}
// Set stores the value for a field.
//
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType.
// When setting a composite type, it is unspecified whether the stored value
// aliases the source's memory in any way. If the composite value is an
// empty, read-only value, then it panics.
//
// Set is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_DelegationResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.DelegationResponse.delegation":
x.Delegation = value.Message().Interface().(*Delegation)
case "cosmos.staking.v1beta1.DelegationResponse.balance":
x.Balance = value.Message().Interface().(*v1beta1.Coin)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DelegationResponse"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DelegationResponse does not contain field %s", fd.FullName()))
}
}
// Mutable returns a mutable reference to a composite type.
//
// If the field is unpopulated, it may allocate a composite value.
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType
// if not already stored.
// It panics if the field does not contain a composite type.
//
// Mutable is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_DelegationResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.DelegationResponse.delegation":
if x.Delegation == nil {
x.Delegation = new(Delegation)
}
return protoreflect.ValueOfMessage(x.Delegation.ProtoReflect())
case "cosmos.staking.v1beta1.DelegationResponse.balance":
if x.Balance == nil {
x.Balance = new(v1beta1.Coin)
}
return protoreflect.ValueOfMessage(x.Balance.ProtoReflect())
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DelegationResponse"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DelegationResponse does not contain field %s", fd.FullName()))
}
}
// NewField returns a new value that is assignable to the field
// for the given descriptor. For scalars, this returns the default value.
// For lists, maps, and messages, this returns a new, empty, mutable value.
func (x *fastReflection_DelegationResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.DelegationResponse.delegation":
m := new(Delegation)
return protoreflect.ValueOfMessage(m.ProtoReflect())
case "cosmos.staking.v1beta1.DelegationResponse.balance":
m := new(v1beta1.Coin)
return protoreflect.ValueOfMessage(m.ProtoReflect())
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.DelegationResponse"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.DelegationResponse does not contain field %s", fd.FullName()))
}
}
// WhichOneof reports which field within the oneof is populated,
// returning nil if none are populated.
// It panics if the oneof descriptor does not belong to this message.
func (x *fastReflection_DelegationResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in cosmos.staking.v1beta1.DelegationResponse", d.FullName()))
}
panic("unreachable")
}
// GetUnknown retrieves the entire list of unknown fields.
// The caller may only mutate the contents of the RawFields
// if the mutated bytes are stored back into the message with SetUnknown.
func (x *fastReflection_DelegationResponse) GetUnknown() protoreflect.RawFields {
return x.unknownFields
}
// SetUnknown stores an entire list of unknown fields.
// The raw fields must be syntactically valid according to the wire format.
// An implementation may panic if this is not the case.
// Once stored, the caller must not mutate the content of the RawFields.
// An empty RawFields may be passed to clear the fields.
//
// SetUnknown is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_DelegationResponse) SetUnknown(fields protoreflect.RawFields) {
x.unknownFields = fields
}
// IsValid reports whether the message is valid.
//
// An invalid message is an empty, read-only value.
//
// An invalid message often corresponds to a nil pointer of the concrete
// message type, but the details are implementation dependent.
// Validity is not part of the protobuf data model, and may not
// be preserved in marshaling or other operations.
func (x *fastReflection_DelegationResponse) IsValid() bool {
return x != nil
}
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
// This method may return nil.
//
// The returned methods type is identical to
// "google.golang.org/protobuf/runtime/protoiface".Methods.
// Consult the protoiface package documentation for details.
func (x *fastReflection_DelegationResponse) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*DelegationResponse)
if x == nil {
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: 0,
}
}
options := runtime.SizeInputToOptions(input)
_ = options
var n int
var l int
_ = l
if x.Delegation != nil {
l = options.Size(x.Delegation)
n += 1 + l + runtime.Sov(uint64(l))
}
if x.Balance != nil {
l = options.Size(x.Balance)
n += 1 + l + runtime.Sov(uint64(l))
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: n,
}
}
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
x := input.Message.Interface().(*DelegationResponse)
if x == nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
options := runtime.MarshalInputToOptions(input)
_ = options
size := options.Size(x)
dAtA := make([]byte, size)
i := len(dAtA)
_ = i
var l int
_ = l
if x.unknownFields != nil {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if x.Balance != nil {
encoded, err := options.Marshal(x.Balance)
if err != nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, err
}
i -= len(encoded)
copy(dAtA[i:], encoded)
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
i--
dAtA[i] = 0x12
}
if x.Delegation != nil {
encoded, err := options.Marshal(x.Delegation)
if err != nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, err
}
i -= len(encoded)
copy(dAtA[i:], encoded)
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
i--
dAtA[i] = 0xa
}
if input.Buf != nil {
input.Buf = append(input.Buf, dAtA...)
} else {
input.Buf = dAtA
}
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
x := input.Message.Interface().(*DelegationResponse)
if x == nil {
return protoiface.UnmarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Flags: input.Flags,
}, nil
}
options := runtime.UnmarshalInputToOptions(input)
_ = options
dAtA := input.Buf
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DelegationResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DelegationResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Delegation", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if x.Delegation == nil {
x.Delegation = &Delegation{}
}
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Delegation); err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Balance", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if x.Balance == nil {
x.Balance = &v1beta1.Coin{}
}
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Balance); err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
var (
md_RedelegationEntryResponse protoreflect.MessageDescriptor
fd_RedelegationEntryResponse_redelegation_entry protoreflect.FieldDescriptor
fd_RedelegationEntryResponse_balance protoreflect.FieldDescriptor
)
func init() {
file_cosmos_staking_v1beta1_staking_proto_init()
md_RedelegationEntryResponse = File_cosmos_staking_v1beta1_staking_proto.Messages().ByName("RedelegationEntryResponse")
fd_RedelegationEntryResponse_redelegation_entry = md_RedelegationEntryResponse.Fields().ByName("redelegation_entry")
fd_RedelegationEntryResponse_balance = md_RedelegationEntryResponse.Fields().ByName("balance")
}
var _ protoreflect.Message = (*fastReflection_RedelegationEntryResponse)(nil)
type fastReflection_RedelegationEntryResponse RedelegationEntryResponse
func (x *RedelegationEntryResponse) ProtoReflect() protoreflect.Message {
return (*fastReflection_RedelegationEntryResponse)(x)
}
func (x *RedelegationEntryResponse) slowProtoReflect() protoreflect.Message {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[17]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
var _fastReflection_RedelegationEntryResponse_messageType fastReflection_RedelegationEntryResponse_messageType
var _ protoreflect.MessageType = fastReflection_RedelegationEntryResponse_messageType{}
type fastReflection_RedelegationEntryResponse_messageType struct{}
func (x fastReflection_RedelegationEntryResponse_messageType) Zero() protoreflect.Message {
return (*fastReflection_RedelegationEntryResponse)(nil)
}
func (x fastReflection_RedelegationEntryResponse_messageType) New() protoreflect.Message {
return new(fastReflection_RedelegationEntryResponse)
}
func (x fastReflection_RedelegationEntryResponse_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_RedelegationEntryResponse
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_RedelegationEntryResponse) Descriptor() protoreflect.MessageDescriptor {
return md_RedelegationEntryResponse
}
// Type returns the message type, which encapsulates both Go and protobuf
// type information. If the Go type information is not needed,
// it is recommended that the message descriptor be used instead.
func (x *fastReflection_RedelegationEntryResponse) Type() protoreflect.MessageType {
return _fastReflection_RedelegationEntryResponse_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_RedelegationEntryResponse) New() protoreflect.Message {
return new(fastReflection_RedelegationEntryResponse)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_RedelegationEntryResponse) Interface() protoreflect.ProtoMessage {
return (*RedelegationEntryResponse)(x)
}
// Range iterates over every populated field in an undefined order,
// calling f for each field descriptor and value encountered.
// Range returns immediately if f returns false.
// While iterating, mutating operations may only be performed
// on the current field descriptor.
func (x *fastReflection_RedelegationEntryResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
if x.RedelegationEntry != nil {
value := protoreflect.ValueOfMessage(x.RedelegationEntry.ProtoReflect())
if !f(fd_RedelegationEntryResponse_redelegation_entry, value) {
return
}
}
if x.Balance != "" {
value := protoreflect.ValueOfString(x.Balance)
if !f(fd_RedelegationEntryResponse_balance, value) {
return
}
}
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_RedelegationEntryResponse) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
case "cosmos.staking.v1beta1.RedelegationEntryResponse.redelegation_entry":
return x.RedelegationEntry != nil
case "cosmos.staking.v1beta1.RedelegationEntryResponse.balance":
return x.Balance != ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.RedelegationEntryResponse"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.RedelegationEntryResponse does not contain field %s", fd.FullName()))
}
}
// Clear clears the field such that a subsequent Has call reports false.
//
// Clearing an extension field clears both the extension type and value
// associated with the given field number.
//
// Clear is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_RedelegationEntryResponse) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.RedelegationEntryResponse.redelegation_entry":
x.RedelegationEntry = nil
case "cosmos.staking.v1beta1.RedelegationEntryResponse.balance":
x.Balance = ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.RedelegationEntryResponse"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.RedelegationEntryResponse does not contain field %s", fd.FullName()))
}
}
// Get retrieves the value for a field.
//
// For unpopulated scalars, it returns the default value, where
// the default value of a bytes scalar is guaranteed to be a copy.
// For unpopulated composite types, it returns an empty, read-only view
// of the value; to obtain a mutable reference, use Mutable.
func (x *fastReflection_RedelegationEntryResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
case "cosmos.staking.v1beta1.RedelegationEntryResponse.redelegation_entry":
value := x.RedelegationEntry
return protoreflect.ValueOfMessage(value.ProtoReflect())
case "cosmos.staking.v1beta1.RedelegationEntryResponse.balance":
value := x.Balance
return protoreflect.ValueOfString(value)
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.RedelegationEntryResponse"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.RedelegationEntryResponse does not contain field %s", descriptor.FullName()))
}
}
// Set stores the value for a field.
//
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType.
// When setting a composite type, it is unspecified whether the stored value
// aliases the source's memory in any way. If the composite value is an
// empty, read-only value, then it panics.
//
// Set is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_RedelegationEntryResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.RedelegationEntryResponse.redelegation_entry":
x.RedelegationEntry = value.Message().Interface().(*RedelegationEntry)
case "cosmos.staking.v1beta1.RedelegationEntryResponse.balance":
x.Balance = value.Interface().(string)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.RedelegationEntryResponse"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.RedelegationEntryResponse does not contain field %s", fd.FullName()))
}
}
// Mutable returns a mutable reference to a composite type.
//
// If the field is unpopulated, it may allocate a composite value.
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType
// if not already stored.
// It panics if the field does not contain a composite type.
//
// Mutable is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_RedelegationEntryResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.RedelegationEntryResponse.redelegation_entry":
if x.RedelegationEntry == nil {
x.RedelegationEntry = new(RedelegationEntry)
}
return protoreflect.ValueOfMessage(x.RedelegationEntry.ProtoReflect())
case "cosmos.staking.v1beta1.RedelegationEntryResponse.balance":
panic(fmt.Errorf("field balance of message cosmos.staking.v1beta1.RedelegationEntryResponse is not mutable"))
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.RedelegationEntryResponse"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.RedelegationEntryResponse does not contain field %s", fd.FullName()))
}
}
// NewField returns a new value that is assignable to the field
// for the given descriptor. For scalars, this returns the default value.
// For lists, maps, and messages, this returns a new, empty, mutable value.
func (x *fastReflection_RedelegationEntryResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.RedelegationEntryResponse.redelegation_entry":
m := new(RedelegationEntry)
return protoreflect.ValueOfMessage(m.ProtoReflect())
case "cosmos.staking.v1beta1.RedelegationEntryResponse.balance":
return protoreflect.ValueOfString("")
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.RedelegationEntryResponse"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.RedelegationEntryResponse does not contain field %s", fd.FullName()))
}
}
// WhichOneof reports which field within the oneof is populated,
// returning nil if none are populated.
// It panics if the oneof descriptor does not belong to this message.
func (x *fastReflection_RedelegationEntryResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in cosmos.staking.v1beta1.RedelegationEntryResponse", d.FullName()))
}
panic("unreachable")
}
// GetUnknown retrieves the entire list of unknown fields.
// The caller may only mutate the contents of the RawFields
// if the mutated bytes are stored back into the message with SetUnknown.
func (x *fastReflection_RedelegationEntryResponse) GetUnknown() protoreflect.RawFields {
return x.unknownFields
}
// SetUnknown stores an entire list of unknown fields.
// The raw fields must be syntactically valid according to the wire format.
// An implementation may panic if this is not the case.
// Once stored, the caller must not mutate the content of the RawFields.
// An empty RawFields may be passed to clear the fields.
//
// SetUnknown is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_RedelegationEntryResponse) SetUnknown(fields protoreflect.RawFields) {
x.unknownFields = fields
}
// IsValid reports whether the message is valid.
//
// An invalid message is an empty, read-only value.
//
// An invalid message often corresponds to a nil pointer of the concrete
// message type, but the details are implementation dependent.
// Validity is not part of the protobuf data model, and may not
// be preserved in marshaling or other operations.
func (x *fastReflection_RedelegationEntryResponse) IsValid() bool {
return x != nil
}
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
// This method may return nil.
//
// The returned methods type is identical to
// "google.golang.org/protobuf/runtime/protoiface".Methods.
// Consult the protoiface package documentation for details.
func (x *fastReflection_RedelegationEntryResponse) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*RedelegationEntryResponse)
if x == nil {
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: 0,
}
}
options := runtime.SizeInputToOptions(input)
_ = options
var n int
var l int
_ = l
if x.RedelegationEntry != nil {
l = options.Size(x.RedelegationEntry)
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.Balance)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: n,
}
}
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
x := input.Message.Interface().(*RedelegationEntryResponse)
if x == nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
options := runtime.MarshalInputToOptions(input)
_ = options
size := options.Size(x)
dAtA := make([]byte, size)
i := len(dAtA)
_ = i
var l int
_ = l
if x.unknownFields != nil {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if len(x.Balance) > 0 {
i -= len(x.Balance)
copy(dAtA[i:], x.Balance)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Balance)))
i--
dAtA[i] = 0x22
}
if x.RedelegationEntry != nil {
encoded, err := options.Marshal(x.RedelegationEntry)
if err != nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, err
}
i -= len(encoded)
copy(dAtA[i:], encoded)
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
i--
dAtA[i] = 0xa
}
if input.Buf != nil {
input.Buf = append(input.Buf, dAtA...)
} else {
input.Buf = dAtA
}
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
x := input.Message.Interface().(*RedelegationEntryResponse)
if x == nil {
return protoiface.UnmarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Flags: input.Flags,
}, nil
}
options := runtime.UnmarshalInputToOptions(input)
_ = options
dAtA := input.Buf
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: RedelegationEntryResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: RedelegationEntryResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RedelegationEntry", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if x.RedelegationEntry == nil {
x.RedelegationEntry = &RedelegationEntry{}
}
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.RedelegationEntry); err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
iNdEx = postIndex
case 4:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Balance", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.Balance = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
var _ protoreflect.List = (*_RedelegationResponse_2_list)(nil)
type _RedelegationResponse_2_list struct {
list *[]*RedelegationEntryResponse
}
func (x *_RedelegationResponse_2_list) Len() int {
if x.list == nil {
return 0
}
return len(*x.list)
}
func (x *_RedelegationResponse_2_list) Get(i int) protoreflect.Value {
return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect())
}
func (x *_RedelegationResponse_2_list) Set(i int, value protoreflect.Value) {
valueUnwrapped := value.Message()
concreteValue := valueUnwrapped.Interface().(*RedelegationEntryResponse)
(*x.list)[i] = concreteValue
}
func (x *_RedelegationResponse_2_list) Append(value protoreflect.Value) {
valueUnwrapped := value.Message()
concreteValue := valueUnwrapped.Interface().(*RedelegationEntryResponse)
*x.list = append(*x.list, concreteValue)
}
func (x *_RedelegationResponse_2_list) AppendMutable() protoreflect.Value {
v := new(RedelegationEntryResponse)
*x.list = append(*x.list, v)
return protoreflect.ValueOfMessage(v.ProtoReflect())
}
func (x *_RedelegationResponse_2_list) Truncate(n int) {
for i := n; i < len(*x.list); i++ {
(*x.list)[i] = nil
}
*x.list = (*x.list)[:n]
}
func (x *_RedelegationResponse_2_list) NewElement() protoreflect.Value {
v := new(RedelegationEntryResponse)
return protoreflect.ValueOfMessage(v.ProtoReflect())
}
func (x *_RedelegationResponse_2_list) IsValid() bool {
return x.list != nil
}
var (
md_RedelegationResponse protoreflect.MessageDescriptor
fd_RedelegationResponse_redelegation protoreflect.FieldDescriptor
fd_RedelegationResponse_entries protoreflect.FieldDescriptor
)
func init() {
file_cosmos_staking_v1beta1_staking_proto_init()
md_RedelegationResponse = File_cosmos_staking_v1beta1_staking_proto.Messages().ByName("RedelegationResponse")
fd_RedelegationResponse_redelegation = md_RedelegationResponse.Fields().ByName("redelegation")
fd_RedelegationResponse_entries = md_RedelegationResponse.Fields().ByName("entries")
}
var _ protoreflect.Message = (*fastReflection_RedelegationResponse)(nil)
type fastReflection_RedelegationResponse RedelegationResponse
func (x *RedelegationResponse) ProtoReflect() protoreflect.Message {
return (*fastReflection_RedelegationResponse)(x)
}
func (x *RedelegationResponse) slowProtoReflect() protoreflect.Message {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[18]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
var _fastReflection_RedelegationResponse_messageType fastReflection_RedelegationResponse_messageType
var _ protoreflect.MessageType = fastReflection_RedelegationResponse_messageType{}
type fastReflection_RedelegationResponse_messageType struct{}
func (x fastReflection_RedelegationResponse_messageType) Zero() protoreflect.Message {
return (*fastReflection_RedelegationResponse)(nil)
}
func (x fastReflection_RedelegationResponse_messageType) New() protoreflect.Message {
return new(fastReflection_RedelegationResponse)
}
func (x fastReflection_RedelegationResponse_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_RedelegationResponse
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_RedelegationResponse) Descriptor() protoreflect.MessageDescriptor {
return md_RedelegationResponse
}
// Type returns the message type, which encapsulates both Go and protobuf
// type information. If the Go type information is not needed,
// it is recommended that the message descriptor be used instead.
func (x *fastReflection_RedelegationResponse) Type() protoreflect.MessageType {
return _fastReflection_RedelegationResponse_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_RedelegationResponse) New() protoreflect.Message {
return new(fastReflection_RedelegationResponse)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_RedelegationResponse) Interface() protoreflect.ProtoMessage {
return (*RedelegationResponse)(x)
}
// Range iterates over every populated field in an undefined order,
// calling f for each field descriptor and value encountered.
// Range returns immediately if f returns false.
// While iterating, mutating operations may only be performed
// on the current field descriptor.
func (x *fastReflection_RedelegationResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
if x.Redelegation != nil {
value := protoreflect.ValueOfMessage(x.Redelegation.ProtoReflect())
if !f(fd_RedelegationResponse_redelegation, value) {
return
}
}
if len(x.Entries) != 0 {
value := protoreflect.ValueOfList(&_RedelegationResponse_2_list{list: &x.Entries})
if !f(fd_RedelegationResponse_entries, value) {
return
}
}
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_RedelegationResponse) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
case "cosmos.staking.v1beta1.RedelegationResponse.redelegation":
return x.Redelegation != nil
case "cosmos.staking.v1beta1.RedelegationResponse.entries":
return len(x.Entries) != 0
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.RedelegationResponse"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.RedelegationResponse does not contain field %s", fd.FullName()))
}
}
// Clear clears the field such that a subsequent Has call reports false.
//
// Clearing an extension field clears both the extension type and value
// associated with the given field number.
//
// Clear is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_RedelegationResponse) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.RedelegationResponse.redelegation":
x.Redelegation = nil
case "cosmos.staking.v1beta1.RedelegationResponse.entries":
x.Entries = nil
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.RedelegationResponse"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.RedelegationResponse does not contain field %s", fd.FullName()))
}
}
// Get retrieves the value for a field.
//
// For unpopulated scalars, it returns the default value, where
// the default value of a bytes scalar is guaranteed to be a copy.
// For unpopulated composite types, it returns an empty, read-only view
// of the value; to obtain a mutable reference, use Mutable.
func (x *fastReflection_RedelegationResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
case "cosmos.staking.v1beta1.RedelegationResponse.redelegation":
value := x.Redelegation
return protoreflect.ValueOfMessage(value.ProtoReflect())
case "cosmos.staking.v1beta1.RedelegationResponse.entries":
if len(x.Entries) == 0 {
return protoreflect.ValueOfList(&_RedelegationResponse_2_list{})
}
listValue := &_RedelegationResponse_2_list{list: &x.Entries}
return protoreflect.ValueOfList(listValue)
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.RedelegationResponse"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.RedelegationResponse does not contain field %s", descriptor.FullName()))
}
}
// Set stores the value for a field.
//
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType.
// When setting a composite type, it is unspecified whether the stored value
// aliases the source's memory in any way. If the composite value is an
// empty, read-only value, then it panics.
//
// Set is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_RedelegationResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.RedelegationResponse.redelegation":
x.Redelegation = value.Message().Interface().(*Redelegation)
case "cosmos.staking.v1beta1.RedelegationResponse.entries":
lv := value.List()
clv := lv.(*_RedelegationResponse_2_list)
x.Entries = *clv.list
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.RedelegationResponse"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.RedelegationResponse does not contain field %s", fd.FullName()))
}
}
// Mutable returns a mutable reference to a composite type.
//
// If the field is unpopulated, it may allocate a composite value.
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType
// if not already stored.
// It panics if the field does not contain a composite type.
//
// Mutable is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_RedelegationResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.RedelegationResponse.redelegation":
if x.Redelegation == nil {
x.Redelegation = new(Redelegation)
}
return protoreflect.ValueOfMessage(x.Redelegation.ProtoReflect())
case "cosmos.staking.v1beta1.RedelegationResponse.entries":
if x.Entries == nil {
x.Entries = []*RedelegationEntryResponse{}
}
value := &_RedelegationResponse_2_list{list: &x.Entries}
return protoreflect.ValueOfList(value)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.RedelegationResponse"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.RedelegationResponse does not contain field %s", fd.FullName()))
}
}
// NewField returns a new value that is assignable to the field
// for the given descriptor. For scalars, this returns the default value.
// For lists, maps, and messages, this returns a new, empty, mutable value.
func (x *fastReflection_RedelegationResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.RedelegationResponse.redelegation":
m := new(Redelegation)
return protoreflect.ValueOfMessage(m.ProtoReflect())
case "cosmos.staking.v1beta1.RedelegationResponse.entries":
list := []*RedelegationEntryResponse{}
return protoreflect.ValueOfList(&_RedelegationResponse_2_list{list: &list})
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.RedelegationResponse"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.RedelegationResponse does not contain field %s", fd.FullName()))
}
}
// WhichOneof reports which field within the oneof is populated,
// returning nil if none are populated.
// It panics if the oneof descriptor does not belong to this message.
func (x *fastReflection_RedelegationResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in cosmos.staking.v1beta1.RedelegationResponse", d.FullName()))
}
panic("unreachable")
}
// GetUnknown retrieves the entire list of unknown fields.
// The caller may only mutate the contents of the RawFields
// if the mutated bytes are stored back into the message with SetUnknown.
func (x *fastReflection_RedelegationResponse) GetUnknown() protoreflect.RawFields {
return x.unknownFields
}
// SetUnknown stores an entire list of unknown fields.
// The raw fields must be syntactically valid according to the wire format.
// An implementation may panic if this is not the case.
// Once stored, the caller must not mutate the content of the RawFields.
// An empty RawFields may be passed to clear the fields.
//
// SetUnknown is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_RedelegationResponse) SetUnknown(fields protoreflect.RawFields) {
x.unknownFields = fields
}
// IsValid reports whether the message is valid.
//
// An invalid message is an empty, read-only value.
//
// An invalid message often corresponds to a nil pointer of the concrete
// message type, but the details are implementation dependent.
// Validity is not part of the protobuf data model, and may not
// be preserved in marshaling or other operations.
func (x *fastReflection_RedelegationResponse) IsValid() bool {
return x != nil
}
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
// This method may return nil.
//
// The returned methods type is identical to
// "google.golang.org/protobuf/runtime/protoiface".Methods.
// Consult the protoiface package documentation for details.
func (x *fastReflection_RedelegationResponse) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*RedelegationResponse)
if x == nil {
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: 0,
}
}
options := runtime.SizeInputToOptions(input)
_ = options
var n int
var l int
_ = l
if x.Redelegation != nil {
l = options.Size(x.Redelegation)
n += 1 + l + runtime.Sov(uint64(l))
}
if len(x.Entries) > 0 {
for _, e := range x.Entries {
l = options.Size(e)
n += 1 + l + runtime.Sov(uint64(l))
}
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: n,
}
}
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
x := input.Message.Interface().(*RedelegationResponse)
if x == nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
options := runtime.MarshalInputToOptions(input)
_ = options
size := options.Size(x)
dAtA := make([]byte, size)
i := len(dAtA)
_ = i
var l int
_ = l
if x.unknownFields != nil {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if len(x.Entries) > 0 {
for iNdEx := len(x.Entries) - 1; iNdEx >= 0; iNdEx-- {
encoded, err := options.Marshal(x.Entries[iNdEx])
if err != nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, err
}
i -= len(encoded)
copy(dAtA[i:], encoded)
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
i--
dAtA[i] = 0x12
}
}
if x.Redelegation != nil {
encoded, err := options.Marshal(x.Redelegation)
if err != nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, err
}
i -= len(encoded)
copy(dAtA[i:], encoded)
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
i--
dAtA[i] = 0xa
}
if input.Buf != nil {
input.Buf = append(input.Buf, dAtA...)
} else {
input.Buf = dAtA
}
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
x := input.Message.Interface().(*RedelegationResponse)
if x == nil {
return protoiface.UnmarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Flags: input.Flags,
}, nil
}
options := runtime.UnmarshalInputToOptions(input)
_ = options
dAtA := input.Buf
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: RedelegationResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: RedelegationResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Redelegation", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if x.Redelegation == nil {
x.Redelegation = &Redelegation{}
}
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Redelegation); err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.Entries = append(x.Entries, &RedelegationEntryResponse{})
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Entries[len(x.Entries)-1]); err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
var (
md_Pool protoreflect.MessageDescriptor
fd_Pool_not_bonded_tokens protoreflect.FieldDescriptor
fd_Pool_bonded_tokens protoreflect.FieldDescriptor
)
func init() {
file_cosmos_staking_v1beta1_staking_proto_init()
md_Pool = File_cosmos_staking_v1beta1_staking_proto.Messages().ByName("Pool")
fd_Pool_not_bonded_tokens = md_Pool.Fields().ByName("not_bonded_tokens")
fd_Pool_bonded_tokens = md_Pool.Fields().ByName("bonded_tokens")
}
var _ protoreflect.Message = (*fastReflection_Pool)(nil)
type fastReflection_Pool Pool
func (x *Pool) ProtoReflect() protoreflect.Message {
return (*fastReflection_Pool)(x)
}
func (x *Pool) slowProtoReflect() protoreflect.Message {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[19]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
var _fastReflection_Pool_messageType fastReflection_Pool_messageType
var _ protoreflect.MessageType = fastReflection_Pool_messageType{}
type fastReflection_Pool_messageType struct{}
func (x fastReflection_Pool_messageType) Zero() protoreflect.Message {
return (*fastReflection_Pool)(nil)
}
func (x fastReflection_Pool_messageType) New() protoreflect.Message {
return new(fastReflection_Pool)
}
func (x fastReflection_Pool_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_Pool
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_Pool) Descriptor() protoreflect.MessageDescriptor {
return md_Pool
}
// Type returns the message type, which encapsulates both Go and protobuf
// type information. If the Go type information is not needed,
// it is recommended that the message descriptor be used instead.
func (x *fastReflection_Pool) Type() protoreflect.MessageType {
return _fastReflection_Pool_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_Pool) New() protoreflect.Message {
return new(fastReflection_Pool)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_Pool) Interface() protoreflect.ProtoMessage {
return (*Pool)(x)
}
// Range iterates over every populated field in an undefined order,
// calling f for each field descriptor and value encountered.
// Range returns immediately if f returns false.
// While iterating, mutating operations may only be performed
// on the current field descriptor.
func (x *fastReflection_Pool) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
if x.NotBondedTokens != "" {
value := protoreflect.ValueOfString(x.NotBondedTokens)
if !f(fd_Pool_not_bonded_tokens, value) {
return
}
}
if x.BondedTokens != "" {
value := protoreflect.ValueOfString(x.BondedTokens)
if !f(fd_Pool_bonded_tokens, value) {
return
}
}
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_Pool) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Pool.not_bonded_tokens":
return x.NotBondedTokens != ""
case "cosmos.staking.v1beta1.Pool.bonded_tokens":
return x.BondedTokens != ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Pool"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Pool does not contain field %s", fd.FullName()))
}
}
// Clear clears the field such that a subsequent Has call reports false.
//
// Clearing an extension field clears both the extension type and value
// associated with the given field number.
//
// Clear is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Pool) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Pool.not_bonded_tokens":
x.NotBondedTokens = ""
case "cosmos.staking.v1beta1.Pool.bonded_tokens":
x.BondedTokens = ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Pool"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Pool does not contain field %s", fd.FullName()))
}
}
// Get retrieves the value for a field.
//
// For unpopulated scalars, it returns the default value, where
// the default value of a bytes scalar is guaranteed to be a copy.
// For unpopulated composite types, it returns an empty, read-only view
// of the value; to obtain a mutable reference, use Mutable.
func (x *fastReflection_Pool) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
case "cosmos.staking.v1beta1.Pool.not_bonded_tokens":
value := x.NotBondedTokens
return protoreflect.ValueOfString(value)
case "cosmos.staking.v1beta1.Pool.bonded_tokens":
value := x.BondedTokens
return protoreflect.ValueOfString(value)
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Pool"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Pool does not contain field %s", descriptor.FullName()))
}
}
// Set stores the value for a field.
//
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType.
// When setting a composite type, it is unspecified whether the stored value
// aliases the source's memory in any way. If the composite value is an
// empty, read-only value, then it panics.
//
// Set is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Pool) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Pool.not_bonded_tokens":
x.NotBondedTokens = value.Interface().(string)
case "cosmos.staking.v1beta1.Pool.bonded_tokens":
x.BondedTokens = value.Interface().(string)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Pool"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Pool does not contain field %s", fd.FullName()))
}
}
// Mutable returns a mutable reference to a composite type.
//
// If the field is unpopulated, it may allocate a composite value.
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType
// if not already stored.
// It panics if the field does not contain a composite type.
//
// Mutable is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Pool) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Pool.not_bonded_tokens":
panic(fmt.Errorf("field not_bonded_tokens of message cosmos.staking.v1beta1.Pool is not mutable"))
case "cosmos.staking.v1beta1.Pool.bonded_tokens":
panic(fmt.Errorf("field bonded_tokens of message cosmos.staking.v1beta1.Pool is not mutable"))
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Pool"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Pool does not contain field %s", fd.FullName()))
}
}
// NewField returns a new value that is assignable to the field
// for the given descriptor. For scalars, this returns the default value.
// For lists, maps, and messages, this returns a new, empty, mutable value.
func (x *fastReflection_Pool) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.Pool.not_bonded_tokens":
return protoreflect.ValueOfString("")
case "cosmos.staking.v1beta1.Pool.bonded_tokens":
return protoreflect.ValueOfString("")
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.Pool"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.Pool does not contain field %s", fd.FullName()))
}
}
// WhichOneof reports which field within the oneof is populated,
// returning nil if none are populated.
// It panics if the oneof descriptor does not belong to this message.
func (x *fastReflection_Pool) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in cosmos.staking.v1beta1.Pool", d.FullName()))
}
panic("unreachable")
}
// GetUnknown retrieves the entire list of unknown fields.
// The caller may only mutate the contents of the RawFields
// if the mutated bytes are stored back into the message with SetUnknown.
func (x *fastReflection_Pool) GetUnknown() protoreflect.RawFields {
return x.unknownFields
}
// SetUnknown stores an entire list of unknown fields.
// The raw fields must be syntactically valid according to the wire format.
// An implementation may panic if this is not the case.
// Once stored, the caller must not mutate the content of the RawFields.
// An empty RawFields may be passed to clear the fields.
//
// SetUnknown is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Pool) SetUnknown(fields protoreflect.RawFields) {
x.unknownFields = fields
}
// IsValid reports whether the message is valid.
//
// An invalid message is an empty, read-only value.
//
// An invalid message often corresponds to a nil pointer of the concrete
// message type, but the details are implementation dependent.
// Validity is not part of the protobuf data model, and may not
// be preserved in marshaling or other operations.
func (x *fastReflection_Pool) IsValid() bool {
return x != nil
}
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
// This method may return nil.
//
// The returned methods type is identical to
// "google.golang.org/protobuf/runtime/protoiface".Methods.
// Consult the protoiface package documentation for details.
func (x *fastReflection_Pool) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*Pool)
if x == nil {
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: 0,
}
}
options := runtime.SizeInputToOptions(input)
_ = options
var n int
var l int
_ = l
l = len(x.NotBondedTokens)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.BondedTokens)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: n,
}
}
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
x := input.Message.Interface().(*Pool)
if x == nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
options := runtime.MarshalInputToOptions(input)
_ = options
size := options.Size(x)
dAtA := make([]byte, size)
i := len(dAtA)
_ = i
var l int
_ = l
if x.unknownFields != nil {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if len(x.BondedTokens) > 0 {
i -= len(x.BondedTokens)
copy(dAtA[i:], x.BondedTokens)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BondedTokens)))
i--
dAtA[i] = 0x12
}
if len(x.NotBondedTokens) > 0 {
i -= len(x.NotBondedTokens)
copy(dAtA[i:], x.NotBondedTokens)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.NotBondedTokens)))
i--
dAtA[i] = 0xa
}
if input.Buf != nil {
input.Buf = append(input.Buf, dAtA...)
} else {
input.Buf = dAtA
}
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
x := input.Message.Interface().(*Pool)
if x == nil {
return protoiface.UnmarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Flags: input.Flags,
}, nil
}
options := runtime.UnmarshalInputToOptions(input)
_ = options
dAtA := input.Buf
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Pool: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Pool: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NotBondedTokens", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.NotBondedTokens = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BondedTokens", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.BondedTokens = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
var (
md_TokenizeShareRecord protoreflect.MessageDescriptor
fd_TokenizeShareRecord_id protoreflect.FieldDescriptor
fd_TokenizeShareRecord_owner protoreflect.FieldDescriptor
fd_TokenizeShareRecord_share_token_denom protoreflect.FieldDescriptor
fd_TokenizeShareRecord_module_account protoreflect.FieldDescriptor
fd_TokenizeShareRecord_validator protoreflect.FieldDescriptor
)
func init() {
file_cosmos_staking_v1beta1_staking_proto_init()
md_TokenizeShareRecord = File_cosmos_staking_v1beta1_staking_proto.Messages().ByName("TokenizeShareRecord")
fd_TokenizeShareRecord_id = md_TokenizeShareRecord.Fields().ByName("id")
fd_TokenizeShareRecord_owner = md_TokenizeShareRecord.Fields().ByName("owner")
fd_TokenizeShareRecord_share_token_denom = md_TokenizeShareRecord.Fields().ByName("share_token_denom")
fd_TokenizeShareRecord_module_account = md_TokenizeShareRecord.Fields().ByName("module_account")
fd_TokenizeShareRecord_validator = md_TokenizeShareRecord.Fields().ByName("validator")
}
var _ protoreflect.Message = (*fastReflection_TokenizeShareRecord)(nil)
type fastReflection_TokenizeShareRecord TokenizeShareRecord
func (x *TokenizeShareRecord) ProtoReflect() protoreflect.Message {
return (*fastReflection_TokenizeShareRecord)(x)
}
func (x *TokenizeShareRecord) slowProtoReflect() protoreflect.Message {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[20]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
var _fastReflection_TokenizeShareRecord_messageType fastReflection_TokenizeShareRecord_messageType
var _ protoreflect.MessageType = fastReflection_TokenizeShareRecord_messageType{}
type fastReflection_TokenizeShareRecord_messageType struct{}
func (x fastReflection_TokenizeShareRecord_messageType) Zero() protoreflect.Message {
return (*fastReflection_TokenizeShareRecord)(nil)
}
func (x fastReflection_TokenizeShareRecord_messageType) New() protoreflect.Message {
return new(fastReflection_TokenizeShareRecord)
}
func (x fastReflection_TokenizeShareRecord_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_TokenizeShareRecord
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_TokenizeShareRecord) Descriptor() protoreflect.MessageDescriptor {
return md_TokenizeShareRecord
}
// Type returns the message type, which encapsulates both Go and protobuf
// type information. If the Go type information is not needed,
// it is recommended that the message descriptor be used instead.
func (x *fastReflection_TokenizeShareRecord) Type() protoreflect.MessageType {
return _fastReflection_TokenizeShareRecord_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_TokenizeShareRecord) New() protoreflect.Message {
return new(fastReflection_TokenizeShareRecord)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_TokenizeShareRecord) Interface() protoreflect.ProtoMessage {
return (*TokenizeShareRecord)(x)
}
// Range iterates over every populated field in an undefined order,
// calling f for each field descriptor and value encountered.
// Range returns immediately if f returns false.
// While iterating, mutating operations may only be performed
// on the current field descriptor.
func (x *fastReflection_TokenizeShareRecord) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
if x.Id != uint64(0) {
value := protoreflect.ValueOfUint64(x.Id)
if !f(fd_TokenizeShareRecord_id, value) {
return
}
}
if x.Owner != "" {
value := protoreflect.ValueOfString(x.Owner)
if !f(fd_TokenizeShareRecord_owner, value) {
return
}
}
if x.ShareTokenDenom != "" {
value := protoreflect.ValueOfString(x.ShareTokenDenom)
if !f(fd_TokenizeShareRecord_share_token_denom, value) {
return
}
}
if x.ModuleAccount != "" {
value := protoreflect.ValueOfString(x.ModuleAccount)
if !f(fd_TokenizeShareRecord_module_account, value) {
return
}
}
if x.Validator != "" {
value := protoreflect.ValueOfString(x.Validator)
if !f(fd_TokenizeShareRecord_validator, value) {
return
}
}
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_TokenizeShareRecord) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
case "cosmos.staking.v1beta1.TokenizeShareRecord.id":
return x.Id != uint64(0)
case "cosmos.staking.v1beta1.TokenizeShareRecord.owner":
return x.Owner != ""
case "cosmos.staking.v1beta1.TokenizeShareRecord.share_token_denom":
return x.ShareTokenDenom != ""
case "cosmos.staking.v1beta1.TokenizeShareRecord.module_account":
return x.ModuleAccount != ""
case "cosmos.staking.v1beta1.TokenizeShareRecord.validator":
return x.Validator != ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.TokenizeShareRecord"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.TokenizeShareRecord does not contain field %s", fd.FullName()))
}
}
// Clear clears the field such that a subsequent Has call reports false.
//
// Clearing an extension field clears both the extension type and value
// associated with the given field number.
//
// Clear is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_TokenizeShareRecord) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.TokenizeShareRecord.id":
x.Id = uint64(0)
case "cosmos.staking.v1beta1.TokenizeShareRecord.owner":
x.Owner = ""
case "cosmos.staking.v1beta1.TokenizeShareRecord.share_token_denom":
x.ShareTokenDenom = ""
case "cosmos.staking.v1beta1.TokenizeShareRecord.module_account":
x.ModuleAccount = ""
case "cosmos.staking.v1beta1.TokenizeShareRecord.validator":
x.Validator = ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.TokenizeShareRecord"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.TokenizeShareRecord does not contain field %s", fd.FullName()))
}
}
// Get retrieves the value for a field.
//
// For unpopulated scalars, it returns the default value, where
// the default value of a bytes scalar is guaranteed to be a copy.
// For unpopulated composite types, it returns an empty, read-only view
// of the value; to obtain a mutable reference, use Mutable.
func (x *fastReflection_TokenizeShareRecord) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
case "cosmos.staking.v1beta1.TokenizeShareRecord.id":
value := x.Id
return protoreflect.ValueOfUint64(value)
case "cosmos.staking.v1beta1.TokenizeShareRecord.owner":
value := x.Owner
return protoreflect.ValueOfString(value)
case "cosmos.staking.v1beta1.TokenizeShareRecord.share_token_denom":
value := x.ShareTokenDenom
return protoreflect.ValueOfString(value)
case "cosmos.staking.v1beta1.TokenizeShareRecord.module_account":
value := x.ModuleAccount
return protoreflect.ValueOfString(value)
case "cosmos.staking.v1beta1.TokenizeShareRecord.validator":
value := x.Validator
return protoreflect.ValueOfString(value)
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.TokenizeShareRecord"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.TokenizeShareRecord does not contain field %s", descriptor.FullName()))
}
}
// Set stores the value for a field.
//
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType.
// When setting a composite type, it is unspecified whether the stored value
// aliases the source's memory in any way. If the composite value is an
// empty, read-only value, then it panics.
//
// Set is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_TokenizeShareRecord) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
case "cosmos.staking.v1beta1.TokenizeShareRecord.id":
x.Id = value.Uint()
case "cosmos.staking.v1beta1.TokenizeShareRecord.owner":
x.Owner = value.Interface().(string)
case "cosmos.staking.v1beta1.TokenizeShareRecord.share_token_denom":
x.ShareTokenDenom = value.Interface().(string)
case "cosmos.staking.v1beta1.TokenizeShareRecord.module_account":
x.ModuleAccount = value.Interface().(string)
case "cosmos.staking.v1beta1.TokenizeShareRecord.validator":
x.Validator = value.Interface().(string)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.TokenizeShareRecord"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.TokenizeShareRecord does not contain field %s", fd.FullName()))
}
}
// Mutable returns a mutable reference to a composite type.
//
// If the field is unpopulated, it may allocate a composite value.
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType
// if not already stored.
// It panics if the field does not contain a composite type.
//
// Mutable is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_TokenizeShareRecord) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.TokenizeShareRecord.id":
panic(fmt.Errorf("field id of message cosmos.staking.v1beta1.TokenizeShareRecord is not mutable"))
case "cosmos.staking.v1beta1.TokenizeShareRecord.owner":
panic(fmt.Errorf("field owner of message cosmos.staking.v1beta1.TokenizeShareRecord is not mutable"))
case "cosmos.staking.v1beta1.TokenizeShareRecord.share_token_denom":
panic(fmt.Errorf("field share_token_denom of message cosmos.staking.v1beta1.TokenizeShareRecord is not mutable"))
case "cosmos.staking.v1beta1.TokenizeShareRecord.module_account":
panic(fmt.Errorf("field module_account of message cosmos.staking.v1beta1.TokenizeShareRecord is not mutable"))
case "cosmos.staking.v1beta1.TokenizeShareRecord.validator":
panic(fmt.Errorf("field validator of message cosmos.staking.v1beta1.TokenizeShareRecord is not mutable"))
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.TokenizeShareRecord"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.TokenizeShareRecord does not contain field %s", fd.FullName()))
}
}
// NewField returns a new value that is assignable to the field
// for the given descriptor. For scalars, this returns the default value.
// For lists, maps, and messages, this returns a new, empty, mutable value.
func (x *fastReflection_TokenizeShareRecord) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.staking.v1beta1.TokenizeShareRecord.id":
return protoreflect.ValueOfUint64(uint64(0))
case "cosmos.staking.v1beta1.TokenizeShareRecord.owner":
return protoreflect.ValueOfString("")
case "cosmos.staking.v1beta1.TokenizeShareRecord.share_token_denom":
return protoreflect.ValueOfString("")
case "cosmos.staking.v1beta1.TokenizeShareRecord.module_account":
return protoreflect.ValueOfString("")
case "cosmos.staking.v1beta1.TokenizeShareRecord.validator":
return protoreflect.ValueOfString("")
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.v1beta1.TokenizeShareRecord"))
}
panic(fmt.Errorf("message cosmos.staking.v1beta1.TokenizeShareRecord does not contain field %s", fd.FullName()))
}
}
// WhichOneof reports which field within the oneof is populated,
// returning nil if none are populated.
// It panics if the oneof descriptor does not belong to this message.
func (x *fastReflection_TokenizeShareRecord) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in cosmos.staking.v1beta1.TokenizeShareRecord", d.FullName()))
}
panic("unreachable")
}
// GetUnknown retrieves the entire list of unknown fields.
// The caller may only mutate the contents of the RawFields
// if the mutated bytes are stored back into the message with SetUnknown.
func (x *fastReflection_TokenizeShareRecord) GetUnknown() protoreflect.RawFields {
return x.unknownFields
}
// SetUnknown stores an entire list of unknown fields.
// The raw fields must be syntactically valid according to the wire format.
// An implementation may panic if this is not the case.
// Once stored, the caller must not mutate the content of the RawFields.
// An empty RawFields may be passed to clear the fields.
//
// SetUnknown is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_TokenizeShareRecord) SetUnknown(fields protoreflect.RawFields) {
x.unknownFields = fields
}
// IsValid reports whether the message is valid.
//
// An invalid message is an empty, read-only value.
//
// An invalid message often corresponds to a nil pointer of the concrete
// message type, but the details are implementation dependent.
// Validity is not part of the protobuf data model, and may not
// be preserved in marshaling or other operations.
func (x *fastReflection_TokenizeShareRecord) IsValid() bool {
return x != nil
}
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
// This method may return nil.
//
// The returned methods type is identical to
// "google.golang.org/protobuf/runtime/protoiface".Methods.
// Consult the protoiface package documentation for details.
func (x *fastReflection_TokenizeShareRecord) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*TokenizeShareRecord)
if x == nil {
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: 0,
}
}
options := runtime.SizeInputToOptions(input)
_ = options
var n int
var l int
_ = l
if x.Id != 0 {
n += 1 + runtime.Sov(uint64(x.Id))
}
l = len(x.Owner)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.ShareTokenDenom)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.ModuleAccount)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
l = len(x.Validator)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: n,
}
}
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
x := input.Message.Interface().(*TokenizeShareRecord)
if x == nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
options := runtime.MarshalInputToOptions(input)
_ = options
size := options.Size(x)
dAtA := make([]byte, size)
i := len(dAtA)
_ = i
var l int
_ = l
if x.unknownFields != nil {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if len(x.Validator) > 0 {
i -= len(x.Validator)
copy(dAtA[i:], x.Validator)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Validator)))
i--
dAtA[i] = 0x2a
}
if len(x.ModuleAccount) > 0 {
i -= len(x.ModuleAccount)
copy(dAtA[i:], x.ModuleAccount)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ModuleAccount)))
i--
dAtA[i] = 0x22
}
if len(x.ShareTokenDenom) > 0 {
i -= len(x.ShareTokenDenom)
copy(dAtA[i:], x.ShareTokenDenom)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ShareTokenDenom)))
i--
dAtA[i] = 0x1a
}
if len(x.Owner) > 0 {
i -= len(x.Owner)
copy(dAtA[i:], x.Owner)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Owner)))
i--
dAtA[i] = 0x12
}
if x.Id != 0 {
i = runtime.EncodeVarint(dAtA, i, uint64(x.Id))
i--
dAtA[i] = 0x8
}
if input.Buf != nil {
input.Buf = append(input.Buf, dAtA...)
} else {
input.Buf = dAtA
}
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
x := input.Message.Interface().(*TokenizeShareRecord)
if x == nil {
return protoiface.UnmarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Flags: input.Flags,
}, nil
}
options := runtime.UnmarshalInputToOptions(input)
_ = options
dAtA := input.Buf
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: TokenizeShareRecord: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: TokenizeShareRecord: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
}
x.Id = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
x.Id |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.Owner = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ShareTokenDenom", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.ShareTokenDenom = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 4:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ModuleAccount", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.ModuleAccount = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 5:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.Validator = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.0
// protoc (unknown)
// source: cosmos/staking/v1beta1/staking.proto
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// BondStatus is the status of a validator.
type BondStatus int32
const (
// UNSPECIFIED defines an invalid validator status.
BondStatus_BOND_STATUS_UNSPECIFIED BondStatus = 0
// UNBONDED defines a validator that is not bonded.
BondStatus_BOND_STATUS_UNBONDED BondStatus = 1
// UNBONDING defines a validator that is unbonding.
BondStatus_BOND_STATUS_UNBONDING BondStatus = 2
// BONDED defines a validator that is bonded.
BondStatus_BOND_STATUS_BONDED BondStatus = 3
)
// Enum value maps for BondStatus.
var (
BondStatus_name = map[int32]string{
0: "BOND_STATUS_UNSPECIFIED",
1: "BOND_STATUS_UNBONDED",
2: "BOND_STATUS_UNBONDING",
3: "BOND_STATUS_BONDED",
}
BondStatus_value = map[string]int32{
"BOND_STATUS_UNSPECIFIED": 0,
"BOND_STATUS_UNBONDED": 1,
"BOND_STATUS_UNBONDING": 2,
"BOND_STATUS_BONDED": 3,
}
)
func (x BondStatus) Enum() *BondStatus {
p := new(BondStatus)
*p = x
return p
}
func (x BondStatus) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (BondStatus) Descriptor() protoreflect.EnumDescriptor {
return file_cosmos_staking_v1beta1_staking_proto_enumTypes[0].Descriptor()
}
func (BondStatus) Type() protoreflect.EnumType {
return &file_cosmos_staking_v1beta1_staking_proto_enumTypes[0]
}
func (x BondStatus) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use BondStatus.Descriptor instead.
func (BondStatus) EnumDescriptor() ([]byte, []int) {
return file_cosmos_staking_v1beta1_staking_proto_rawDescGZIP(), []int{0}
}
// HistoricalInfo contains header and validator information for a given block.
// It is stored as part of staking module's state, which persists the `n` most
// recent HistoricalInfo
// (`n` is set by the staking module's `historical_entries` parameter).
type HistoricalInfo struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Header *types.Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
Valset []*Validator `protobuf:"bytes,2,rep,name=valset,proto3" json:"valset,omitempty"`
}
func (x *HistoricalInfo) Reset() {
*x = HistoricalInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *HistoricalInfo) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*HistoricalInfo) ProtoMessage() {}
// Deprecated: Use HistoricalInfo.ProtoReflect.Descriptor instead.
func (*HistoricalInfo) Descriptor() ([]byte, []int) {
return file_cosmos_staking_v1beta1_staking_proto_rawDescGZIP(), []int{0}
}
func (x *HistoricalInfo) GetHeader() *types.Header {
if x != nil {
return x.Header
}
return nil
}
func (x *HistoricalInfo) GetValset() []*Validator {
if x != nil {
return x.Valset
}
return nil
}
// CommissionRates defines the initial commission rates to be used for creating
// a validator.
type CommissionRates struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// rate is the commission rate charged to delegators, as a fraction.
Rate string `protobuf:"bytes,1,opt,name=rate,proto3" json:"rate,omitempty"`
// max_rate defines the maximum commission rate which validator can ever charge, as a fraction.
MaxRate string `protobuf:"bytes,2,opt,name=max_rate,json=maxRate,proto3" json:"max_rate,omitempty"`
// max_change_rate defines the maximum daily increase of the validator commission, as a fraction.
MaxChangeRate string `protobuf:"bytes,3,opt,name=max_change_rate,json=maxChangeRate,proto3" json:"max_change_rate,omitempty"`
}
func (x *CommissionRates) Reset() {
*x = CommissionRates{}
if protoimpl.UnsafeEnabled {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CommissionRates) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CommissionRates) ProtoMessage() {}
// Deprecated: Use CommissionRates.ProtoReflect.Descriptor instead.
func (*CommissionRates) Descriptor() ([]byte, []int) {
return file_cosmos_staking_v1beta1_staking_proto_rawDescGZIP(), []int{1}
}
func (x *CommissionRates) GetRate() string {
if x != nil {
return x.Rate
}
return ""
}
func (x *CommissionRates) GetMaxRate() string {
if x != nil {
return x.MaxRate
}
return ""
}
func (x *CommissionRates) GetMaxChangeRate() string {
if x != nil {
return x.MaxChangeRate
}
return ""
}
// Commission defines commission parameters for a given validator.
type Commission struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// commission_rates defines the initial commission rates to be used for creating a validator.
CommissionRates *CommissionRates `protobuf:"bytes,1,opt,name=commission_rates,json=commissionRates,proto3" json:"commission_rates,omitempty"`
// update_time is the last time the commission rate was changed.
UpdateTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
}
func (x *Commission) Reset() {
*x = Commission{}
if protoimpl.UnsafeEnabled {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Commission) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Commission) ProtoMessage() {}
// Deprecated: Use Commission.ProtoReflect.Descriptor instead.
func (*Commission) Descriptor() ([]byte, []int) {
return file_cosmos_staking_v1beta1_staking_proto_rawDescGZIP(), []int{2}
}
func (x *Commission) GetCommissionRates() *CommissionRates {
if x != nil {
return x.CommissionRates
}
return nil
}
func (x *Commission) GetUpdateTime() *timestamppb.Timestamp {
if x != nil {
return x.UpdateTime
}
return nil
}
// Description defines a validator description.
type Description struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// moniker defines a human-readable name for the validator.
Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"`
// identity defines an optional identity signature (ex. UPort or Keybase).
Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"`
// website defines an optional website link.
Website string `protobuf:"bytes,3,opt,name=website,proto3" json:"website,omitempty"`
// security_contact defines an optional email for security contact.
SecurityContact string `protobuf:"bytes,4,opt,name=security_contact,json=securityContact,proto3" json:"security_contact,omitempty"`
// details define other optional details.
Details string `protobuf:"bytes,5,opt,name=details,proto3" json:"details,omitempty"`
}
func (x *Description) Reset() {
*x = Description{}
if protoimpl.UnsafeEnabled {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Description) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Description) ProtoMessage() {}
// Deprecated: Use Description.ProtoReflect.Descriptor instead.
func (*Description) Descriptor() ([]byte, []int) {
return file_cosmos_staking_v1beta1_staking_proto_rawDescGZIP(), []int{3}
}
func (x *Description) GetMoniker() string {
if x != nil {
return x.Moniker
}
return ""
}
func (x *Description) GetIdentity() string {
if x != nil {
return x.Identity
}
return ""
}
func (x *Description) GetWebsite() string {
if x != nil {
return x.Website
}
return ""
}
func (x *Description) GetSecurityContact() string {
if x != nil {
return x.SecurityContact
}
return ""
}
func (x *Description) GetDetails() string {
if x != nil {
return x.Details
}
return ""
}
// Validator defines a validator, together with the total amount of the
// Validator's bond shares and their exchange rate to coins. Slashing results in
// a decrease in the exchange rate, allowing correct calculation of future
// undelegations without iterating over delegators. When coins are delegated to
// this validator, the validator is credited with a delegation whose number of
// bond shares is based on the amount of coins delegated divided by the current
// exchange rate. Voting power can be calculated as total bonded shares
// multiplied by exchange rate.
type Validator struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// operator_address defines the address of the validator's operator; bech encoded in JSON.
OperatorAddress string `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"`
// consensus_pubkey is the consensus public key of the validator, as a Protobuf Any.
ConsensusPubkey *anypb.Any `protobuf:"bytes,2,opt,name=consensus_pubkey,json=consensusPubkey,proto3" json:"consensus_pubkey,omitempty"`
// jailed defined whether the validator has been jailed from bonded status or not.
Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"`
// status is the validator status (bonded/unbonding/unbonded).
Status BondStatus `protobuf:"varint,4,opt,name=status,proto3,enum=cosmos.staking.v1beta1.BondStatus" json:"status,omitempty"`
// tokens define the delegated tokens (incl. self-delegation).
Tokens string `protobuf:"bytes,5,opt,name=tokens,proto3" json:"tokens,omitempty"`
// delegator_shares defines total shares issued to a validator's delegators.
DelegatorShares string `protobuf:"bytes,6,opt,name=delegator_shares,json=delegatorShares,proto3" json:"delegator_shares,omitempty"`
// description defines the description terms for the validator.
Description *Description `protobuf:"bytes,7,opt,name=description,proto3" json:"description,omitempty"`
// unbonding_height defines, if unbonding, the height at which this validator has begun unbonding.
UnbondingHeight int64 `protobuf:"varint,8,opt,name=unbonding_height,json=unbondingHeight,proto3" json:"unbonding_height,omitempty"`
// unbonding_time defines, if unbonding, the min time for the validator to complete unbonding.
UnbondingTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=unbonding_time,json=unbondingTime,proto3" json:"unbonding_time,omitempty"`
// commission defines the commission parameters.
Commission *Commission `protobuf:"bytes,10,opt,name=commission,proto3" json:"commission,omitempty"`
// min_self_delegation is the validator's self declared minimum self delegation.
MinSelfDelegation string `protobuf:"bytes,11,opt,name=min_self_delegation,json=minSelfDelegation,proto3" json:"min_self_delegation,omitempty"`
}
func (x *Validator) Reset() {
*x = Validator{}
if protoimpl.UnsafeEnabled {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Validator) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Validator) ProtoMessage() {}
// Deprecated: Use Validator.ProtoReflect.Descriptor instead.
func (*Validator) Descriptor() ([]byte, []int) {
return file_cosmos_staking_v1beta1_staking_proto_rawDescGZIP(), []int{4}
}
func (x *Validator) GetOperatorAddress() string {
if x != nil {
return x.OperatorAddress
}
return ""
}
func (x *Validator) GetConsensusPubkey() *anypb.Any {
if x != nil {
return x.ConsensusPubkey
}
return nil
}
func (x *Validator) GetJailed() bool {
if x != nil {
return x.Jailed
}
return false
}
func (x *Validator) GetStatus() BondStatus {
if x != nil {
return x.Status
}
return BondStatus_BOND_STATUS_UNSPECIFIED
}
func (x *Validator) GetTokens() string {
if x != nil {
return x.Tokens
}
return ""
}
func (x *Validator) GetDelegatorShares() string {
if x != nil {
return x.DelegatorShares
}
return ""
}
func (x *Validator) GetDescription() *Description {
if x != nil {
return x.Description
}
return nil
}
func (x *Validator) GetUnbondingHeight() int64 {
if x != nil {
return x.UnbondingHeight
}
return 0
}
func (x *Validator) GetUnbondingTime() *timestamppb.Timestamp {
if x != nil {
return x.UnbondingTime
}
return nil
}
func (x *Validator) GetCommission() *Commission {
if x != nil {
return x.Commission
}
return nil
}
func (x *Validator) GetMinSelfDelegation() string {
if x != nil {
return x.MinSelfDelegation
}
return ""
}
// ValAddresses defines a repeated set of validator addresses.
type ValAddresses struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Addresses []string `protobuf:"bytes,1,rep,name=addresses,proto3" json:"addresses,omitempty"`
}
func (x *ValAddresses) Reset() {
*x = ValAddresses{}
if protoimpl.UnsafeEnabled {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ValAddresses) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ValAddresses) ProtoMessage() {}
// Deprecated: Use ValAddresses.ProtoReflect.Descriptor instead.
func (*ValAddresses) Descriptor() ([]byte, []int) {
return file_cosmos_staking_v1beta1_staking_proto_rawDescGZIP(), []int{5}
}
func (x *ValAddresses) GetAddresses() []string {
if x != nil {
return x.Addresses
}
return nil
}
// DVPair is struct that just has a delegator-validator pair with no other data.
// It is intended to be used as a marshalable pointer. For example, a DVPair can
// be used to construct the key to getting an UnbondingDelegation from state.
type DVPair struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"`
ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"`
}
func (x *DVPair) Reset() {
*x = DVPair{}
if protoimpl.UnsafeEnabled {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DVPair) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DVPair) ProtoMessage() {}
// Deprecated: Use DVPair.ProtoReflect.Descriptor instead.
func (*DVPair) Descriptor() ([]byte, []int) {
return file_cosmos_staking_v1beta1_staking_proto_rawDescGZIP(), []int{6}
}
func (x *DVPair) GetDelegatorAddress() string {
if x != nil {
return x.DelegatorAddress
}
return ""
}
func (x *DVPair) GetValidatorAddress() string {
if x != nil {
return x.ValidatorAddress
}
return ""
}
// DVPairs defines an array of DVPair objects.
type DVPairs struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Pairs []*DVPair `protobuf:"bytes,1,rep,name=pairs,proto3" json:"pairs,omitempty"`
}
func (x *DVPairs) Reset() {
*x = DVPairs{}
if protoimpl.UnsafeEnabled {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DVPairs) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DVPairs) ProtoMessage() {}
// Deprecated: Use DVPairs.ProtoReflect.Descriptor instead.
func (*DVPairs) Descriptor() ([]byte, []int) {
return file_cosmos_staking_v1beta1_staking_proto_rawDescGZIP(), []int{7}
}
func (x *DVPairs) GetPairs() []*DVPair {
if x != nil {
return x.Pairs
}
return nil
}
// DVVTriplet is struct that just has a delegator-validator-validator triplet
// with no other data. It is intended to be used as a marshalable pointer. For
// example, a DVVTriplet can be used to construct the key to getting a
// Redelegation from state.
type DVVTriplet struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"`
ValidatorSrcAddress string `protobuf:"bytes,2,opt,name=validator_src_address,json=validatorSrcAddress,proto3" json:"validator_src_address,omitempty"`
ValidatorDstAddress string `protobuf:"bytes,3,opt,name=validator_dst_address,json=validatorDstAddress,proto3" json:"validator_dst_address,omitempty"`
}
func (x *DVVTriplet) Reset() {
*x = DVVTriplet{}
if protoimpl.UnsafeEnabled {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DVVTriplet) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DVVTriplet) ProtoMessage() {}
// Deprecated: Use DVVTriplet.ProtoReflect.Descriptor instead.
func (*DVVTriplet) Descriptor() ([]byte, []int) {
return file_cosmos_staking_v1beta1_staking_proto_rawDescGZIP(), []int{8}
}
func (x *DVVTriplet) GetDelegatorAddress() string {
if x != nil {
return x.DelegatorAddress
}
return ""
}
func (x *DVVTriplet) GetValidatorSrcAddress() string {
if x != nil {
return x.ValidatorSrcAddress
}
return ""
}
func (x *DVVTriplet) GetValidatorDstAddress() string {
if x != nil {
return x.ValidatorDstAddress
}
return ""
}
// DVVTriplets defines an array of DVVTriplet objects.
type DVVTriplets struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Triplets []*DVVTriplet `protobuf:"bytes,1,rep,name=triplets,proto3" json:"triplets,omitempty"`
}
func (x *DVVTriplets) Reset() {
*x = DVVTriplets{}
if protoimpl.UnsafeEnabled {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DVVTriplets) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DVVTriplets) ProtoMessage() {}
// Deprecated: Use DVVTriplets.ProtoReflect.Descriptor instead.
func (*DVVTriplets) Descriptor() ([]byte, []int) {
return file_cosmos_staking_v1beta1_staking_proto_rawDescGZIP(), []int{9}
}
func (x *DVVTriplets) GetTriplets() []*DVVTriplet {
if x != nil {
return x.Triplets
}
return nil
}
// Delegation represents the bond with tokens held by an account. It is
// owned by one delegator, and is associated with the voting power of one
// validator.
type Delegation struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// delegator_address is the bech32-encoded address of the delegator.
DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"`
// validator_address is the bech32-encoded address of the validator.
ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"`
// shares define the delegation shares received.
Shares string `protobuf:"bytes,3,opt,name=shares,proto3" json:"shares,omitempty"`
}
func (x *Delegation) Reset() {
*x = Delegation{}
if protoimpl.UnsafeEnabled {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Delegation) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Delegation) ProtoMessage() {}
// Deprecated: Use Delegation.ProtoReflect.Descriptor instead.
func (*Delegation) Descriptor() ([]byte, []int) {
return file_cosmos_staking_v1beta1_staking_proto_rawDescGZIP(), []int{10}
}
func (x *Delegation) GetDelegatorAddress() string {
if x != nil {
return x.DelegatorAddress
}
return ""
}
func (x *Delegation) GetValidatorAddress() string {
if x != nil {
return x.ValidatorAddress
}
return ""
}
func (x *Delegation) GetShares() string {
if x != nil {
return x.Shares
}
return ""
}
// UnbondingDelegation stores all of a single delegator's unbonding bonds
// for a single validator in an time-ordered list.
type UnbondingDelegation struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// delegator_address is the bech32-encoded address of the delegator.
DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"`
// validator_address is the bech32-encoded address of the validator.
ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"`
// entries are the unbonding delegation entries.
Entries []*UnbondingDelegationEntry `protobuf:"bytes,3,rep,name=entries,proto3" json:"entries,omitempty"` // unbonding delegation entries
}
func (x *UnbondingDelegation) Reset() {
*x = UnbondingDelegation{}
if protoimpl.UnsafeEnabled {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UnbondingDelegation) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UnbondingDelegation) ProtoMessage() {}
// Deprecated: Use UnbondingDelegation.ProtoReflect.Descriptor instead.
func (*UnbondingDelegation) Descriptor() ([]byte, []int) {
return file_cosmos_staking_v1beta1_staking_proto_rawDescGZIP(), []int{11}
}
func (x *UnbondingDelegation) GetDelegatorAddress() string {
if x != nil {
return x.DelegatorAddress
}
return ""
}
func (x *UnbondingDelegation) GetValidatorAddress() string {
if x != nil {
return x.ValidatorAddress
}
return ""
}
func (x *UnbondingDelegation) GetEntries() []*UnbondingDelegationEntry {
if x != nil {
return x.Entries
}
return nil
}
// UnbondingDelegationEntry defines an unbonding object with relevant metadata.
type UnbondingDelegationEntry struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// creation_height is the height which the unbonding took place.
CreationHeight int64 `protobuf:"varint,1,opt,name=creation_height,json=creationHeight,proto3" json:"creation_height,omitempty"`
// completion_time is the unix time for unbonding completion.
CompletionTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=completion_time,json=completionTime,proto3" json:"completion_time,omitempty"`
// initial_balance defines the tokens initially scheduled to receive at completion.
InitialBalance string `protobuf:"bytes,3,opt,name=initial_balance,json=initialBalance,proto3" json:"initial_balance,omitempty"`
// balance defines the tokens to receive at completion.
Balance string `protobuf:"bytes,4,opt,name=balance,proto3" json:"balance,omitempty"`
}
func (x *UnbondingDelegationEntry) Reset() {
*x = UnbondingDelegationEntry{}
if protoimpl.UnsafeEnabled {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UnbondingDelegationEntry) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UnbondingDelegationEntry) ProtoMessage() {}
// Deprecated: Use UnbondingDelegationEntry.ProtoReflect.Descriptor instead.
func (*UnbondingDelegationEntry) Descriptor() ([]byte, []int) {
return file_cosmos_staking_v1beta1_staking_proto_rawDescGZIP(), []int{12}
}
func (x *UnbondingDelegationEntry) GetCreationHeight() int64 {
if x != nil {
return x.CreationHeight
}
return 0
}
func (x *UnbondingDelegationEntry) GetCompletionTime() *timestamppb.Timestamp {
if x != nil {
return x.CompletionTime
}
return nil
}
func (x *UnbondingDelegationEntry) GetInitialBalance() string {
if x != nil {
return x.InitialBalance
}
return ""
}
func (x *UnbondingDelegationEntry) GetBalance() string {
if x != nil {
return x.Balance
}
return ""
}
// RedelegationEntry defines a redelegation object with relevant metadata.
type RedelegationEntry struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// creation_height defines the height which the redelegation took place.
CreationHeight int64 `protobuf:"varint,1,opt,name=creation_height,json=creationHeight,proto3" json:"creation_height,omitempty"`
// completion_time defines the unix time for redelegation completion.
CompletionTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=completion_time,json=completionTime,proto3" json:"completion_time,omitempty"`
// initial_balance defines the initial balance when redelegation started.
InitialBalance string `protobuf:"bytes,3,opt,name=initial_balance,json=initialBalance,proto3" json:"initial_balance,omitempty"`
// shares_dst is the amount of destination-validator shares created by redelegation.
SharesDst string `protobuf:"bytes,4,opt,name=shares_dst,json=sharesDst,proto3" json:"shares_dst,omitempty"`
}
func (x *RedelegationEntry) Reset() {
*x = RedelegationEntry{}
if protoimpl.UnsafeEnabled {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RedelegationEntry) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RedelegationEntry) ProtoMessage() {}
// Deprecated: Use RedelegationEntry.ProtoReflect.Descriptor instead.
func (*RedelegationEntry) Descriptor() ([]byte, []int) {
return file_cosmos_staking_v1beta1_staking_proto_rawDescGZIP(), []int{13}
}
func (x *RedelegationEntry) GetCreationHeight() int64 {
if x != nil {
return x.CreationHeight
}
return 0
}
func (x *RedelegationEntry) GetCompletionTime() *timestamppb.Timestamp {
if x != nil {
return x.CompletionTime
}
return nil
}
func (x *RedelegationEntry) GetInitialBalance() string {
if x != nil {
return x.InitialBalance
}
return ""
}
func (x *RedelegationEntry) GetSharesDst() string {
if x != nil {
return x.SharesDst
}
return ""
}
// Redelegation contains the list of a particular delegator's redelegating bonds
// from a particular source validator to a particular destination validator.
type Redelegation struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// delegator_address is the bech32-encoded address of the delegator.
DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"`
// validator_src_address is the validator redelegation source operator address.
ValidatorSrcAddress string `protobuf:"bytes,2,opt,name=validator_src_address,json=validatorSrcAddress,proto3" json:"validator_src_address,omitempty"`
// validator_dst_address is the validator redelegation destination operator address.
ValidatorDstAddress string `protobuf:"bytes,3,opt,name=validator_dst_address,json=validatorDstAddress,proto3" json:"validator_dst_address,omitempty"`
// entries are the redelegation entries.
Entries []*RedelegationEntry `protobuf:"bytes,4,rep,name=entries,proto3" json:"entries,omitempty"` // redelegation entries
}
func (x *Redelegation) Reset() {
*x = Redelegation{}
if protoimpl.UnsafeEnabled {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Redelegation) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Redelegation) ProtoMessage() {}
// Deprecated: Use Redelegation.ProtoReflect.Descriptor instead.
func (*Redelegation) Descriptor() ([]byte, []int) {
return file_cosmos_staking_v1beta1_staking_proto_rawDescGZIP(), []int{14}
}
func (x *Redelegation) GetDelegatorAddress() string {
if x != nil {
return x.DelegatorAddress
}
return ""
}
func (x *Redelegation) GetValidatorSrcAddress() string {
if x != nil {
return x.ValidatorSrcAddress
}
return ""
}
func (x *Redelegation) GetValidatorDstAddress() string {
if x != nil {
return x.ValidatorDstAddress
}
return ""
}
func (x *Redelegation) GetEntries() []*RedelegationEntry {
if x != nil {
return x.Entries
}
return nil
}
// Params defines the parameters for the staking module.
type Params struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// unbonding_time is the time duration of unbonding.
UnbondingTime *durationpb.Duration `protobuf:"bytes,1,opt,name=unbonding_time,json=unbondingTime,proto3" json:"unbonding_time,omitempty"`
// max_validators is the maximum number of validators.
MaxValidators uint32 `protobuf:"varint,2,opt,name=max_validators,json=maxValidators,proto3" json:"max_validators,omitempty"`
// max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio).
MaxEntries uint32 `protobuf:"varint,3,opt,name=max_entries,json=maxEntries,proto3" json:"max_entries,omitempty"`
// historical_entries is the number of historical entries to persist.
HistoricalEntries uint32 `protobuf:"varint,4,opt,name=historical_entries,json=historicalEntries,proto3" json:"historical_entries,omitempty"`
// bond_denom defines the bondable coin denomination.
BondDenom string `protobuf:"bytes,5,opt,name=bond_denom,json=bondDenom,proto3" json:"bond_denom,omitempty"`
// min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators
MinCommissionRate string `protobuf:"bytes,6,opt,name=min_commission_rate,json=minCommissionRate,proto3" json:"min_commission_rate,omitempty"`
}
func (x *Params) Reset() {
*x = Params{}
if protoimpl.UnsafeEnabled {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[15]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Params) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Params) ProtoMessage() {}
// Deprecated: Use Params.ProtoReflect.Descriptor instead.
func (*Params) Descriptor() ([]byte, []int) {
return file_cosmos_staking_v1beta1_staking_proto_rawDescGZIP(), []int{15}
}
func (x *Params) GetUnbondingTime() *durationpb.Duration {
if x != nil {
return x.UnbondingTime
}
return nil
}
func (x *Params) GetMaxValidators() uint32 {
if x != nil {
return x.MaxValidators
}
return 0
}
func (x *Params) GetMaxEntries() uint32 {
if x != nil {
return x.MaxEntries
}
return 0
}
func (x *Params) GetHistoricalEntries() uint32 {
if x != nil {
return x.HistoricalEntries
}
return 0
}
func (x *Params) GetBondDenom() string {
if x != nil {
return x.BondDenom
}
return ""
}
func (x *Params) GetMinCommissionRate() string {
if x != nil {
return x.MinCommissionRate
}
return ""
}
// DelegationResponse is equivalent to Delegation except that it contains a
// balance in addition to shares which is more suitable for client responses.
type DelegationResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Delegation *Delegation `protobuf:"bytes,1,opt,name=delegation,proto3" json:"delegation,omitempty"`
Balance *v1beta1.Coin `protobuf:"bytes,2,opt,name=balance,proto3" json:"balance,omitempty"`
}
func (x *DelegationResponse) Reset() {
*x = DelegationResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[16]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DelegationResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DelegationResponse) ProtoMessage() {}
// Deprecated: Use DelegationResponse.ProtoReflect.Descriptor instead.
func (*DelegationResponse) Descriptor() ([]byte, []int) {
return file_cosmos_staking_v1beta1_staking_proto_rawDescGZIP(), []int{16}
}
func (x *DelegationResponse) GetDelegation() *Delegation {
if x != nil {
return x.Delegation
}
return nil
}
func (x *DelegationResponse) GetBalance() *v1beta1.Coin {
if x != nil {
return x.Balance
}
return nil
}
// RedelegationEntryResponse is equivalent to a RedelegationEntry except that it
// contains a balance in addition to shares which is more suitable for client
// responses.
type RedelegationEntryResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RedelegationEntry *RedelegationEntry `protobuf:"bytes,1,opt,name=redelegation_entry,json=redelegationEntry,proto3" json:"redelegation_entry,omitempty"`
Balance string `protobuf:"bytes,4,opt,name=balance,proto3" json:"balance,omitempty"`
}
func (x *RedelegationEntryResponse) Reset() {
*x = RedelegationEntryResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[17]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RedelegationEntryResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RedelegationEntryResponse) ProtoMessage() {}
// Deprecated: Use RedelegationEntryResponse.ProtoReflect.Descriptor instead.
func (*RedelegationEntryResponse) Descriptor() ([]byte, []int) {
return file_cosmos_staking_v1beta1_staking_proto_rawDescGZIP(), []int{17}
}
func (x *RedelegationEntryResponse) GetRedelegationEntry() *RedelegationEntry {
if x != nil {
return x.RedelegationEntry
}
return nil
}
func (x *RedelegationEntryResponse) GetBalance() string {
if x != nil {
return x.Balance
}
return ""
}
// RedelegationResponse is equivalent to a Redelegation except that its entries
// contain a balance in addition to shares which is more suitable for client
// responses.
type RedelegationResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Redelegation *Redelegation `protobuf:"bytes,1,opt,name=redelegation,proto3" json:"redelegation,omitempty"`
Entries []*RedelegationEntryResponse `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries,omitempty"`
}
func (x *RedelegationResponse) Reset() {
*x = RedelegationResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[18]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RedelegationResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RedelegationResponse) ProtoMessage() {}
// Deprecated: Use RedelegationResponse.ProtoReflect.Descriptor instead.
func (*RedelegationResponse) Descriptor() ([]byte, []int) {
return file_cosmos_staking_v1beta1_staking_proto_rawDescGZIP(), []int{18}
}
func (x *RedelegationResponse) GetRedelegation() *Redelegation {
if x != nil {
return x.Redelegation
}
return nil
}
func (x *RedelegationResponse) GetEntries() []*RedelegationEntryResponse {
if x != nil {
return x.Entries
}
return nil
}
// Pool is used for tracking bonded and not-bonded token supply of the bond
// denomination.
type Pool struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
NotBondedTokens string `protobuf:"bytes,1,opt,name=not_bonded_tokens,json=notBondedTokens,proto3" json:"not_bonded_tokens,omitempty"`
BondedTokens string `protobuf:"bytes,2,opt,name=bonded_tokens,json=bondedTokens,proto3" json:"bonded_tokens,omitempty"`
}
func (x *Pool) Reset() {
*x = Pool{}
if protoimpl.UnsafeEnabled {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[19]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Pool) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Pool) ProtoMessage() {}
// Deprecated: Use Pool.ProtoReflect.Descriptor instead.
func (*Pool) Descriptor() ([]byte, []int) {
return file_cosmos_staking_v1beta1_staking_proto_rawDescGZIP(), []int{19}
}
func (x *Pool) GetNotBondedTokens() string {
if x != nil {
return x.NotBondedTokens
}
return ""
}
func (x *Pool) GetBondedTokens() string {
if x != nil {
return x.BondedTokens
}
return ""
}
type TokenizeShareRecord struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"`
ShareTokenDenom string `protobuf:"bytes,3,opt,name=share_token_denom,json=shareTokenDenom,proto3" json:"share_token_denom,omitempty"`
ModuleAccount string `protobuf:"bytes,4,opt,name=module_account,json=moduleAccount,proto3" json:"module_account,omitempty"` // module account take the role of delegator
Validator string `protobuf:"bytes,5,opt,name=validator,proto3" json:"validator,omitempty"` // validator delegated to for tokenize share record creation
}
func (x *TokenizeShareRecord) Reset() {
*x = TokenizeShareRecord{}
if protoimpl.UnsafeEnabled {
mi := &file_cosmos_staking_v1beta1_staking_proto_msgTypes[20]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TokenizeShareRecord) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TokenizeShareRecord) ProtoMessage() {}
// Deprecated: Use TokenizeShareRecord.ProtoReflect.Descriptor instead.
func (*TokenizeShareRecord) Descriptor() ([]byte, []int) {
return file_cosmos_staking_v1beta1_staking_proto_rawDescGZIP(), []int{20}
}
func (x *TokenizeShareRecord) GetId() uint64 {
if x != nil {
return x.Id
}
return 0
}
func (x *TokenizeShareRecord) GetOwner() string {
if x != nil {
return x.Owner
}
return ""
}
func (x *TokenizeShareRecord) GetShareTokenDenom() string {
if x != nil {
return x.ShareTokenDenom
}
return ""
}
func (x *TokenizeShareRecord) GetModuleAccount() string {
if x != nil {
return x.ModuleAccount
}
return ""
}
func (x *TokenizeShareRecord) GetValidator() string {
if x != nil {
return x.Validator
}
return ""
}
var File_cosmos_staking_v1beta1_staking_proto protoreflect.FileDescriptor
var file_cosmos_staking_v1beta1_staking_proto_rawDesc = []byte{
0x0a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67,
0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73,
0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x14,
0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63,
0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73,
0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31,
0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x74, 0x65, 0x6e,
0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, 0x79,
0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x89, 0x01, 0x0a, 0x0e, 0x48, 0x69,
0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x36, 0x0a, 0x06,
0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x74,
0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e,
0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x68, 0x65,
0x61, 0x64, 0x65, 0x72, 0x12, 0x3f, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x73, 0x65, 0x74, 0x18, 0x02,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74,
0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, 0x61,
0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x76,
0x61, 0x6c, 0x73, 0x65, 0x74, 0x22, 0xaf, 0x02, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x73,
0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x04, 0x72, 0x61, 0x74,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2e, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f,
0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d,
0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79,
0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x04, 0x72, 0x61, 0x74, 0x65, 0x12, 0x5c, 0x0a,
0x08, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42,
0x41, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f,
0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xf2,
0xde, 0x1f, 0x0f, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x61, 0x74,
0x65, 0x22, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x52, 0x61, 0x74, 0x65, 0x12, 0x70, 0x0a, 0x0f, 0x6d,
0x61, 0x78, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x03,
0x20, 0x01, 0x28, 0x09, 0x42, 0x48, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69,
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f,
0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73,
0x2e, 0x44, 0x65, 0x63, 0xf2, 0xde, 0x1f, 0x16, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x61,
0x78, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x22, 0x52, 0x0d,
0x6d, 0x61, 0x78, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x61, 0x74, 0x65, 0x3a, 0x08, 0x98,
0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xd1, 0x01, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d,
0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x5c, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73,
0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e,
0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x73,
0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x73, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0xd0,
0xde, 0x1f, 0x01, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52,
0x61, 0x74, 0x65, 0x73, 0x12, 0x5b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74,
0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65,
0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x1e, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x12, 0x79,
0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65,
0x22, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d,
0x65, 0x3a, 0x08, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xc9, 0x01, 0x0a, 0x0b,
0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x6d,
0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x6f,
0x6e, 0x69, 0x6b, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74,
0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74,
0x79, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x12, 0x46, 0x0a, 0x10, 0x73,
0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1b, 0xf2, 0xde, 0x1f, 0x17, 0x79, 0x61, 0x6d, 0x6c, 0x3a,
0x22, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63,
0x74, 0x22, 0x52, 0x0f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x6f, 0x6e, 0x74,
0x61, 0x63, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x05,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x3a, 0x08, 0x98,
0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xac, 0x07, 0x0a, 0x09, 0x56, 0x61, 0x6c, 0x69,
0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x46, 0x0a, 0x10, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f,
0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,
0x1b, 0xf2, 0xde, 0x1f, 0x17, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6f, 0x70, 0x65, 0x72, 0x61,
0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52, 0x0f, 0x6f, 0x70,
0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x74, 0x0a,
0x10, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65,
0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x33, 0xf2,
0xde, 0x1f, 0x17, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73,
0x75, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0xca, 0xb4, 0x2d, 0x14, 0x63, 0x6f,
0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x50, 0x75, 0x62, 0x4b,
0x65, 0x79, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x75, 0x62,
0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20,
0x01, 0x28, 0x08, 0x52, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x3a, 0x0a, 0x06, 0x73,
0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x63, 0x6f,
0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62,
0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, 0x6f, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52,
0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x46, 0x0a, 0x06, 0x74, 0x6f, 0x6b, 0x65, 0x6e,
0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2e, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f,
0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d,
0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79,
0x70, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x06, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12,
0x74, 0x0a, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x73, 0x68, 0x61,
0x72, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x49, 0xc8, 0xde, 0x1f, 0x00, 0xda,
0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f,
0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f,
0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xf2, 0xde, 0x1f, 0x17, 0x79, 0x61, 0x6d,
0x6c, 0x3a, 0x22, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x73, 0x68, 0x61,
0x72, 0x65, 0x73, 0x22, 0x52, 0x0f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x53,
0x68, 0x61, 0x72, 0x65, 0x73, 0x12, 0x4b, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70,
0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x73,
0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65,
0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42,
0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69,
0x6f, 0x6e, 0x12, 0x46, 0x0a, 0x10, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f,
0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x42, 0x1b, 0xf2, 0xde,
0x1f, 0x17, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e,
0x67, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x52, 0x0f, 0x75, 0x6e, 0x62, 0x6f, 0x6e,
0x64, 0x69, 0x6e, 0x67, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x64, 0x0a, 0x0e, 0x75, 0x6e,
0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x21,
0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x15, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x75, 0x6e,
0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x90, 0xdf, 0x1f,
0x01, 0x52, 0x0d, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65,
0x12, 0x48, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0a,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74,
0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f,
0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0a,
0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x7c, 0x0a, 0x13, 0x6d, 0x69,
0x6e, 0x5f, 0x73, 0x65, 0x6c, 0x66, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x4c, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f,
0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d,
0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79,
0x70, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x1a, 0x79, 0x61, 0x6d, 0x6c, 0x3a,
0x22, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x6c, 0x66, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x22, 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x53, 0x65, 0x6c, 0x66, 0x44, 0x65,
0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x0c, 0x88, 0xa0, 0x1f, 0x00, 0x98, 0xa0,
0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x36, 0x0a, 0x0c, 0x56, 0x61, 0x6c, 0x41, 0x64, 0x64,
0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73,
0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65,
0x73, 0x73, 0x65, 0x73, 0x3a, 0x08, 0x98, 0xa0, 0x1f, 0x00, 0x80, 0xdc, 0x20, 0x01, 0x22, 0xac,
0x01, 0x0a, 0x06, 0x44, 0x56, 0x50, 0x61, 0x69, 0x72, 0x12, 0x49, 0x0a, 0x11, 0x64, 0x65, 0x6c,
0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x42, 0x1c, 0xf2, 0xde, 0x1f, 0x18, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22,
0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73,
0x73, 0x22, 0x52, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64,
0x72, 0x65, 0x73, 0x73, 0x12, 0x49, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f,
0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42,
0x1c, 0xf2, 0xde, 0x1f, 0x18, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x76, 0x61, 0x6c, 0x69, 0x64,
0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52, 0x10, 0x76,
0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a,
0x0c, 0x88, 0xa0, 0x1f, 0x00, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x45, 0x0a,
0x07, 0x44, 0x56, 0x50, 0x61, 0x69, 0x72, 0x73, 0x12, 0x3a, 0x0a, 0x05, 0x70, 0x61, 0x69, 0x72,
0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73,
0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31,
0x2e, 0x44, 0x56, 0x50, 0x61, 0x69, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x70,
0x61, 0x69, 0x72, 0x73, 0x22, 0x91, 0x02, 0x0a, 0x0a, 0x44, 0x56, 0x56, 0x54, 0x72, 0x69, 0x70,
0x6c, 0x65, 0x74, 0x12, 0x49, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72,
0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1c,
0xf2, 0xde, 0x1f, 0x18, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61,
0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52, 0x10, 0x64, 0x65,
0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x54,
0x0a, 0x15, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x73, 0x72, 0x63, 0x5f,
0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x20, 0xf2,
0xde, 0x1f, 0x1c, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74,
0x6f, 0x72, 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52,
0x13, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64,
0x72, 0x65, 0x73, 0x73, 0x12, 0x54, 0x0a, 0x15, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f,
0x72, 0x5f, 0x64, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20,
0x01, 0x28, 0x09, 0x42, 0x20, 0xf2, 0xde, 0x1f, 0x1c, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x76,
0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x64, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64,
0x72, 0x65, 0x73, 0x73, 0x22, 0x52, 0x13, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72,
0x44, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x0c, 0x88, 0xa0, 0x1f, 0x00,
0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x53, 0x0a, 0x0b, 0x44, 0x56, 0x56, 0x54,
0x72, 0x69, 0x70, 0x6c, 0x65, 0x74, 0x73, 0x12, 0x44, 0x0a, 0x08, 0x74, 0x72, 0x69, 0x70, 0x6c,
0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d,
0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74,
0x61, 0x31, 0x2e, 0x44, 0x56, 0x56, 0x54, 0x72, 0x69, 0x70, 0x6c, 0x65, 0x74, 0x42, 0x04, 0xc8,
0xde, 0x1f, 0x00, 0x52, 0x08, 0x74, 0x72, 0x69, 0x70, 0x6c, 0x65, 0x74, 0x73, 0x22, 0xf8, 0x01,
0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x49, 0x0a, 0x11,
0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73,
0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1c, 0xf2, 0xde, 0x1f, 0x18, 0x79, 0x61, 0x6d,
0x6c, 0x3a, 0x22, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64,
0x72, 0x65, 0x73, 0x73, 0x22, 0x52, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72,
0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x49, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64,
0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x42, 0x1c, 0xf2, 0xde, 0x1f, 0x18, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x76, 0x61,
0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22,
0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65,
0x73, 0x73, 0x12, 0x46, 0x0a, 0x06, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x42, 0x2e, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68,
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f,
0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44,
0x65, 0x63, 0x52, 0x06, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x3a, 0x0c, 0x88, 0xa0, 0x1f, 0x00,
0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x8b, 0x02, 0x0a, 0x13, 0x55, 0x6e, 0x62,
0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x12, 0x49, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64,
0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1c, 0xf2, 0xde, 0x1f,
0x18, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72,
0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67,
0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x49, 0x0a, 0x11, 0x76,
0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1c, 0xf2, 0xde, 0x1f, 0x18, 0x79, 0x61, 0x6d, 0x6c,
0x3a, 0x22, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72,
0x65, 0x73, 0x73, 0x22, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41,
0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x50, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65,
0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73,
0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31,
0x2e, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52,
0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x3a, 0x0c, 0x88, 0xa0, 0x1f, 0x00, 0x98, 0xa0,
0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x8f, 0x03, 0x0a, 0x18, 0x55, 0x6e, 0x62, 0x6f, 0x6e,
0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e,
0x74, 0x72, 0x79, 0x12, 0x43, 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x1a, 0xf2, 0xde,
0x1f, 0x16, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x52, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x67, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70,
0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x22, 0xc8,
0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x16, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6d,
0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x90, 0xdf, 0x1f,
0x01, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d,
0x65, 0x12, 0x71, 0x0a, 0x0f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x62, 0x61, 0x6c,
0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x48, 0xc8, 0xde, 0x1f, 0x00,
0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63,
0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b,
0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x16, 0x79, 0x61,
0x6d, 0x6c, 0x3a, 0x22, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x62, 0x61, 0x6c, 0x61,
0x6e, 0x63, 0x65, 0x22, 0x52, 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x42, 0x61, 0x6c,
0x61, 0x6e, 0x63, 0x65, 0x12, 0x48, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2e, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73,
0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65,
0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x3a, 0x08,
0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0x8d, 0x03, 0x0a, 0x11, 0x52, 0x65, 0x64,
0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x43,
0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68,
0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x1a, 0xf2, 0xde, 0x1f, 0x16, 0x79, 0x61, 0x6d,
0x6c, 0x3a, 0x22, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67,
0x68, 0x74, 0x22, 0x52, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69,
0x67, 0x68, 0x74, 0x12, 0x67, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f,
0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54,
0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x22, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde,
0x1f, 0x16, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69,
0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0e, 0x63, 0x6f,
0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x71, 0x0a, 0x0f,
0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18,
0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x48, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73,
0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65,
0x73, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x16, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x69,
0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x52,
0x0e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12,
0x4d, 0x0a, 0x0a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x5f, 0x64, 0x73, 0x74, 0x18, 0x04, 0x20,
0x01, 0x28, 0x09, 0x42, 0x2e, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74,
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63,
0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e,
0x44, 0x65, 0x63, 0x52, 0x09, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x44, 0x73, 0x74, 0x3a, 0x08,
0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xde, 0x02, 0x0a, 0x0c, 0x52, 0x65, 0x64,
0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x49, 0x0a, 0x11, 0x64, 0x65, 0x6c,
0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x42, 0x1c, 0xf2, 0xde, 0x1f, 0x18, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22,
0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73,
0x73, 0x22, 0x52, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64,
0x72, 0x65, 0x73, 0x73, 0x12, 0x54, 0x0a, 0x15, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f,
0x72, 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x42, 0x20, 0xf2, 0xde, 0x1f, 0x1c, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x76,
0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64,
0x72, 0x65, 0x73, 0x73, 0x22, 0x52, 0x13, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72,
0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x54, 0x0a, 0x15, 0x76, 0x61,
0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x64, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72,
0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x20, 0xf2, 0xde, 0x1f, 0x1c, 0x79,
0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x64,
0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52, 0x13, 0x76, 0x61, 0x6c,
0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73,
0x12, 0x49, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69,
0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x64, 0x65, 0x6c,
0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x04, 0xc8, 0xde,
0x1f, 0x00, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x3a, 0x0c, 0x88, 0xa0, 0x1f,
0x00, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0xf2, 0x02, 0x0a, 0x06, 0x50, 0x61,
0x72, 0x61, 0x6d, 0x73, 0x12, 0x4a, 0x0a, 0x0e, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e,
0x67, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44,
0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x98, 0xdf, 0x1f,
0x01, 0x52, 0x0d, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65,
0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f,
0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x56, 0x61, 0x6c,
0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x78, 0x5f, 0x65,
0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6d, 0x61,
0x78, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x68, 0x69, 0x73, 0x74,
0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x04,
0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c,
0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, 0x6e, 0x64, 0x5f,
0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x6f, 0x6e,
0x64, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x7c, 0x0a, 0x13, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6f,
0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20,
0x01, 0x28, 0x09, 0x42, 0x4c, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74,
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63,
0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e,
0x44, 0x65, 0x63, 0xf2, 0xde, 0x1f, 0x1a, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x69, 0x6e,
0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x65,
0x22, 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e,
0x52, 0x61, 0x74, 0x65, 0x3a, 0x08, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xa3,
0x01, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d,
0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74,
0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0xc8,
0xde, 0x1f, 0x00, 0x52, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12,
0x39, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f,
0x00, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x3a, 0x08, 0x98, 0xa0, 0x1f, 0x00,
0xe8, 0xa0, 0x1f, 0x00, 0x22, 0xcb, 0x01, 0x0a, 0x19, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x5e, 0x0a, 0x12, 0x72, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29,
0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e,
0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52,
0x11, 0x72, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74,
0x72, 0x79, 0x12, 0x48, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20,
0x01, 0x28, 0x09, 0x42, 0x2e, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74,
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63,
0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e,
0x49, 0x6e, 0x74, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x3a, 0x04, 0xe8, 0xa0,
0x1f, 0x01, 0x22, 0xbf, 0x01, 0x0a, 0x14, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x0c, 0x72,
0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69,
0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x64, 0x65, 0x6c,
0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0c, 0x72,
0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x51, 0x0a, 0x07, 0x65,
0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x63,
0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31,
0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42,
0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x3a, 0x04,
0xe8, 0xa0, 0x1f, 0x00, 0x22, 0xff, 0x01, 0x0a, 0x04, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x6f, 0x0a,
0x11, 0x6e, 0x6f, 0x74, 0x5f, 0x62, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65,
0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x43, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde,
0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73,
0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74,
0x79, 0x70, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xea, 0xde, 0x1f, 0x11, 0x6e, 0x6f, 0x74, 0x5f,
0x62, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x0f, 0x6e,
0x6f, 0x74, 0x42, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x7c,
0x0a, 0x0d, 0x62, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x57, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73,
0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65,
0x73, 0x2e, 0x49, 0x6e, 0x74, 0xea, 0xde, 0x1f, 0x0d, 0x62, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x5f,
0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0xf2, 0xde, 0x1f, 0x14, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22,
0x62, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x22, 0x52, 0x0c,
0x62, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x3a, 0x08, 0xe8, 0xa0,
0x1f, 0x01, 0xf0, 0xa0, 0x1f, 0x01, 0x22, 0xb2, 0x01, 0x0a, 0x13, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x0e,
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14,
0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f,
0x77, 0x6e, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x68, 0x61, 0x72, 0x65, 0x5f, 0x74, 0x6f,
0x6b, 0x65, 0x6e, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x44, 0x65, 0x6e, 0x6f, 0x6d,
0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75,
0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65,
0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64,
0x61, 0x74, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69,
0x64, 0x61, 0x74, 0x6f, 0x72, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x2a, 0xb6, 0x01, 0x0a, 0x0a,
0x42, 0x6f, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2c, 0x0a, 0x17, 0x42, 0x4f,
0x4e, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,
0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x1a, 0x0f, 0x8a, 0x9d, 0x20, 0x0b, 0x55, 0x6e, 0x73,
0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x14, 0x42, 0x4f, 0x4e, 0x44,
0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x42, 0x4f, 0x4e, 0x44, 0x45, 0x44,
0x10, 0x01, 0x1a, 0x0c, 0x8a, 0x9d, 0x20, 0x08, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x65, 0x64,
0x12, 0x28, 0x0a, 0x15, 0x42, 0x4f, 0x4e, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f,
0x55, 0x4e, 0x42, 0x4f, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x1a, 0x0d, 0x8a, 0x9d, 0x20,
0x09, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x22, 0x0a, 0x12, 0x42, 0x4f,
0x4e, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x42, 0x4f, 0x4e, 0x44, 0x45, 0x44,
0x10, 0x03, 0x1a, 0x0a, 0x8a, 0x9d, 0x20, 0x06, 0x42, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x1a, 0x04,
0x88, 0xa3, 0x1e, 0x00, 0x42, 0xec, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73,
0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65,
0x74, 0x61, 0x31, 0x42, 0x0c, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74,
0x6f, 0x50, 0x01, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64,
0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61,
0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x73, 0x74, 0x61,
0x6b, 0x69, 0x6e, 0x67, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53,
0x58, 0xaa, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x69,
0x6e, 0x67, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x16, 0x43, 0x6f, 0x73,
0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65,
0x74, 0x61, 0x31, 0xe2, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x61,
0x6b, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42,
0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f,
0x73, 0x3a, 0x3a, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65,
0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_cosmos_staking_v1beta1_staking_proto_rawDescOnce sync.Once
file_cosmos_staking_v1beta1_staking_proto_rawDescData = file_cosmos_staking_v1beta1_staking_proto_rawDesc
)
func file_cosmos_staking_v1beta1_staking_proto_rawDescGZIP() []byte {
file_cosmos_staking_v1beta1_staking_proto_rawDescOnce.Do(func() {
file_cosmos_staking_v1beta1_staking_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_staking_v1beta1_staking_proto_rawDescData)
})
return file_cosmos_staking_v1beta1_staking_proto_rawDescData
}
var file_cosmos_staking_v1beta1_staking_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_cosmos_staking_v1beta1_staking_proto_msgTypes = make([]protoimpl.MessageInfo, 21)
var file_cosmos_staking_v1beta1_staking_proto_goTypes = []interface{}{
(BondStatus)(0), // 0: cosmos.staking.v1beta1.BondStatus
(*HistoricalInfo)(nil), // 1: cosmos.staking.v1beta1.HistoricalInfo
(*CommissionRates)(nil), // 2: cosmos.staking.v1beta1.CommissionRates
(*Commission)(nil), // 3: cosmos.staking.v1beta1.Commission
(*Description)(nil), // 4: cosmos.staking.v1beta1.Description
(*Validator)(nil), // 5: cosmos.staking.v1beta1.Validator
(*ValAddresses)(nil), // 6: cosmos.staking.v1beta1.ValAddresses
(*DVPair)(nil), // 7: cosmos.staking.v1beta1.DVPair
(*DVPairs)(nil), // 8: cosmos.staking.v1beta1.DVPairs
(*DVVTriplet)(nil), // 9: cosmos.staking.v1beta1.DVVTriplet
(*DVVTriplets)(nil), // 10: cosmos.staking.v1beta1.DVVTriplets
(*Delegation)(nil), // 11: cosmos.staking.v1beta1.Delegation
(*UnbondingDelegation)(nil), // 12: cosmos.staking.v1beta1.UnbondingDelegation
(*UnbondingDelegationEntry)(nil), // 13: cosmos.staking.v1beta1.UnbondingDelegationEntry
(*RedelegationEntry)(nil), // 14: cosmos.staking.v1beta1.RedelegationEntry
(*Redelegation)(nil), // 15: cosmos.staking.v1beta1.Redelegation
(*Params)(nil), // 16: cosmos.staking.v1beta1.Params
(*DelegationResponse)(nil), // 17: cosmos.staking.v1beta1.DelegationResponse
(*RedelegationEntryResponse)(nil), // 18: cosmos.staking.v1beta1.RedelegationEntryResponse
(*RedelegationResponse)(nil), // 19: cosmos.staking.v1beta1.RedelegationResponse
(*Pool)(nil), // 20: cosmos.staking.v1beta1.Pool
(*TokenizeShareRecord)(nil), // 21: cosmos.staking.v1beta1.TokenizeShareRecord
(*types.Header)(nil), // 22: tendermint.types.Header
(*timestamppb.Timestamp)(nil), // 23: google.protobuf.Timestamp
(*anypb.Any)(nil), // 24: google.protobuf.Any
(*durationpb.Duration)(nil), // 25: google.protobuf.Duration
(*v1beta1.Coin)(nil), // 26: cosmos.base.v1beta1.Coin
}
var file_cosmos_staking_v1beta1_staking_proto_depIdxs = []int32{
22, // 0: cosmos.staking.v1beta1.HistoricalInfo.header:type_name -> tendermint.types.Header
5, // 1: cosmos.staking.v1beta1.HistoricalInfo.valset:type_name -> cosmos.staking.v1beta1.Validator
2, // 2: cosmos.staking.v1beta1.Commission.commission_rates:type_name -> cosmos.staking.v1beta1.CommissionRates
23, // 3: cosmos.staking.v1beta1.Commission.update_time:type_name -> google.protobuf.Timestamp
24, // 4: cosmos.staking.v1beta1.Validator.consensus_pubkey:type_name -> google.protobuf.Any
0, // 5: cosmos.staking.v1beta1.Validator.status:type_name -> cosmos.staking.v1beta1.BondStatus
4, // 6: cosmos.staking.v1beta1.Validator.description:type_name -> cosmos.staking.v1beta1.Description
23, // 7: cosmos.staking.v1beta1.Validator.unbonding_time:type_name -> google.protobuf.Timestamp
3, // 8: cosmos.staking.v1beta1.Validator.commission:type_name -> cosmos.staking.v1beta1.Commission
7, // 9: cosmos.staking.v1beta1.DVPairs.pairs:type_name -> cosmos.staking.v1beta1.DVPair
9, // 10: cosmos.staking.v1beta1.DVVTriplets.triplets:type_name -> cosmos.staking.v1beta1.DVVTriplet
13, // 11: cosmos.staking.v1beta1.UnbondingDelegation.entries:type_name -> cosmos.staking.v1beta1.UnbondingDelegationEntry
23, // 12: cosmos.staking.v1beta1.UnbondingDelegationEntry.completion_time:type_name -> google.protobuf.Timestamp
23, // 13: cosmos.staking.v1beta1.RedelegationEntry.completion_time:type_name -> google.protobuf.Timestamp
14, // 14: cosmos.staking.v1beta1.Redelegation.entries:type_name -> cosmos.staking.v1beta1.RedelegationEntry
25, // 15: cosmos.staking.v1beta1.Params.unbonding_time:type_name -> google.protobuf.Duration
11, // 16: cosmos.staking.v1beta1.DelegationResponse.delegation:type_name -> cosmos.staking.v1beta1.Delegation
26, // 17: cosmos.staking.v1beta1.DelegationResponse.balance:type_name -> cosmos.base.v1beta1.Coin
14, // 18: cosmos.staking.v1beta1.RedelegationEntryResponse.redelegation_entry:type_name -> cosmos.staking.v1beta1.RedelegationEntry
15, // 19: cosmos.staking.v1beta1.RedelegationResponse.redelegation:type_name -> cosmos.staking.v1beta1.Redelegation
18, // 20: cosmos.staking.v1beta1.RedelegationResponse.entries:type_name -> cosmos.staking.v1beta1.RedelegationEntryResponse
21, // [21:21] is the sub-list for method output_type
21, // [21:21] is the sub-list for method input_type
21, // [21:21] is the sub-list for extension type_name
21, // [21:21] is the sub-list for extension extendee
0, // [0:21] is the sub-list for field type_name
}
func init() { file_cosmos_staking_v1beta1_staking_proto_init() }
func file_cosmos_staking_v1beta1_staking_proto_init() {
if File_cosmos_staking_v1beta1_staking_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_cosmos_staking_v1beta1_staking_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*HistoricalInfo); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_cosmos_staking_v1beta1_staking_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CommissionRates); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_cosmos_staking_v1beta1_staking_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Commission); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_cosmos_staking_v1beta1_staking_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Description); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_cosmos_staking_v1beta1_staking_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Validator); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_cosmos_staking_v1beta1_staking_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ValAddresses); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_cosmos_staking_v1beta1_staking_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DVPair); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_cosmos_staking_v1beta1_staking_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DVPairs); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_cosmos_staking_v1beta1_staking_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DVVTriplet); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_cosmos_staking_v1beta1_staking_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DVVTriplets); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_cosmos_staking_v1beta1_staking_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Delegation); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_cosmos_staking_v1beta1_staking_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UnbondingDelegation); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_cosmos_staking_v1beta1_staking_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UnbondingDelegationEntry); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_cosmos_staking_v1beta1_staking_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RedelegationEntry); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_cosmos_staking_v1beta1_staking_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Redelegation); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_cosmos_staking_v1beta1_staking_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Params); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_cosmos_staking_v1beta1_staking_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DelegationResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_cosmos_staking_v1beta1_staking_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RedelegationEntryResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_cosmos_staking_v1beta1_staking_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RedelegationResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_cosmos_staking_v1beta1_staking_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Pool); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_cosmos_staking_v1beta1_staking_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TokenizeShareRecord); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_cosmos_staking_v1beta1_staking_proto_rawDesc,
NumEnums: 1,
NumMessages: 21,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_cosmos_staking_v1beta1_staking_proto_goTypes,
DependencyIndexes: file_cosmos_staking_v1beta1_staking_proto_depIdxs,
EnumInfos: file_cosmos_staking_v1beta1_staking_proto_enumTypes,
MessageInfos: file_cosmos_staking_v1beta1_staking_proto_msgTypes,
}.Build()
File_cosmos_staking_v1beta1_staking_proto = out.File
file_cosmos_staking_v1beta1_staking_proto_rawDesc = nil
file_cosmos_staking_v1beta1_staking_proto_goTypes = nil
file_cosmos_staking_v1beta1_staking_proto_depIdxs = nil
}
|
init
|
main.go
|
// Copyright 2022 VMware Tanzu Community Edition contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package main
import (
"fmt"
"os"
"path/filepath"
"github.com/sirupsen/logrus"
"github.com/vmware-tanzu/community-edition/extensions/docker-desktop/pkg/cluster"
"github.com/vmware-tanzu/community-edition/extensions/docker-desktop/pkg/config"
)
var log = logrus.New()
func init()
|
func main() {
var res config.Response
argsWithoutProg := os.Args[1:]
if len(argsWithoutProg) != 1 {
fmt.Println("This program requires any of the following parameters: create|delete|status|logs|kubeconfig")
os.Exit(-1)
}
c := cluster.New(log)
switch argsWithoutProg[0] {
case "create":
res = c.CreateCluster()
case "delete":
res = c.DeleteCluster()
case "status":
res = c.ClusterStatus()
case "logs":
res = c.Logs()
case "kubeconfig":
res = c.GetKubeconfig()
}
fmt.Println(c.GetJSONResponse(&res))
}
|
{
// The API for setting attributes is a little different than the package level
// exported logger. See Godoc.
// log.Out = os.Stdout
// You could set this to any `io.Writer` such as a file
file, err := os.OpenFile(filepath.Join(config.GetUserHome(), config.ClusterLogFile), os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
if err == nil {
log.Out = file
} else {
log.Info("Failed to log to file, using default stderr")
}
// Only log the warning severity or above.
// For development purposes, change this to Debug level to get full
// tracing captured to the cluster.log file in the root of the extension
// container (docker exec ID tail -f cluster.log)
log.SetLevel(logrus.WarnLevel)
}
|
schema.rs
|
/*
* Copyright 2018-2021 Cargill Incorporated
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* -----------------------------------------------------------------------------
*/
table! {
notifications (id) {
id -> Text,
payload_title -> Text,
payload_body -> Text,
created -> Timestamp,
recipients -> Array<Text>,
|
}
table! {
user_notifications (notification_id) {
notification_id -> Text,
user_id -> Text,
unread -> Bool,
}
}
table! {
notification_properties (id) {
id -> Int8,
notification_id -> Text,
property -> Text,
property_value -> Text,
}
}
joinable!(user_notifications -> notifications (notification_id));
joinable!(notification_properties -> notifications (notification_id));
allow_tables_to_appear_in_same_query!(notifications, user_notifications, notification_properties);
|
}
|
get_player_response_pb2.py
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pogoprotos/networking/responses/get_player_response.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
from pogoprotos.data import player_data_pb2 as pogoprotos_dot_data_dot_player__data__pb2
DESCRIPTOR = _descriptor.FileDescriptor(
name='pogoprotos/networking/responses/get_player_response.proto',
package='pogoprotos.networking.responses',
syntax='proto3',
serialized_pb=_b('\n9pogoprotos/networking/responses/get_player_response.proto\x12\x1fpogoprotos.networking.responses\x1a!pogoprotos/data/player_data.proto\"t\n\x11GetPlayerResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x30\n\x0bplayer_data\x18\x02 \x01(\x0b\x32\x1b.pogoprotos.data.PlayerData\x12\x0e\n\x06\x62\x61nned\x18\x03 \x01(\x08\x12\x0c\n\x04warn\x18\x04 \x01(\x08\x62\x06proto3')
,
dependencies=[pogoprotos_dot_data_dot_player__data__pb2.DESCRIPTOR,])
_GETPLAYERRESPONSE = _descriptor.Descriptor(
name='GetPlayerResponse',
full_name='pogoprotos.networking.responses.GetPlayerResponse',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='success', full_name='pogoprotos.networking.responses.GetPlayerResponse.success', index=0,
number=1, type=8, cpp_type=7, label=1,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='player_data', full_name='pogoprotos.networking.responses.GetPlayerResponse.player_data', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='banned', full_name='pogoprotos.networking.responses.GetPlayerResponse.banned', index=2,
number=3, type=8, cpp_type=7, label=1,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='warn', full_name='pogoprotos.networking.responses.GetPlayerResponse.warn', index=3,
number=4, type=8, cpp_type=7, label=1,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=129,
serialized_end=245,
)
_GETPLAYERRESPONSE.fields_by_name['player_data'].message_type = pogoprotos_dot_data_dot_player__data__pb2._PLAYERDATA
DESCRIPTOR.message_types_by_name['GetPlayerResponse'] = _GETPLAYERRESPONSE
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
GetPlayerResponse = _reflection.GeneratedProtocolMessageType('GetPlayerResponse', (_message.Message,), dict(
DESCRIPTOR = _GETPLAYERRESPONSE,
__module__ = 'pogoprotos.networking.responses.get_player_response_pb2'
# @@protoc_insertion_point(class_scope:pogoprotos.networking.responses.GetPlayerResponse)
))
_sym_db.RegisterMessage(GetPlayerResponse)
|
# @@protoc_insertion_point(module_scope)
| |
kentico-add-component.sc.es5.js
|
/*! Built with http://stenciljs.com */
|
components.loadBundle("kentico-add-component",["exports","./chunk-b2fc85a4.js"],function(e,t){var n=window.components.h,r=function(){function e(){}return e.prototype.render=function(){return n("div",null,n("kentico-add-component-button",{primary:this.primary,"is-active":this.showComponentList,tooltip:this.addTooltip,onMouseDown:function(e){return e.preventDefault()}}),this.renderComponentList())},e.prototype.renderComponentList=function(){return this.showComponentList?n("kentico-pop-up-container",{class:"ktc-component-list",localizationService:this.localizationService,primary:this.primary,position:this.position,headerTitle:this.headerTitle,onClick:function(e){return e.stopPropagation()}},n("kentico-pop-up-listing",{slot:"pop-up-content",items:this.components,noItemsAvailableMessage:this.noComponentsAvailableMessage})):null},Object.defineProperty(e,"is",{get:function(){return"kentico-add-component"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"encapsulation",{get:function(){return"shadow"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"properties",{get:function(){return{addTooltip:{type:String,attr:"add-tooltip"},components:{type:"Any",attr:"components"},headerTitle:{type:String,attr:"header-title"},localizationService:{type:"Any",attr:"localization-service"},noComponentsAvailableMessage:{type:String,attr:"no-components-available-message"},position:{type:"Any",attr:"position"},primary:{type:Boolean,attr:"primary"},showComponentList:{type:Boolean,attr:"show-component-list"}}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"style",{get:function(){return"[data-kentico-add-component-host] kentico-pop-up-container[data-kentico-add-component]{top:50px;left:50%;position:absolute}[data-kentico-add-component-host] kentico-pop-up-container[data-kentico-add-component]:before{content:'';display:block;position:absolute;left:50%;margin-left:-10px;width:0;height:0;top:-20px;border:10px solid;border-color:transparent transparent #262524}[data-kentico-add-component-host] kentico-pop-up-container[position=center][data-kentico-add-component]{-webkit-transform:translateX(-50%);transform:translateX(-50%)}[data-kentico-add-component-host] kentico-pop-up-container[position=left][data-kentico-add-component]{-webkit-transform:translateX(-100%) translateX(18px);transform:translateX(-100%) translateX(18px)}[data-kentico-add-component-host] kentico-pop-up-container[position=left][data-kentico-add-component]:before{left:calc(100% - 18px)}[data-kentico-add-component-host] kentico-pop-up-container[position=right][data-kentico-add-component]{-webkit-transform:translateX(-18px);transform:translateX(-18px)}[data-kentico-add-component-host] kentico-pop-up-container[position=right][data-kentico-add-component]:before{left:18px}[primary=true][data-kentico-add-component-host] kentico-pop-up-container[data-kentico-add-component]:before{border-color:transparent transparent #0f6194}[is-small=true][data-kentico-add-component-host] kentico-add-component-button[data-kentico-add-component] a[data-kentico-add-component]{border-radius:3px 3px 0 0;padding:2px 11px}[is-small=true][data-kentico-add-component-host] kentico-pop-up-container[data-kentico-add-component]{top:38px}[is-thin=true][data-kentico-add-component-host] kentico-add-component-button[data-kentico-add-component] a[data-kentico-add-component]{border-radius:3px;padding:1px 11px}[is-thin=true][data-kentico-add-component-host] kentico-pop-up-container[data-kentico-add-component]{top:36px}"},enumerable:!0,configurable:!0}),e}(),i=function(){function e(){var e=this;this.items=[],this.getItemTitle=function(e){return e.description?e.name+"\n"+e.description:e.name},this.onItemClick=function(t){t.key!==e.activeItemIdentifier&&e.selectItem.emit(t)}}return e.prototype.render=function(){var e=this;return n("div",{class:{"ktc-pop-up-item-listing":!0,"ktc-pop-up-item-listing--empty":0===this.items.length}},0===this.items.length?this.noItemsAvailableMessage:n("ul",null,this.items.map(function(t){return n("li",{class:{"ktc-pop-up-item":!0,"ktc-pop-up-item--active":t.key===e.activeItemIdentifier,"ktc-pop-up-item-double-column":!e.singleColumn,"ktc-pop-up-item-single-column":e.singleColumn},title:e.getItemTitle(t),onClick:function(){return e.onItemClick(t)}},t.iconClass?n("div",{class:"ktc-pop-up-item-icon"},n("i",{"aria-hidden":"true",class:t.iconClass})):"",n("div",{class:{"ktc-pop-up-item-label":!0,"ktc-pop-up-item-label--no-icon":!t.iconClass}},t.name))})))},Object.defineProperty(e,"is",{get:function(){return"kentico-pop-up-listing"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"encapsulation",{get:function(){return"shadow"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"properties",{get:function(){return{activeItemIdentifier:{type:String,attr:"active-item-identifier"},items:{type:"Any",attr:"items"},noItemsAvailableMessage:{type:String,attr:"no-items-available-message"},singleColumn:{type:Boolean,attr:"single-column"}}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"events",{get:function(){return[{name:"selectItem",method:"selectItem",bubbles:!0,cancelable:!0,composed:!0}]},enumerable:!0,configurable:!0}),Object.defineProperty(e,"style",{get:function(){return"[data-kentico-pop-up-listing-host] [class*=\" icon-\"][data-kentico-pop-up-listing], [data-kentico-pop-up-listing-host] [class^=icon-][data-kentico-pop-up-listing]{font-family:Core-icons;display:inline-block;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;font-size:16px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background-image:none}[data-kentico-pop-up-listing-host] [class^=icon-][data-kentico-pop-up-listing]:before{content:\"\\e619\"}[data-kentico-pop-up-listing-host] .ktc-icon-only[data-kentico-pop-up-listing]:before{content:none}[data-kentico-pop-up-listing-host] .icon-arrow-right-top-square[data-kentico-pop-up-listing]:before{content:\"\\e6d8\"}[data-kentico-pop-up-listing-host] .icon-brand-mstranslator[data-kentico-pop-up-listing]:before{content:\"\\e90c\"}[data-kentico-pop-up-listing-host] .icon-brand-google[data-kentico-pop-up-listing]:before{content:\"\\e6c8\"}[data-kentico-pop-up-listing-host] .icon-brand-google-plus[data-kentico-pop-up-listing]:before{content:\"\\e6e6\"}[data-kentico-pop-up-listing-host] .icon-piechart[data-kentico-pop-up-listing]:before{content:\"\\e631\"}[data-kentico-pop-up-listing-host] .icon-arrow-curved-left[data-kentico-pop-up-listing]:before{content:\"\\e908\"}[data-kentico-pop-up-listing-host] .icon-arrow-curved-right[data-kentico-pop-up-listing]:before{content:\"\\e909\"}[data-kentico-pop-up-listing-host] .icon-two-rectangles-stacked[data-kentico-pop-up-listing]:before{content:\"\\e90b\"}[data-kentico-pop-up-listing-host] .icon-rb-check[data-kentico-pop-up-listing]:before{content:\"\\e907\"}[data-kentico-pop-up-listing-host] .icon-octothorpe[data-kentico-pop-up-listing]:before{content:\"\\e904\"}[data-kentico-pop-up-listing-host] .icon-paragraph[data-kentico-pop-up-listing]:before{content:\"\\e905\"}[data-kentico-pop-up-listing-host] .icon-paragraph-short[data-kentico-pop-up-listing]:before{content:\"\\e906\"}[data-kentico-pop-up-listing-host] .icon-brand-instagram[data-kentico-pop-up-listing]:before{content:\"\\e903\"}[data-kentico-pop-up-listing-host] .icon-cb-check[data-kentico-pop-up-listing]:before{content:\"\\e902\"}[data-kentico-pop-up-listing-host] .icon-arrow-leave-square[data-kentico-pop-up-listing]:before{content:\"\\e800\"}[data-kentico-pop-up-listing-host] .icon-arrow-enter-square[data-kentico-pop-up-listing]:before{content:\"\\e801\"}[data-kentico-pop-up-listing-host] .icon-scheme-connected-circles[data-kentico-pop-up-listing]:before{content:\"\\e802\"}[data-kentico-pop-up-listing-host] .icon-scheme-path-circles[data-kentico-pop-up-listing]:before{content:\"\\e803\"}[data-kentico-pop-up-listing-host] .icon-dots-vertical[data-kentico-pop-up-listing]:before{content:\"\\e75d\"}[data-kentico-pop-up-listing-host] .icon-chain[data-kentico-pop-up-listing]:before{content:\"\\e67f\"}[data-kentico-pop-up-listing-host] .icon-chain-slash[data-kentico-pop-up-listing]:before{content:\"\\e691\"}[data-kentico-pop-up-listing-host] .icon-list-bullets[data-kentico-pop-up-listing]:before{content:\"\\e754\"}[data-kentico-pop-up-listing-host] .icon-list-numbers[data-kentico-pop-up-listing]:before{content:\"\\e75b\"}[data-kentico-pop-up-listing-host] .icon-eye-slash[data-kentico-pop-up-listing]:before{content:\"\\e75c\"}[data-kentico-pop-up-listing-host] .icon-arrow-u-right[data-kentico-pop-up-listing]:before{content:\"\\e703\"}[data-kentico-pop-up-listing-host] .icon-arrow-u-left[data-kentico-pop-up-listing]:before{content:\"\\e677\"}[data-kentico-pop-up-listing-host] .icon-arrow-down[data-kentico-pop-up-listing]:before{content:\"\\e682\"}[data-kentico-pop-up-listing-host] .icon-arrow-up[data-kentico-pop-up-listing]:before{content:\"\\e64c\"}[data-kentico-pop-up-listing-host] .icon-arrow-left[data-kentico-pop-up-listing]:before{content:\"\\e6dc\"}[data-kentico-pop-up-listing-host] .icon-arrow-right[data-kentico-pop-up-listing]:before{content:\"\\e6da\"}[data-kentico-pop-up-listing-host] .icon-arrow-down-circle[data-kentico-pop-up-listing]:before{content:\"\\e6ae\"}[data-kentico-pop-up-listing-host] .icon-arrow-left-circle[data-kentico-pop-up-listing]:before{content:\"\\e6af\"}[data-kentico-pop-up-listing-host] .icon-arrow-right-circle[data-kentico-pop-up-listing]:before{content:\"\\e6b1\"}[data-kentico-pop-up-listing-host] .icon-arrow-up-circle[data-kentico-pop-up-listing]:before{content:\"\\e6bf\"}[data-kentico-pop-up-listing-host] .icon-arrow-left-rect[data-kentico-pop-up-listing]:before{content:\"\\e6db\"}[data-kentico-pop-up-listing-host] .icon-arrow-right-rect[data-kentico-pop-up-listing]:before{content:\"\\e6d9\"}[data-kentico-pop-up-listing-host] .icon-arrow-crooked-left[data-kentico-pop-up-listing]:before{content:\"\\e6e0\"}[data-kentico-pop-up-listing-host] .icon-arrow-crooked-right[data-kentico-pop-up-listing]:before{content:\"\\e6e1\"}[data-kentico-pop-up-listing-host] .icon-arrow-double-left[data-kentico-pop-up-listing]:before{content:\"\\e6df\"}[data-kentico-pop-up-listing-host] .icon-arrow-double-right[data-kentico-pop-up-listing]:before{content:\"\\e6de\"}[data-kentico-pop-up-listing-host] .icon-arrow-down-line[data-kentico-pop-up-listing]:before{content:\"\\e6dd\"}[data-kentico-pop-up-listing-host] .icon-arrow-up-line[data-kentico-pop-up-listing]:before{content:\"\\e6d3\"}[data-kentico-pop-up-listing-host] .icon-arrows[data-kentico-pop-up-listing]:before{content:\"\\e6d7\"}[data-kentico-pop-up-listing-host] .icon-arrows-h[data-kentico-pop-up-listing]:before{content:\"\\e6d5\"}[data-kentico-pop-up-listing-host] .icon-arrows-v[data-kentico-pop-up-listing]:before{content:\"\\e6d4\"}[data-kentico-pop-up-listing-host] .icon-magnifier[data-kentico-pop-up-listing]:before{content:\"\\e657\"}[data-kentico-pop-up-listing-host] .icon-magnifier-minus[data-kentico-pop-up-listing]:before{content:\"\\e656\"}[data-kentico-pop-up-listing-host] .icon-magnifier-plus[data-kentico-pop-up-listing]:before{content:\"\\e655\"}[data-kentico-pop-up-listing-host] .icon-minus[data-kentico-pop-up-listing]:before{content:\"\\e73f\"}[data-kentico-pop-up-listing-host] .icon-loop[data-kentico-pop-up-listing]:before{content:\"\\e600\"}[data-kentico-pop-up-listing-host] .icon-merge[data-kentico-pop-up-listing]:before{content:\"\\e709\"}[data-kentico-pop-up-listing-host] .icon-separate[data-kentico-pop-up-listing]:before{content:\"\\e70a\"}[data-kentico-pop-up-listing-host] .icon-scheme-circles-triangle[data-kentico-pop-up-listing]:before{content:\"\\e73e\"}[data-kentico-pop-up-listing-host] .icon-market[data-kentico-pop-up-listing]:before{content:\"\\e68e\"}[data-kentico-pop-up-listing-host] .icon-bubble-o[data-kentico-pop-up-listing]:before{content:\"\\e6f3\"}[data-kentico-pop-up-listing-host] .icon-bubble-times[data-kentico-pop-up-listing]:before{content:\"\\e6f2\"}[data-kentico-pop-up-listing-host] .icon-clapperboard[data-kentico-pop-up-listing]:before{content:\"\\e636\"}[data-kentico-pop-up-listing-host] .icon-collapse[data-kentico-pop-up-listing]:before{content:\"\\e745\"}[data-kentico-pop-up-listing-host] .icon-collapse-scheme[data-kentico-pop-up-listing]:before{content:\"\\e700\"}[data-kentico-pop-up-listing-host] .icon-dialog-window[data-kentico-pop-up-listing]:before{content:\"\\e6ff\"}[data-kentico-pop-up-listing-host] .icon-dialog-window-cogwheel[data-kentico-pop-up-listing]:before{content:\"\\e71a\"}[data-kentico-pop-up-listing-host] .icon-doc-ban-sign[data-kentico-pop-up-listing]:before{content:\"\\e6ef\"}[data-kentico-pop-up-listing-host] .icon-doc-o[data-kentico-pop-up-listing]:before{content:\"\\e69c\"}[data-kentico-pop-up-listing-host] .icon-doc-user[data-kentico-pop-up-listing]:before{content:\"\\e714\"}[data-kentico-pop-up-listing-host] .icon-expand[data-kentico-pop-up-listing]:before{content:\"\\e744\"}[data-kentico-pop-up-listing-host] .icon-file[data-kentico-pop-up-listing]:before{content:\"\\e719\"}[data-kentico-pop-up-listing-host] .icon-folder-belt[data-kentico-pop-up-listing]:before{content:\"\\e715\"}[data-kentico-pop-up-listing-host] .icon-folder-o[data-kentico-pop-up-listing]:before{content:\"\\e68b\"}[data-kentico-pop-up-listing-host] .icon-hat-moustache[data-kentico-pop-up-listing]:before{content:\"\\e75a\"}[data-kentico-pop-up-listing-host] .icon-key[data-kentico-pop-up-listing]:before{content:\"\\e65e\"}[data-kentico-pop-up-listing-host] .icon-rectangle-a[data-kentico-pop-up-listing]:before{content:\"\\e61e\"}[data-kentico-pop-up-listing-host] .icon-rectangle-a-o[data-kentico-pop-up-listing]:before{content:\"\\e623\"}[data-kentico-pop-up-listing-host] .icon-rectangle-o-h[data-kentico-pop-up-listing]:before{content:\"\\e758\"}[data-kentico-pop-up-listing-host] .icon-rectangle-o-v[data-kentico-pop-up-listing]:before{content:\"\\e759\"}[data-kentico-pop-up-listing-host] .icon-rectangle-paragraph[data-kentico-pop-up-listing]:before{content:\"\\e625\"}[data-kentico-pop-up-listing-host] .icon-tab[data-kentico-pop-up-listing]:before{content:\"\\e6fb\"}[data-kentico-pop-up-listing-host] .icon-graduate-cap[data-kentico-pop-up-listing]:before{content:\"\\e713\"}[data-kentico-pop-up-listing-host] .icon-clipboard-list[data-kentico-pop-up-listing]:before{content:\"\\e6a9\"}[data-kentico-pop-up-listing-host] .icon-user-checkbox[data-kentico-pop-up-listing]:before{content:\"\\e603\"}[data-kentico-pop-up-listing-host] .icon-box-cart[data-kentico-pop-up-listing]:before{content:\"\\e6cd\"}[data-kentico-pop-up-listing-host] .icon-bubble-censored[data-kentico-pop-up-listing]:before{content:\"\\e6c2\"}[data-kentico-pop-up-listing-host] .icon-drawers[data-kentico-pop-up-listing]:before{content:\"\\e699\"}[data-kentico-pop-up-listing-host] .icon-earth[data-kentico-pop-up-listing]:before{content:\"\\e698\"}[data-kentico-pop-up-listing-host] .icon-form[data-kentico-pop-up-listing]:before{content:\"\\e689\"}[data-kentico-pop-up-listing-host] .icon-invoice[data-kentico-pop-up-listing]:before{content:\"\\e660\"}[data-kentico-pop-up-listing-host] .icon-mug[data-kentico-pop-up-listing]:before{content:\"\\e644\"}[data-kentico-pop-up-listing-host] .icon-square-dashed-line[data-kentico-pop-up-listing]:before{content:\"\\e617\"}[data-kentico-pop-up-listing-host] .icon-briefcase[data-kentico-pop-up-listing]:before{content:\"\\e6c6\"}[data-kentico-pop-up-listing-host] .icon-funnel[data-kentico-pop-up-listing]:before{content:\"\\e687\"}[data-kentico-pop-up-listing-host] .icon-map[data-kentico-pop-up-listing]:before{content:\"\\e654\"}[data-kentico-pop-up-listing-host] .icon-notebook[data-kentico-pop-up-listing]:before{content:\"\\e642\"}[data-kentico-pop-up-listing-host] .icon-user-frame[data-kentico-pop-up-listing]:before{content:\"\\e604\"}[data-kentico-pop-up-listing-host] .icon-clipboard-checklist[data-kentico-pop-up-listing]:before{content:\"\\e6aa\"}[data-kentico-pop-up-listing-host] .icon-pictures[data-kentico-pop-up-listing]:before{content:\"\\e632\"}[data-kentico-pop-up-listing-host] .icon-flag[data-kentico-pop-up-listing]:before{content:\"\\e68f\"}[data-kentico-pop-up-listing-host] .icon-folder[data-kentico-pop-up-listing]:before{content:\"\\e68d\"}[data-kentico-pop-up-listing-host] .icon-folder-opened[data-kentico-pop-up-listing]:before{content:\"\\e68a\"}[data-kentico-pop-up-listing-host] .icon-picture[data-kentico-pop-up-listing]:before{content:\"\\e633\"}[data-kentico-pop-up-listing-host] .icon-bin[data-kentico-pop-up-listing]:before{content:\"\\e6d0\"}[data-kentico-pop-up-listing-host] .icon-bubble[data-kentico-pop-up-listing]:before{content:\"\\e6c3\"}[data-kentico-pop-up-listing-host] .icon-doc[data-kentico-pop-up-listing]:before{content:\"\\e69f\"}[data-kentico-pop-up-listing-host] .icon-doc-move[data-kentico-pop-up-listing]:before{content:\"\\e69d\"}[data-kentico-pop-up-listing-host] .icon-edit[data-kentico-pop-up-listing]:before{content:\"\\e696\"}[data-kentico-pop-up-listing-host] .icon-menu[data-kentico-pop-up-listing]:before{content:\"\\e650\"}[data-kentico-pop-up-listing-host] .icon-message[data-kentico-pop-up-listing]:before{content:\"\\e64f\"}[data-kentico-pop-up-listing-host] .icon-user[data-kentico-pop-up-listing]:before{content:\"\\e605\"}[data-kentico-pop-up-listing-host] .icon-monitor-broken[data-kentico-pop-up-listing]:before{content:\"\\e70b\"}[data-kentico-pop-up-listing-host] .icon-monitor[data-kentico-pop-up-listing]:before{content:\"\\e646\"}[data-kentico-pop-up-listing-host] .icon-chevron-down-line[data-kentico-pop-up-listing]:before{content:\"\\e6c0\"}[data-kentico-pop-up-listing-host] .icon-chevron-left-line[data-kentico-pop-up-listing]:before{content:\"\\e6d6\"}[data-kentico-pop-up-listing-host] .icon-chevron-right-line[data-kentico-pop-up-listing]:before{content:\"\\e6e2\"}[data-kentico-pop-up-listing-host] .icon-chevron-up-line[data-kentico-pop-up-listing]:before{content:\"\\e6ee\"}[data-kentico-pop-up-listing-host] .icon-pin-o[data-kentico-pop-up-listing]:before{content:\"\\e705\"}[data-kentico-pop-up-listing-host] .icon-brand-sharepoint[data-kentico-pop-up-listing]:before{content:\"\\e707\"}[data-kentico-pop-up-listing-host] .icon-heartshake[data-kentico-pop-up-listing]:before{content:\"\\e681\"}[data-kentico-pop-up-listing-host] .icon-pin[data-kentico-pop-up-listing]:before{content:\"\\e71e\"}[data-kentico-pop-up-listing-host] .icon-checklist[data-kentico-pop-up-listing]:before{content:\"\\e61b\"}[data-kentico-pop-up-listing-host] .icon-watch[data-kentico-pop-up-listing]:before{content:\"\\e601\"}[data-kentico-pop-up-listing-host] .icon-permission-list[data-kentico-pop-up-listing]:before{content:\"\\e634\"}[data-kentico-pop-up-listing-host] .icon-users[data-kentico-pop-up-listing]:before{content:\"\\e602\"}[data-kentico-pop-up-listing-host] .icon-brand-youtube[data-kentico-pop-up-listing]:before{content:\"\\e659\"}[data-kentico-pop-up-listing-host] .icon-brand-pinterest[data-kentico-pop-up-listing]:before{content:\"\\e6e3\"}[data-kentico-pop-up-listing-host] .icon-brand-open-id[data-kentico-pop-up-listing]:before{content:\"\\e6e4\"}[data-kentico-pop-up-listing-host] .icon-two-rectangles-v[data-kentico-pop-up-listing]:before{content:\"\\e606\"}[data-kentico-pop-up-listing-host] .icon-brand-linkedin[data-kentico-pop-up-listing]:before{content:\"\\e6e5\"}[data-kentico-pop-up-listing-host] .icon-two-rectangles-h[data-kentico-pop-up-listing]:before{content:\"\\e607\"}[data-kentico-pop-up-listing-host] .icon-t-shirt[data-kentico-pop-up-listing]:before{content:\"\\e608\"}[data-kentico-pop-up-listing-host] .icon-xml-tag[data-kentico-pop-up-listing]:before{content:\"\\e6e7\"}[data-kentico-pop-up-listing-host] .icon-truck[data-kentico-pop-up-listing]:before{content:\"\\e609\"}[data-kentico-pop-up-listing-host] .icon-trophy[data-kentico-pop-up-listing]:before{content:\"\\e60a\"}[data-kentico-pop-up-listing-host] .icon-rss[data-kentico-pop-up-listing]:before{content:\"\\e6e9\"}[data-kentico-pop-up-listing-host] .icon-triangle-right[data-kentico-pop-up-listing]:before{content:\"\\e60b\"}[data-kentico-pop-up-listing-host] .icon-restriction-list[data-kentico-pop-up-listing]:before{content:\"\\e6ea\"}[data-kentico-pop-up-listing-host] .icon-translate[data-kentico-pop-up-listing]:before{content:\"\\e60c\"}[data-kentico-pop-up-listing-host] .icon-qr-code[data-kentico-pop-up-listing]:before{content:\"\\e6eb\"}[data-kentico-pop-up-listing-host] .icon-times-circle[data-kentico-pop-up-listing]:before{content:\"\\e60d\"}[data-kentico-pop-up-listing-host] .icon-lock-unlocked[data-kentico-pop-up-listing]:before{content:\"\\e6ec\"}[data-kentico-pop-up-listing-host] .icon-times[data-kentico-pop-up-listing]:before{content:\"\\e60e\"}[data-kentico-pop-up-listing-host] .icon-dollar-sign[data-kentico-pop-up-listing]:before{content:\"\\e6ed\"}[data-kentico-pop-up-listing-host] .icon-tag[data-kentico-pop-up-listing]:before{content:\"\\e60f\"}[data-kentico-pop-up-listing-host] .icon-tablet[data-kentico-pop-up-listing]:before{content:\"\\e610\"}[data-kentico-pop-up-listing-host] .icon-cb-check-disabled[data-kentico-pop-up-listing]:before{content:\"\\e6f0\"}[data-kentico-pop-up-listing-host] .icon-table[data-kentico-pop-up-listing]:before{content:\"\\e612\"}[data-kentico-pop-up-listing-host] .icon-carousel[data-kentico-pop-up-listing]:before{content:\"\\e6f1\"}[data-kentico-pop-up-listing-host] .icon-star-full[data-kentico-pop-up-listing]:before{content:\"\\e614\"}[data-kentico-pop-up-listing-host] .icon-star-semi[data-kentico-pop-up-listing]:before{content:\"\\e613\"}[data-kentico-pop-up-listing-host] .icon-star-empty[data-kentico-pop-up-listing]:before{content:\"\\e615\"}[data-kentico-pop-up-listing-host] .icon-arrows-crooked[data-kentico-pop-up-listing]:before{content:\"\\e6f4\"}[data-kentico-pop-up-listing-host] .icon-staging-scheme[data-kentico-pop-up-listing]:before{content:\"\\e616\"}[data-kentico-pop-up-listing-host] .icon-shopping-cart[data-kentico-pop-up-listing]:before{content:\"\\e6f5\"}[data-kentico-pop-up-listing-host] .icon-highlighter[data-kentico-pop-up-listing]:before{content:\"\\e6f6\"}[data-kentico-pop-up-listing-host] .icon-square-dashed[data-kentico-pop-up-listing]:before{content:\"\\e618\"}[data-kentico-pop-up-listing-host] .icon-cookie[data-kentico-pop-up-listing]:before{content:\"\\e6f7\"}[data-kentico-pop-up-listing-host] .icon-square[data-kentico-pop-up-listing]:before{content:\"\\e619\"}[data-kentico-pop-up-listing-host] .icon-software-package[data-kentico-pop-up-listing]:before{content:\"\\e61c\"}[data-kentico-pop-up-listing-host] .icon-smartphone[data-kentico-pop-up-listing]:before{content:\"\\e61d\"}[data-kentico-pop-up-listing-host] .icon-scissors[data-kentico-pop-up-listing]:before{content:\"\\e61f\"}[data-kentico-pop-up-listing-host] .icon-rotate-right[data-kentico-pop-up-listing]:before{content:\"\\e620\"}[data-kentico-pop-up-listing-host] .icon-rotate-left[data-kentico-pop-up-listing]:before{content:\"\\e621\"}[data-kentico-pop-up-listing-host] .icon-rotate-double-right[data-kentico-pop-up-listing]:before{content:\"\\e622\"}[data-kentico-pop-up-listing-host] .icon-ribbon[data-kentico-pop-up-listing]:before{content:\"\\e624\"}[data-kentico-pop-up-listing-host] .icon-rb-uncheck[data-kentico-pop-up-listing]:before{content:\"\\e626\"}[data-kentico-pop-up-listing-host] .icon-rb-check-sign[data-kentico-pop-up-listing]:before{content:\"\\e627\"}[data-kentico-pop-up-listing-host] .icon-question-circle[data-kentico-pop-up-listing]:before{content:\"\\e629\"}[data-kentico-pop-up-listing-host] .icon-project-scheme[data-kentico-pop-up-listing]:before{content:\"\\e62b\"}[data-kentico-pop-up-listing-host] .icon-process-scheme[data-kentico-pop-up-listing]:before{content:\"\\e62c\"}[data-kentico-pop-up-listing-host] .icon-plus-square[data-kentico-pop-up-listing]:before{content:\"\\e62d\"}[data-kentico-pop-up-listing-host] .icon-plus-circle[data-kentico-pop-up-listing]:before{content:\"\\e62e\"}[data-kentico-pop-up-listing-host] .icon-plus[data-kentico-pop-up-listing]:before{content:\"\\e62f\"}[data-kentico-pop-up-listing-host] .icon-placeholder[data-kentico-pop-up-listing]:before{content:\"\\e630\"}[data-kentico-pop-up-listing-host] .icon-perfume[data-kentico-pop-up-listing]:before{content:\"\\e635\"}[data-kentico-pop-up-listing-host] .icon-percent-sign[data-kentico-pop-up-listing]:before{content:\"\\e638\"}[data-kentico-pop-up-listing-host] .icon-pda[data-kentico-pop-up-listing]:before{content:\"\\e639\"}[data-kentico-pop-up-listing-host] .icon-pc[data-kentico-pop-up-listing]:before{content:\"\\e63a\"}[data-kentico-pop-up-listing-host] .icon-pause[data-kentico-pop-up-listing]:before{content:\"\\e63b\"}[data-kentico-pop-up-listing-host] .icon-parent-children-scheme[data-kentico-pop-up-listing]:before{content:\"\\e63c\"}[data-kentico-pop-up-listing-host] .icon-paperclip[data-kentico-pop-up-listing]:before{content:\"\\e63d\"}[data-kentico-pop-up-listing-host] .icon-pants[data-kentico-pop-up-listing]:before{content:\"\\e63e\"}[data-kentico-pop-up-listing-host] .icon-palette[data-kentico-pop-up-listing]:before{content:\"\\e63f\"}[data-kentico-pop-up-listing-host] .icon-organisational-scheme[data-kentico-pop-up-listing]:before{content:\"\\e640\"}[data-kentico-pop-up-listing-host] .icon-newspaper[data-kentico-pop-up-listing]:before{content:\"\\e643\"}[data-kentico-pop-up-listing-host] .icon-monitor-smartphone[data-kentico-pop-up-listing]:before{content:\"\\e645\"}[data-kentico-pop-up-listing-host] .icon-modal-question[data-kentico-pop-up-listing]:before{content:\"\\e647\"}[data-kentico-pop-up-listing-host] .icon-modal-minimize[data-kentico-pop-up-listing]:before{content:\"\\e648\"}[data-kentico-pop-up-listing-host] .icon-modal-maximize[data-kentico-pop-up-listing]:before{content:\"\\e649\"}[data-kentico-pop-up-listing-host] .icon-modal-close[data-kentico-pop-up-listing]:before{content:\"\\e64a\"}[data-kentico-pop-up-listing-host] .icon-minus-circle[data-kentico-pop-up-listing]:before{content:\"\\e64b\"}[data-kentico-pop-up-listing-host] .icon-microphone[data-kentico-pop-up-listing]:before{content:\"\\e64d\"}[data-kentico-pop-up-listing-host] .icon-messages[data-kentico-pop-up-listing]:before{content:\"\\e64e\"}[data-kentico-pop-up-listing-host] .icon-media-player[data-kentico-pop-up-listing]:before{content:\"\\e651\"}[data-kentico-pop-up-listing-host] .icon-mask[data-kentico-pop-up-listing]:before{content:\"\\e652\"}[data-kentico-pop-up-listing-host] .icon-map-marker[data-kentico-pop-up-listing]:before{content:\"\\e653\"}[data-kentico-pop-up-listing-host] .icon-lock[data-kentico-pop-up-listing]:before{content:\"\\e658\"}[data-kentico-pop-up-listing-host] .icon-life-belt[data-kentico-pop-up-listing]:before{content:\"\\e65a\"}[data-kentico-pop-up-listing-host] .icon-laptop[data-kentico-pop-up-listing]:before{content:\"\\e65d\"}[data-kentico-pop-up-listing-host] .icon-kentico[data-kentico-pop-up-listing]:before{content:\"\\e65f\"}[data-kentico-pop-up-listing-host] .icon-integration-scheme[data-kentico-pop-up-listing]:before{content:\"\\e661\"}[data-kentico-pop-up-listing-host] .icon-i-circle[data-kentico-pop-up-listing]:before{content:\"\\e664\"}[data-kentico-pop-up-listing-host] .icon-chevron-up-square[data-kentico-pop-up-listing]:before{content:\"\\e665\"}[data-kentico-pop-up-listing-host] .icon-chevron-up-circle[data-kentico-pop-up-listing]:before{content:\"\\e666\"}[data-kentico-pop-up-listing-host] .icon-chevron-up[data-kentico-pop-up-listing]:before{content:\"\\e667\"}[data-kentico-pop-up-listing-host] .icon-chevron-right-square[data-kentico-pop-up-listing]:before{content:\"\\e668\"}[data-kentico-pop-up-listing-host] .icon-chevron-right[data-kentico-pop-up-listing]:before{content:\"\\e669\"}[data-kentico-pop-up-listing-host] .icon-chevron-left-square[data-kentico-pop-up-listing]:before{content:\"\\e66a\"}[data-kentico-pop-up-listing-host] .icon-chevron-left-circle[data-kentico-pop-up-listing]:before{content:\"\\e66b\"}[data-kentico-pop-up-listing-host] .icon-chevron-left[data-kentico-pop-up-listing]:before{content:\"\\e66c\"}[data-kentico-pop-up-listing-host] .icon-chevron-down-square[data-kentico-pop-up-listing]:before{content:\"\\e66d\"}[data-kentico-pop-up-listing-host] .icon-chevron-down-circle[data-kentico-pop-up-listing]:before{content:\"\\e66e\"}[data-kentico-pop-up-listing-host] .icon-chevron-down[data-kentico-pop-up-listing]:before{content:\"\\e66f\"}[data-kentico-pop-up-listing-host] .icon-chevron-double-up[data-kentico-pop-up-listing]:before{content:\"\\e670\"}[data-kentico-pop-up-listing-host] .icon-chevron-double-right[data-kentico-pop-up-listing]:before{content:\"\\e671\"}[data-kentico-pop-up-listing-host] .icon-chevron-double-left[data-kentico-pop-up-listing]:before{content:\"\\e672\"}[data-kentico-pop-up-listing-host] .icon-chevron-double-down[data-kentico-pop-up-listing]:before{content:\"\\e673\"}[data-kentico-pop-up-listing-host] .icon-checklist2[data-kentico-pop-up-listing]:before{content:\"\\e674\"}[data-kentico-pop-up-listing-host] .icon-check-circle[data-kentico-pop-up-listing]:before{content:\"\\e675\"}[data-kentico-pop-up-listing-host] .icon-check[data-kentico-pop-up-listing]:before{content:\"\\e676\"}[data-kentico-pop-up-listing-host] .icon-tags[data-kentico-pop-up-listing]:before{content:\"\\e678\"}[data-kentico-pop-up-listing-host] .icon-shoe-women[data-kentico-pop-up-listing]:before{content:\"\\e679\"}[data-kentico-pop-up-listing-host] .icon-printer[data-kentico-pop-up-listing]:before{content:\"\\e67a\"}[data-kentico-pop-up-listing-host] .icon-parent-child-scheme[data-kentico-pop-up-listing]:before{content:\"\\e67b\"}[data-kentico-pop-up-listing-host] .icon-minus-square[data-kentico-pop-up-listing]:before{content:\"\\e67c\"}[data-kentico-pop-up-listing-host] .icon-light-bulb[data-kentico-pop-up-listing]:before{content:\"\\e67d\"}[data-kentico-pop-up-listing-host] .icon-chevron-right-circle[data-kentico-pop-up-listing]:before{content:\"\\e67e\"}[data-kentico-pop-up-listing-host] .icon-home[data-kentico-pop-up-listing]:before{content:\"\\e680\"}[data-kentico-pop-up-listing-host] .icon-half-arrows-right-left[data-kentico-pop-up-listing]:before{content:\"\\e683\"}[data-kentico-pop-up-listing-host] .icon-graph[data-kentico-pop-up-listing]:before{content:\"\\e684\"}[data-kentico-pop-up-listing-host] .icon-factory[data-kentico-pop-up-listing]:before{content:\"\\e690\"}[data-kentico-pop-up-listing-host] .icon-exclamation-triangle[data-kentico-pop-up-listing]:before{content:\"\\e693\"}[data-kentico-pop-up-listing-host] .icon-ellipsis[data-kentico-pop-up-listing]:before{content:\"\\e694\"}[data-kentico-pop-up-listing-host] .icon-ekg-line[data-kentico-pop-up-listing]:before{content:\"\\e695\"}[data-kentico-pop-up-listing-host] .icon-doc-paste[data-kentico-pop-up-listing]:before{content:\"\\e69a\"}[data-kentico-pop-up-listing-host] .icon-doc-copy[data-kentico-pop-up-listing]:before{content:\"\\e69e\"}[data-kentico-pop-up-listing-host] .icon-database[data-kentico-pop-up-listing]:before{content:\"\\e6a0\"}[data-kentico-pop-up-listing-host] .icon-cup[data-kentico-pop-up-listing]:before{content:\"\\e6a2\"}[data-kentico-pop-up-listing-host] .icon-compass[data-kentico-pop-up-listing]:before{content:\"\\e6a4\"}[data-kentico-pop-up-listing-host] .icon-cogwheel-square[data-kentico-pop-up-listing]:before{content:\"\\e6a5\"}[data-kentico-pop-up-listing-host] .icon-cogwheels[data-kentico-pop-up-listing]:before{content:\"\\e6a6\"}[data-kentico-pop-up-listing-host] .icon-cogwheel[data-kentico-pop-up-listing]:before{content:\"\\e6a7\"}[data-kentico-pop-up-listing-host] .icon-circle-square[data-kentico-pop-up-listing]:before{content:\"\\e6ab\"}[data-kentico-pop-up-listing-host] .icon-circle[data-kentico-pop-up-listing]:before{content:\"\\e6ac\"}[data-kentico-pop-up-listing-host] .icon-cb-uncheck[data-kentico-pop-up-listing]:before{content:\"\\e6ad\"}[data-kentico-pop-up-listing-host] .icon-cb-check-sign[data-kentico-pop-up-listing]:before{content:\"\\e6b0\"}[data-kentico-pop-up-listing-host] .icon-caret-up[data-kentico-pop-up-listing]:before{content:\"\\e6b2\"}[data-kentico-pop-up-listing-host] .icon-caret-right-down[data-kentico-pop-up-listing]:before{content:\"\\e6b3\"}[data-kentico-pop-up-listing-host] .icon-caret-right[data-kentico-pop-up-listing]:before{content:\"\\e6b4\"}[data-kentico-pop-up-listing-host] .icon-caret-left[data-kentico-pop-up-listing]:before{content:\"\\e6b5\"}[data-kentico-pop-up-listing-host] .icon-caret-down[data-kentico-pop-up-listing]:before{content:\"\\e6b6\"}[data-kentico-pop-up-listing-host] .icon-camera[data-kentico-pop-up-listing]:before{content:\"\\e6b7\"}[data-kentico-pop-up-listing-host] .icon-calendar-number[data-kentico-pop-up-listing]:before{content:\"\\e6b8\"}[data-kentico-pop-up-listing-host] .icon-calendar[data-kentico-pop-up-listing]:before{content:\"\\e6b9\"}[data-kentico-pop-up-listing-host] .icon-bullseye[data-kentico-pop-up-listing]:before{content:\"\\e6ba\"}[data-kentico-pop-up-listing-host] .icon-building-block[data-kentico-pop-up-listing]:before{content:\"\\e6bb\"}[data-kentico-pop-up-listing-host] .icon-building[data-kentico-pop-up-listing]:before{content:\"\\e6bc\"}[data-kentico-pop-up-listing-host] .icon-bug[data-kentico-pop-up-listing]:before{content:\"\\e6bd\"}[data-kentico-pop-up-listing-host] .icon-bucket-shovel[data-kentico-pop-up-listing]:before{content:\"\\e6be\"}[data-kentico-pop-up-listing-host] .icon-bubbles[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-brush[data-kentico-pop-up-listing]:before{content:\"\\e6c4\"}[data-kentico-pop-up-listing-host] .icon-broom[data-kentico-pop-up-listing]:before{content:\"\\e6c5\"}[data-kentico-pop-up-listing-host] .icon-brand-twitter[data-kentico-pop-up-listing]:before{content:\"\\e6c7\"}[data-kentico-pop-up-listing-host] .icon-brand-facebook[data-kentico-pop-up-listing]:before{content:\"\\e6c9\"}[data-kentico-pop-up-listing-host] .icon-brand-bing[data-kentico-pop-up-listing]:before{content:\"\\e6ca\"}[data-kentico-pop-up-listing-host] .icon-braces[data-kentico-pop-up-listing]:before{content:\"\\e6cb\"}[data-kentico-pop-up-listing-host] .icon-boxes[data-kentico-pop-up-listing]:before{content:\"\\e6cc\"}[data-kentico-pop-up-listing-host] .icon-box[data-kentico-pop-up-listing]:before{content:\"\\e6ce\"}[data-kentico-pop-up-listing-host] .icon-ban-sign[data-kentico-pop-up-listing]:before{content:\"\\e6d1\"}[data-kentico-pop-up-listing-host] .icon-badge[data-kentico-pop-up-listing]:before{content:\"\\e6d2\"}[data-kentico-pop-up-listing-host] .icon-breadcrumb[data-kentico-pop-up-listing]:before{content:\"\\e6f9\"}[data-kentico-pop-up-listing-host] .icon-clock[data-kentico-pop-up-listing]:before{content:\"\\e6a8\"}[data-kentico-pop-up-listing-host] .icon-cloud[data-kentico-pop-up-listing]:before{content:\"\\e701\"}[data-kentico-pop-up-listing-host] .icon-cb-check-preview[data-kentico-pop-up-listing]:before{content:\"\\e702\"}[data-kentico-pop-up-listing-host] .icon-accordion[data-kentico-pop-up-listing]:before{content:\"\\e704\"}[data-kentico-pop-up-listing-host] .icon-two-squares-line[data-kentico-pop-up-listing]:before{content:\"\\e706\"}[data-kentico-pop-up-listing-host] .icon-money-bill[data-kentico-pop-up-listing]:before{content:\"\\e708\"}[data-kentico-pop-up-listing-host] .icon-puzzle[data-kentico-pop-up-listing]:before{content:\"\\e62a\"}[data-kentico-pop-up-listing-host] .icon-wizard-stick[data-kentico-pop-up-listing]:before{content:\"\\e6fa\"}[data-kentico-pop-up-listing-host] .icon-lines-rectangle-o[data-kentico-pop-up-listing]:before{content:\"\\e6fd\"}[data-kentico-pop-up-listing-host] .icon-doc-arrows[data-kentico-pop-up-listing]:before{content:\"\\e6fe\"}[data-kentico-pop-up-listing-host] .icon-l-text-col[data-kentico-pop-up-listing]:before{content:\"\\e685\"}[data-kentico-pop-up-listing-host] .icon-l-menu-text-col[data-kentico-pop-up-listing]:before{content:\"\\e69b\"}[data-kentico-pop-up-listing-host] .icon-l-menu-cols-3[data-kentico-pop-up-listing]:before{content:\"\\e6e8\"}[data-kentico-pop-up-listing-host] .icon-l-logotype-menu-v-col[data-kentico-pop-up-listing]:before{content:\"\\e6fc\"}[data-kentico-pop-up-listing-host] .icon-l-logotype-menu-h-col[data-kentico-pop-up-listing]:before{content:\"\\e70c\"}[data-kentico-pop-up-listing-host] .icon-l-header-cols-3-footer[data-kentico-pop-up-listing]:before{content:\"\\e70d\"}[data-kentico-pop-up-listing-host] .icon-l-cols-80-20[data-kentico-pop-up-listing]:before{content:\"\\e70e\"}[data-kentico-pop-up-listing-host] .icon-l-cols-20-80[data-kentico-pop-up-listing]:before{content:\"\\e70f\"}[data-kentico-pop-up-listing-host] .icon-l-cols-4[data-kentico-pop-up-listing]:before{content:\"\\e710\"}[data-kentico-pop-up-listing-host] .icon-l-cols-3[data-kentico-pop-up-listing]:before{content:\"\\e711\"}[data-kentico-pop-up-listing-host] .icon-l-cols-2[data-kentico-pop-up-listing]:before{content:\"\\e712\"}[data-kentico-pop-up-listing-host] .icon-bezier-scheme[data-kentico-pop-up-listing]:before{content:\"\\e717\"}[data-kentico-pop-up-listing-host] .icon-note[data-kentico-pop-up-listing]:before{content:\"\\e71c\"}[data-kentico-pop-up-listing-host] .icon-piechart-lines[data-kentico-pop-up-listing]:before{content:\"\\e71d\"}[data-kentico-pop-up-listing-host] .icon-l-article-map[data-kentico-pop-up-listing]:before{content:\"\\e721\"}[data-kentico-pop-up-listing-host] .icon-l-calendar-number-article[data-kentico-pop-up-listing]:before{content:\"\\e722\"}[data-kentico-pop-up-listing-host] .icon-l-forms-2[data-kentico-pop-up-listing]:before{content:\"\\e723\"}[data-kentico-pop-up-listing-host] .icon-l-header-cols-2-footer[data-kentico-pop-up-listing]:before{content:\"\\e724\"}[data-kentico-pop-up-listing-host] .icon-l-header-list-img[data-kentico-pop-up-listing]:before{content:\"\\e725\"}[data-kentico-pop-up-listing-host] .icon-l-header-menu-text[data-kentico-pop-up-listing]:before{content:\"\\e726\"}[data-kentico-pop-up-listing-host] .icon-l-header-text[data-kentico-pop-up-listing]:before{content:\"\\e727\"}[data-kentico-pop-up-listing-host] .icon-l-list-article[data-kentico-pop-up-listing]:before{content:\"\\e728\"}[data-kentico-pop-up-listing-host] .icon-l-lightbox[data-kentico-pop-up-listing]:before{content:\"\\e729\"}[data-kentico-pop-up-listing-host] .icon-l-img-3-cols-3[data-kentico-pop-up-listing]:before{content:\"\\e72a\"}[data-kentico-pop-up-listing-host] .icon-l-img-2-cols-3[data-kentico-pop-up-listing]:before{content:\"\\e72b\"}[data-kentico-pop-up-listing-host] .icon-l-text[data-kentico-pop-up-listing]:before{content:\"\\e72c\"}[data-kentico-pop-up-listing-host] .icon-l-rows-4[data-kentico-pop-up-listing]:before{content:\"\\e72d\"}[data-kentico-pop-up-listing-host] .icon-l-rows-3[data-kentico-pop-up-listing]:before{content:\"\\e72e\"}[data-kentico-pop-up-listing-host] .icon-l-rows-2[data-kentico-pop-up-listing]:before{content:\"\\e72f\"}[data-kentico-pop-up-listing-host] .icon-l-menu-text-col-bottom[data-kentico-pop-up-listing]:before{content:\"\\e730\"}[data-kentico-pop-up-listing-host] .icon-l-menu-text[data-kentico-pop-up-listing]:before{content:\"\\e731\"}[data-kentico-pop-up-listing-host] .icon-l-menu-list-img-col[data-kentico-pop-up-listing]:before{content:\"\\e732\"}[data-kentico-pop-up-listing-host] .icon-l-menu-list-img[data-kentico-pop-up-listing]:before{content:\"\\e733\"}[data-kentico-pop-up-listing-host] .icon-l-menu-list[data-kentico-pop-up-listing]:before{content:\"\\e734\"}[data-kentico-pop-up-listing-host] .icon-l-menu-cols-2[data-kentico-pop-up-listing]:before{content:\"\\e735\"}[data-kentico-pop-up-listing-host] .icon-l-logotype-menu-col-footer[data-kentico-pop-up-listing]:before{content:\"\\e736\"}[data-kentico-pop-up-listing-host] .icon-l-list-title[data-kentico-pop-up-listing]:before{content:\"\\e737\"}[data-kentico-pop-up-listing-host] .icon-l-list-img-article[data-kentico-pop-up-listing]:before{content:\"\\e738\"}[data-kentico-pop-up-listing-host] .icon-l-list-article-col[data-kentico-pop-up-listing]:before{content:\"\\e739\"}[data-kentico-pop-up-listing-host] .icon-tree-structure[data-kentico-pop-up-listing]:before{content:\"\\e73a\"}[data-kentico-pop-up-listing-host] .icon-vb[data-kentico-pop-up-listing]:before{content:\"\\e716\"}[data-kentico-pop-up-listing-host] .icon-crosshair-o[data-kentico-pop-up-listing]:before{content:\"\\e71b\"}[data-kentico-pop-up-listing-host] .icon-crosshair-f[data-kentico-pop-up-listing]:before{content:\"\\e71f\"}[data-kentico-pop-up-listing-host] .icon-caret-right-aligned-left[data-kentico-pop-up-listing]:before{content:\"\\e720\"}[data-kentico-pop-up-listing-host] .icon-caret-left-aligned-right[data-kentico-pop-up-listing]:before{content:\"\\e73b\"}[data-kentico-pop-up-listing-host] .icon-gauge[data-kentico-pop-up-listing]:before{content:\"\\e686\"}[data-kentico-pop-up-listing-host] .icon-c-sharp[data-kentico-pop-up-listing]:before{content:\"\\e718\"}[data-kentico-pop-up-listing-host] .icon-tab-vertical[data-kentico-pop-up-listing]:before{content:\"\\e73c\"}[data-kentico-pop-up-listing-host] .icon-right-double-quotation-mark[data-kentico-pop-up-listing]:before{content:\"\\e73d\"}[data-kentico-pop-up-listing-host] .icon-braces-octothorpe[data-kentico-pop-up-listing]:before{content:\"\\e740\"}[data-kentico-pop-up-listing-host] .icon-outdent[data-kentico-pop-up-listing]:before{content:\"\\e741\"}[data-kentico-pop-up-listing-host] .icon-indent[data-kentico-pop-up-listing]:before{content:\"\\e742\"}[data-kentico-pop-up-listing-host] .icon-i[data-kentico-pop-up-listing]:before{content:\"\\e743\"}[data-kentico-pop-up-listing-host] .icon-b[data-kentico-pop-up-listing]:before{content:\"\\e746\"}[data-kentico-pop-up-listing-host] .icon-u[data-kentico-pop-up-listing]:before{content:\"\\e747\"}[data-kentico-pop-up-listing-host] .icon-s[data-kentico-pop-up-listing]:before{content:\"\\e748\"}[data-kentico-pop-up-listing-host] .icon-x[data-kentico-pop-up-listing]:before{content:\"\\e749\"}[data-kentico-pop-up-listing-host] .icon-t-f[data-kentico-pop-up-listing]:before{content:\"\\e74a\"}[data-kentico-pop-up-listing-host] .icon-t[data-kentico-pop-up-listing]:before{content:\"\\e74b\"}[data-kentico-pop-up-listing-host] .icon-parent-child-scheme-2[data-kentico-pop-up-listing]:before{content:\"\\e74c\"}[data-kentico-pop-up-listing-host] .icon-parent-child-scheme2[data-kentico-pop-up-listing]:before{content:\"\\e74d\"}[data-kentico-pop-up-listing-host] .icon-doc-torn[data-kentico-pop-up-listing]:before{content:\"\\e750\"}[data-kentico-pop-up-listing-host] .icon-f[data-kentico-pop-up-listing]:before{content:\"\\e74e\"}[data-kentico-pop-up-listing-host] .icon-a-lowercase[data-kentico-pop-up-listing]:before{content:\"\\e74f\"}[data-kentico-pop-up-listing-host] .icon-circle-slashed[data-kentico-pop-up-listing]:before{content:\"\\e751\"}[data-kentico-pop-up-listing-host] .icon-one[data-kentico-pop-up-listing]:before{content:\"\\e752\"}[data-kentico-pop-up-listing-host] .icon-diamond[data-kentico-pop-up-listing]:before{content:\"\\e756\"}[data-kentico-pop-up-listing-host] .icon-choice-user-scheme[data-kentico-pop-up-listing]:before{content:\"\\e753\"}[data-kentico-pop-up-listing-host] .icon-choice-single-scheme[data-kentico-pop-up-listing]:before{content:\"\\e755\"}[data-kentico-pop-up-listing-host] .icon-choice-multi-scheme[data-kentico-pop-up-listing]:before{content:\"\\e757\"}[data-kentico-pop-up-listing-host] .icon-book-opened[data-kentico-pop-up-listing]:before{content:\"\\e6cf\"}[data-kentico-pop-up-listing-host] .icon-e-book[data-kentico-pop-up-listing]:before{content:\"\\e697\"}[data-kentico-pop-up-listing-host] .icon-spinner[data-kentico-pop-up-listing]:before{content:\"\\e61a\"}[data-kentico-pop-up-listing-host] .icon-layouts[data-kentico-pop-up-listing]:before{content:\"\\e65b\"}[data-kentico-pop-up-listing-host] .icon-layout[data-kentico-pop-up-listing]:before{content:\"\\e65c\"}[data-kentico-pop-up-listing-host] .icon-id-card[data-kentico-pop-up-listing]:before{content:\"\\e663\"}[data-kentico-pop-up-listing-host] .icon-id-cards[data-kentico-pop-up-listing]:before{content:\"\\e662\"}[data-kentico-pop-up-listing-host] .icon-l-grid-3-2[data-kentico-pop-up-listing]:before{content:\"\\e611\"}[data-kentico-pop-up-listing-host] .icon-l-grid-2-2[data-kentico-pop-up-listing]:before{content:\"\\e628\"}[data-kentico-pop-up-listing-host] .icon-l-cols-70-30[data-kentico-pop-up-listing]:before{content:\"\\e637\"}[data-kentico-pop-up-listing-host] .icon-l-cols-30-70[data-kentico-pop-up-listing]:before{content:\"\\e641\"}[data-kentico-pop-up-listing-host] .icon-l-cols-25-50-25[data-kentico-pop-up-listing]:before{content:\"\\e688\"}[data-kentico-pop-up-listing-host] .icon-l-cols-20-60-20[data-kentico-pop-up-listing]:before{content:\"\\e6a1\"}[data-kentico-pop-up-listing-host] .icon-eye[data-kentico-pop-up-listing]:before{content:\"\\e692\"}[data-kentico-pop-up-listing-host] .icon-list[data-kentico-pop-up-listing]:before{content:\"\\e6f8\"}[data-kentico-pop-up-listing-host] .icon-folder-clock[data-kentico-pop-up-listing]:before{content:\"\\e68c\"}[data-kentico-pop-up-listing-host] .icon-app-default[data-kentico-pop-up-listing]:before{content:\"\\e618\"}[data-kentico-pop-up-listing-host] .icon-app-blogs[data-kentico-pop-up-listing]:before{content:\"\\e642\"}[data-kentico-pop-up-listing-host] .icon-app-content[data-kentico-pop-up-listing]:before{content:\"\\e6cf\"}[data-kentico-pop-up-listing-host] .icon-app-content-dashboard[data-kentico-pop-up-listing]:before{content:\"\\e686\"}[data-kentico-pop-up-listing-host] .icon-app-file-import[data-kentico-pop-up-listing]:before{content:\"\\e6db\"}[data-kentico-pop-up-listing-host] .icon-app-forms[data-kentico-pop-up-listing]:before{content:\"\\e689\"}[data-kentico-pop-up-listing-host] .icon-app-checked-out[data-kentico-pop-up-listing]:before{content:\"\\e6c6\"}[data-kentico-pop-up-listing-host] .icon-app-media[data-kentico-pop-up-listing]:before{content:\"\\e632\"}[data-kentico-pop-up-listing-host] .icon-app-my-blogs[data-kentico-pop-up-listing]:before{content:\"\\e642\"}[data-kentico-pop-up-listing-host] .icon-app-my-documents[data-kentico-pop-up-listing]:before{content:\"\\e6c6\"}[data-kentico-pop-up-listing-host] .icon-app-outdated[data-kentico-pop-up-listing]:before{content:\"\\e6c6\"}[data-kentico-pop-up-listing-host] .icon-app-pending[data-kentico-pop-up-listing]:before{content:\"\\e6c6\"}[data-kentico-pop-up-listing-host] .icon-app-polls[data-kentico-pop-up-listing]:before{content:\"\\e6aa\"}[data-kentico-pop-up-listing-host] .icon-app-recent[data-kentico-pop-up-listing]:before{content:\"\\e6c6\"}[data-kentico-pop-up-listing-host] .icon-app-translations[data-kentico-pop-up-listing]:before{content:\"\\e698\"}[data-kentico-pop-up-listing-host] .icon-app-activities[data-kentico-pop-up-listing]:before{content:\"\\e695\"}[data-kentico-pop-up-listing-host] .icon-app-banners[data-kentico-pop-up-listing]:before{content:\"\\e624\"}[data-kentico-pop-up-listing-host] .icon-app-campaigns[data-kentico-pop-up-listing]:before{content:\"\\e6ba\"}[data-kentico-pop-up-listing-host] .icon-app-contacts[data-kentico-pop-up-listing]:before{content:\"\\e663\"}[data-kentico-pop-up-listing-host] .icon-app-contact-groups[data-kentico-pop-up-listing]:before{content:\"\\e662\"}[data-kentico-pop-up-listing-host] .icon-app-conversions[data-kentico-pop-up-listing]:before{content:\"\\e683\"}[data-kentico-pop-up-listing-host] .icon-app-marketing-dashboard[data-kentico-pop-up-listing]:before{content:\"\\e686\"}[data-kentico-pop-up-listing-host] .icon-app-marketing-reports[data-kentico-pop-up-listing]:before{content:\"\\e684\"}[data-kentico-pop-up-listing-host] .icon-app-newsletters[data-kentico-pop-up-listing]:before{content:\"\\e64f\"}[data-kentico-pop-up-listing-host] .icon-app-processes[data-kentico-pop-up-listing]:before{content:\"\\e62c\"}[data-kentico-pop-up-listing-host] .icon-app-scoring[data-kentico-pop-up-listing]:before{content:\"\\e687\"}[data-kentico-pop-up-listing-host] .icon-app-web-analytics[data-kentico-pop-up-listing]:before{content:\"\\e631\"}[data-kentico-pop-up-listing-host] .icon-app-ab-test[data-kentico-pop-up-listing]:before{content:\"\\e706\"}[data-kentico-pop-up-listing-host] .icon-app-mvt[data-kentico-pop-up-listing]:before{content:\"\\e65c\"}[data-kentico-pop-up-listing-host] .icon-app-catalog-discounts[data-kentico-pop-up-listing]:before{content:\"\\e638\"}[data-kentico-pop-up-listing-host] .icon-app-customers[data-kentico-pop-up-listing]:before{content:\"\\e604\"}[data-kentico-pop-up-listing-host] .icon-app-ecommerce-dashboard[data-kentico-pop-up-listing]:before{content:\"\\e686\"}[data-kentico-pop-up-listing-host] .icon-app-ecommerce-reports[data-kentico-pop-up-listing]:before{content:\"\\e684\"}[data-kentico-pop-up-listing-host] .icon-app-free-shipping-offers[data-kentico-pop-up-listing]:before{content:\"\\e638\"}[data-kentico-pop-up-listing-host] .icon-app-manufacturers[data-kentico-pop-up-listing]:before{content:\"\\e690\"}[data-kentico-pop-up-listing-host] .icon-app-order-discounts[data-kentico-pop-up-listing]:before{content:\"\\e638\"}[data-kentico-pop-up-listing-host] .icon-app-orders[data-kentico-pop-up-listing]:before{content:\"\\e660\"}[data-kentico-pop-up-listing-host] .icon-app-product-coupons[data-kentico-pop-up-listing]:before{content:\"\\e638\"}[data-kentico-pop-up-listing-host] .icon-app-product-options[data-kentico-pop-up-listing]:before{content:\"\\e6cc\"}[data-kentico-pop-up-listing-host] .icon-app-products[data-kentico-pop-up-listing]:before{content:\"\\e6ce\"}[data-kentico-pop-up-listing-host] .icon-app-suppliers[data-kentico-pop-up-listing]:before{content:\"\\e6cd\"}[data-kentico-pop-up-listing-host] .icon-app-abuse-reports[data-kentico-pop-up-listing]:before{content:\"\\e6ea\"}[data-kentico-pop-up-listing-host] .icon-app-avatars[data-kentico-pop-up-listing]:before{content:\"\\e652\"}[data-kentico-pop-up-listing-host] .icon-app-bad-words[data-kentico-pop-up-listing]:before{content:\"\\e6c2\"}[data-kentico-pop-up-listing-host] .icon-app-badges[data-kentico-pop-up-listing]:before{content:\"\\e6d2\"}[data-kentico-pop-up-listing-host] .icon-app-events[data-kentico-pop-up-listing]:before{content:\"\\e6b8\"}[data-kentico-pop-up-listing-host] .icon-app-facebook[data-kentico-pop-up-listing]:before{content:\"\\e6c9\"}[data-kentico-pop-up-listing-host] .icon-app-forums[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-app-groups[data-kentico-pop-up-listing]:before{content:\"\\e602\"}[data-kentico-pop-up-listing-host] .icon-app-chat[data-kentico-pop-up-listing]:before{content:\"\\e6c3\"}[data-kentico-pop-up-listing-host] .icon-app-message-boards[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-app-messages[data-kentico-pop-up-listing]:before{content:\"\\e64e\"}[data-kentico-pop-up-listing-host] .icon-app-my-projects[data-kentico-pop-up-listing]:before{content:\"\\e62b\"}[data-kentico-pop-up-listing-host] .icon-app-projects[data-kentico-pop-up-listing]:before{content:\"\\e62b\"}[data-kentico-pop-up-listing-host] .icon-app-api-examples[data-kentico-pop-up-listing]:before{content:\"\\e6a6\"}[data-kentico-pop-up-listing-host] .icon-app-classes[data-kentico-pop-up-listing]:before{content:\"\\e6cb\"}[data-kentico-pop-up-listing-host] .icon-app-css-stylesheets[data-kentico-pop-up-listing]:before{content:\"\\e63f\"}[data-kentico-pop-up-listing-host] .icon-app-custom-tables[data-kentico-pop-up-listing]:before{content:\"\\e612\"}[data-kentico-pop-up-listing-host] .icon-app-database-objects[data-kentico-pop-up-listing]:before{content:\"\\e6a0\"}[data-kentico-pop-up-listing-host] .icon-app-device-profiles[data-kentico-pop-up-listing]:before{content:\"\\e645\"}[data-kentico-pop-up-listing-host] .icon-app-document-types[data-kentico-pop-up-listing]:before{content:\"\\e69f\"}[data-kentico-pop-up-listing-host] .icon-app-email-templates[data-kentico-pop-up-listing]:before{content:\"\\e64f\"}[data-kentico-pop-up-listing-host] .icon-app-form-controls[data-kentico-pop-up-listing]:before{content:\"\\e689\"}[data-kentico-pop-up-listing-host] .icon-app-javascript-files[data-kentico-pop-up-listing]:before{content:\"\\e6cb\"}[data-kentico-pop-up-listing-host] .icon-app-macro-rules[data-kentico-pop-up-listing]:before{content:\"\\e740\"}[data-kentico-pop-up-listing-host] .icon-app-modules[data-kentico-pop-up-listing]:before{content:\"\\e62a\"}[data-kentico-pop-up-listing-host] .icon-app-notifications[data-kentico-pop-up-listing]:before{content:\"\\e68f\"}[data-kentico-pop-up-listing-host] .icon-app-page-layouts[data-kentico-pop-up-listing]:before{content:\"\\e65c\"}[data-kentico-pop-up-listing-host] .icon-app-page-templates[data-kentico-pop-up-listing]:before{content:\"\\e65c\"}[data-kentico-pop-up-listing-host] .icon-app-web-part-containers[data-kentico-pop-up-listing]:before{content:\"\\e617\"}[data-kentico-pop-up-listing-host] .icon-app-web-parts[data-kentico-pop-up-listing]:before{content:\"\\e6bb\"}[data-kentico-pop-up-listing-host] .icon-app-web-templates[data-kentico-pop-up-listing]:before{content:\"\\e65c\"}[data-kentico-pop-up-listing-host] .icon-app-widgets[data-kentico-pop-up-listing]:before{content:\"\\e6a5\"}[data-kentico-pop-up-listing-host] .icon-app-banned-ips[data-kentico-pop-up-listing]:before{content:\"\\e6ea\"}[data-kentico-pop-up-listing-host] .icon-app-categories[data-kentico-pop-up-listing]:before{content:\"\\e699\"}[data-kentico-pop-up-listing-host] .icon-app-content-reports[data-kentico-pop-up-listing]:before{content:\"\\e6a7\"}[data-kentico-pop-up-listing-host] .icon-app-countries[data-kentico-pop-up-listing]:before{content:\"\\e653\"}[data-kentico-pop-up-listing-host] .icon-app-ecommerce-configuration[data-kentico-pop-up-listing]:before{content:\"\\e6a7\"}[data-kentico-pop-up-listing-host] .icon-app-email-queue[data-kentico-pop-up-listing]:before{content:\"\\e64e\"}[data-kentico-pop-up-listing-host] .icon-app-event-log[data-kentico-pop-up-listing]:before{content:\"\\e6a9\"}[data-kentico-pop-up-listing-host] .icon-app-integration-bus[data-kentico-pop-up-listing]:before{content:\"\\e661\"}[data-kentico-pop-up-listing-host] .icon-app-localization[data-kentico-pop-up-listing]:before{content:\"\\e698\"}[data-kentico-pop-up-listing-host] .icon-app-membership[data-kentico-pop-up-listing]:before{content:\"\\e663\"}[data-kentico-pop-up-listing-host] .icon-app-marketing-configuration[data-kentico-pop-up-listing]:before{content:\"\\e6a7\"}[data-kentico-pop-up-listing-host] .icon-app-permissions[data-kentico-pop-up-listing]:before{content:\"\\e634\"}[data-kentico-pop-up-listing-host] .icon-app-recycle-bin[data-kentico-pop-up-listing]:before{content:\"\\e6d0\"}[data-kentico-pop-up-listing-host] .icon-app-relationship-names[data-kentico-pop-up-listing]:before{content:\"\\e67f\"}[data-kentico-pop-up-listing-host] .icon-app-roles[data-kentico-pop-up-listing]:before{content:\"\\e603\"}[data-kentico-pop-up-listing-host] .icon-app-search-engines[data-kentico-pop-up-listing]:before{content:\"\\e657\"}[data-kentico-pop-up-listing-host] .icon-app-settings[data-kentico-pop-up-listing]:before{content:\"\\e6a7\"}[data-kentico-pop-up-listing-host] .icon-app-scheduled-tasks[data-kentico-pop-up-listing]:before{content:\"\\e68c\"}[data-kentico-pop-up-listing-host] .icon-app-sites[data-kentico-pop-up-listing]:before{content:\"\\e65b\"}[data-kentico-pop-up-listing-host] .icon-app-smart-search[data-kentico-pop-up-listing]:before{content:\"\\e657\"}[data-kentico-pop-up-listing-host] .icon-app-smtp-servers[data-kentico-pop-up-listing]:before{content:\"\\e64f\"}[data-kentico-pop-up-listing-host] .icon-app-staging[data-kentico-pop-up-listing]:before{content:\"\\e616\"}[data-kentico-pop-up-listing-host] .icon-app-system[data-kentico-pop-up-listing]:before{content:\"\\e6ab\"}[data-kentico-pop-up-listing-host] .icon-app-tag-groups[data-kentico-pop-up-listing]:before{content:\"\\e678\"}[data-kentico-pop-up-listing-host] .icon-app-time-zones[data-kentico-pop-up-listing]:before{content:\"\\e6a8\"}[data-kentico-pop-up-listing-host] .icon-app-translation-services[data-kentico-pop-up-listing]:before{content:\"\\e60c\"}[data-kentico-pop-up-listing-host] .icon-app-ui-personalization[data-kentico-pop-up-listing]:before{content:\"\\e65c\"}[data-kentico-pop-up-listing-host] .icon-app-users[data-kentico-pop-up-listing]:before{content:\"\\e602\"}[data-kentico-pop-up-listing-host] .icon-app-web-farm[data-kentico-pop-up-listing]:before{content:\"\\e63c\"}[data-kentico-pop-up-listing-host] .icon-app-workflows[data-kentico-pop-up-listing]:before{content:\"\\e756\"}[data-kentico-pop-up-listing-host] .icon-app-personas[data-kentico-pop-up-listing]:before{content:\"\\e75a\"}[data-kentico-pop-up-listing-host] .icon-app-unit-tests[data-kentico-pop-up-listing]:before{content:\"\\e61b\"}[data-kentico-pop-up-listing-host] .icon-app-licenses[data-kentico-pop-up-listing]:before{content:\"\\e65e\"}[data-kentico-pop-up-listing-host] .icon-app-my-profile[data-kentico-pop-up-listing]:before{content:\"\\e605\"}[data-kentico-pop-up-listing-host] .icon-app-debug[data-kentico-pop-up-listing]:before{content:\"\\e6bd\"}[data-kentico-pop-up-listing-host] .icon-app-twitter[data-kentico-pop-up-listing]:before{content:\"\\e6c7\"}[data-kentico-pop-up-listing-host] .icon-app-continuous-integration[data-kentico-pop-up-listing]:before{content:\"\\e600\"}[data-kentico-pop-up-listing-host] .icon-app-gift-cards[data-kentico-pop-up-listing]:before{content:\"\\e708\"}[data-kentico-pop-up-listing-host] .icon-app-brand[data-kentico-pop-up-listing]:before{content:\"\\e690\"}[data-kentico-pop-up-listing-host] .icon-app-collection[data-kentico-pop-up-listing]:before{content:\"\\e6cc\"}[data-kentico-pop-up-listing-host] .icon-googletranslator[data-kentico-pop-up-listing]:before{content:\"\\e6c8\"}[data-kentico-pop-up-listing-host] .icon-microsofttranslator[data-kentico-pop-up-listing]:before{content:\"\\e90c\"}[data-kentico-pop-up-listing-host] .icon-external-link[data-kentico-pop-up-listing]:before{content:\"\\e6d8\"}[data-kentico-pop-up-listing-host] .icon-mvc[data-kentico-pop-up-listing]:before{content:\"\\e73e\"}[data-kentico-pop-up-listing-host] .icon-w-webpart-default[data-kentico-pop-up-listing]:before{content:\"\\e6bb\"}[data-kentico-pop-up-listing-host] .icon-w-widget-default[data-kentico-pop-up-listing]:before{content:\"\\e6a5\"}[data-kentico-pop-up-listing-host] .icon-w-css-list-menu[data-kentico-pop-up-listing]:before{content:\"\\e6f8\"}[data-kentico-pop-up-listing-host] .icon-w-tree-menu[data-kentico-pop-up-listing]:before{content:\"\\e73a\"}[data-kentico-pop-up-listing-host] .icon-w-category-menu[data-kentico-pop-up-listing]:before{content:\"\\e6f8\"}[data-kentico-pop-up-listing-host] .icon-w-tab-menu[data-kentico-pop-up-listing]:before{content:\"\\e6f8\"}[data-kentico-pop-up-listing-host] .icon-w-drop-down-menu[data-kentico-pop-up-listing]:before{content:\"\\e6f8\"}[data-kentico-pop-up-listing-host] .icon-w-language-selection[data-kentico-pop-up-listing]:before{content:\"\\e698\"}[data-kentico-pop-up-listing-host] .icon-w-language-selection-dropdown[data-kentico-pop-up-listing]:before{content:\"\\e698\"}[data-kentico-pop-up-listing-host] .icon-w-language-selection-with-flags[data-kentico-pop-up-listing]:before{content:\"\\e698\"}[data-kentico-pop-up-listing-host] .icon-w-page-placeholder[data-kentico-pop-up-listing]:before{content:\"\\e630\"}[data-kentico-pop-up-listing-host] .icon-w-site-map[data-kentico-pop-up-listing]:before{content:\"\\e73a\"}[data-kentico-pop-up-listing-host] .icon-w-qr-code[data-kentico-pop-up-listing]:before{content:\"\\e6eb\"}[data-kentico-pop-up-listing-host] .icon-w-repeater[data-kentico-pop-up-listing]:before{content:\"\\e6f4\"}[data-kentico-pop-up-listing-host] .icon-w-repeater-for-web-service[data-kentico-pop-up-listing]:before{content:\"\\e6a6\"}[data-kentico-pop-up-listing-host] .icon-w-repeater-with-carousel[data-kentico-pop-up-listing]:before{content:\"\\e6f1\"}[data-kentico-pop-up-listing-host] .icon-w-repeater-with-custom-query[data-kentico-pop-up-listing]:before{content:\"\\e6a0\"}[data-kentico-pop-up-listing-host] .icon-w-query-repeater-with-effect[data-kentico-pop-up-listing]:before{content:\"\\e6a0\"}[data-kentico-pop-up-listing-host] .icon-w-repeater-with-effect[data-kentico-pop-up-listing]:before{content:\"\\e6f4\"}[data-kentico-pop-up-listing-host] .icon-w-repeater-with-lightbox[data-kentico-pop-up-listing]:before{content:\"\\e633\"}[data-kentico-pop-up-listing-host] .icon-w-basic-repeater[data-kentico-pop-up-listing]:before{content:\"\\e6f4\"}[data-kentico-pop-up-listing-host] .icon-w-basic-repeater-with-effect[data-kentico-pop-up-listing]:before{content:\"\\e6f4\"}[data-kentico-pop-up-listing-host] .icon-w-custom-table-repeater[data-kentico-pop-up-listing]:before{content:\"\\e612\"}[data-kentico-pop-up-listing-host] .icon-w-custom-table-repeater-with-effect[data-kentico-pop-up-listing]:before{content:\"\\e612\"}[data-kentico-pop-up-listing-host] .icon-w-report-table[data-kentico-pop-up-listing]:before{content:\"\\e612\"}[data-kentico-pop-up-listing-host] .icon-w-atom-repeater[data-kentico-pop-up-listing]:before{content:\"\\e6e9\"}[data-kentico-pop-up-listing-host] .icon-w-xml-repeater[data-kentico-pop-up-listing]:before{content:\"\\e6e7\"}[data-kentico-pop-up-listing-host] .icon-w-head-html-code[data-kentico-pop-up-listing]:before{content:\"\\e6e7\"}[data-kentico-pop-up-listing-host] .icon-w-static-html[data-kentico-pop-up-listing]:before{content:\"\\e6e7\"}[data-kentico-pop-up-listing-host] .icon-w-javascript[data-kentico-pop-up-listing]:before{content:\"\\e6cb\"}[data-kentico-pop-up-listing-host] .icon-w-breadcrumbs[data-kentico-pop-up-listing]:before{content:\"\\e6f9\"}[data-kentico-pop-up-listing-host] .icon-w-category-breadcrumbs[data-kentico-pop-up-listing]:before{content:\"\\e6f9\"}[data-kentico-pop-up-listing-host] .icon-w-forum-breadcrumbs[data-kentico-pop-up-listing]:before{content:\"\\e6f9\"}[data-kentico-pop-up-listing-host] .icon-w-document-attachments[data-kentico-pop-up-listing]:before{content:\"\\e63d\"}[data-kentico-pop-up-listing-host] .icon-w-document-attachments-with-effect[data-kentico-pop-up-listing]:before{content:\"\\e63d\"}[data-kentico-pop-up-listing-host] .icon-w-attachments[data-kentico-pop-up-listing]:before{content:\"\\e63d\"}[data-kentico-pop-up-listing-host] .icon-w-attachments-carousel[data-kentico-pop-up-listing]:before{content:\"\\e6f1\"}[data-kentico-pop-up-listing-host] .icon-w-attachments-carousel-3d[data-kentico-pop-up-listing]:before{content:\"\\e6f1\"}[data-kentico-pop-up-listing-host] .icon-w-attachments-lightbox[data-kentico-pop-up-listing]:before{content:\"\\e633\"}[data-kentico-pop-up-listing-host] .icon-w-lightbox-gallery[data-kentico-pop-up-listing]:before{content:\"\\e633\"}[data-kentico-pop-up-listing-host] .icon-w-inbox[data-kentico-pop-up-listing]:before{content:\"\\e64f\"}[data-kentico-pop-up-listing-host] .icon-w-send-message[data-kentico-pop-up-listing]:before{content:\"\\e64f\"}[data-kentico-pop-up-listing-host] .icon-w-send-to-friend[data-kentico-pop-up-listing]:before{content:\"\\e64f\"}[data-kentico-pop-up-listing-host] .icon-w-newsletter-archive[data-kentico-pop-up-listing]:before{content:\"\\e6f8\"}[data-kentico-pop-up-listing-host] .icon-w-newsletter-subscription[data-kentico-pop-up-listing]:before{content:\"\\e675\"}[data-kentico-pop-up-listing-host] .icon-w-messaging-info-panel[data-kentico-pop-up-listing]:before{content:\"\\e64f\"}[data-kentico-pop-up-listing-host] .icon-w-newsletter-unsubscription[data-kentico-pop-up-listing]:before{content:\"\\e60d\"}[data-kentico-pop-up-listing-host] .icon-w-custom-subscription-form[data-kentico-pop-up-listing]:before{content:\"\\e675\"}[data-kentico-pop-up-listing-host] .icon-w-registration-e-mail-confirmation[data-kentico-pop-up-listing]:before{content:\"\\e64f\"}[data-kentico-pop-up-listing-host] .icon-w-my-messages[data-kentico-pop-up-listing]:before{content:\"\\e64f\"}[data-kentico-pop-up-listing-host] .icon-w-outbox[data-kentico-pop-up-listing]:before{content:\"\\e64f\"}[data-kentico-pop-up-listing-host] .icon-w-my-sent-invitations[data-kentico-pop-up-listing]:before{content:\"\\e64f\"}[data-kentico-pop-up-listing-host] .icon-w-board-messages-data-source[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-group-forum-posts-data-source[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-query-data-source[data-kentico-pop-up-listing]:before{content:\"\\e6a0\"}[data-kentico-pop-up-listing-host] .icon-w-forum-posts-data-source[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-documents-data-source[data-kentico-pop-up-listing]:before{content:\"\\e69f\"}[data-kentico-pop-up-listing-host] .icon-w-web-service-data-source[data-kentico-pop-up-listing]:before{content:\"\\e6a6\"}[data-kentico-pop-up-listing-host] .icon-w-department-members-data-source[data-kentico-pop-up-listing]:before{content:\"\\e640\"}[data-kentico-pop-up-listing-host] .icon-w-macro-data-source[data-kentico-pop-up-listing]:before{content:\"\\e740\"}[data-kentico-pop-up-listing-host] .icon-w-file-system-data-source[data-kentico-pop-up-listing]:before{content:\"\\e68a\"}[data-kentico-pop-up-listing-host] .icon-w-sharepoint-data-source[data-kentico-pop-up-listing]:before{content:\"\\e6bb\"}[data-kentico-pop-up-listing-host] .icon-w-group-media-libraries-data-source[data-kentico-pop-up-listing]:before{content:\"\\e632\"}[data-kentico-pop-up-listing-host] .icon-w-atom-data-source[data-kentico-pop-up-listing]:before{content:\"\\e6e9\"}[data-kentico-pop-up-listing-host] .icon-w-media-files-data-source[data-kentico-pop-up-listing]:before{content:\"\\e632\"}[data-kentico-pop-up-listing-host] .icon-w-groups-data-source[data-kentico-pop-up-listing]:before{content:\"\\e602\"}[data-kentico-pop-up-listing-host] .icon-w-custom-table-data-source[data-kentico-pop-up-listing]:before{content:\"\\e612\"}[data-kentico-pop-up-listing-host] .icon-w-group-members-data-source[data-kentico-pop-up-listing]:before{content:\"\\e602\"}[data-kentico-pop-up-listing-host] .icon-w-blog-comments-data-source[data-kentico-pop-up-listing]:before{content:\"\\e642\"}[data-kentico-pop-up-listing-host] .icon-w-sql-data-source[data-kentico-pop-up-listing]:before{content:\"\\e6a0\"}[data-kentico-pop-up-listing-host] .icon-w-sql-search-box[data-kentico-pop-up-listing]:before{content:\"\\e657\"}[data-kentico-pop-up-listing-host] .icon-w-xml-data-source[data-kentico-pop-up-listing]:before{content:\"\\e6e7\"}[data-kentico-pop-up-listing-host] .icon-w-sql-search-dialog[data-kentico-pop-up-listing]:before{content:\"\\e657\"}[data-kentico-pop-up-listing-host] .icon-w-products-data-source[data-kentico-pop-up-listing]:before{content:\"\\e6ce\"}[data-kentico-pop-up-listing-host] .icon-w-sql-search-dialog-with-results[data-kentico-pop-up-listing]:before{content:\"\\e657\"}[data-kentico-pop-up-listing-host] .icon-w-media-libraries-data-source[data-kentico-pop-up-listing]:before{content:\"\\e632\"}[data-kentico-pop-up-listing-host] .icon-w-users-data-source[data-kentico-pop-up-listing]:before{content:\"\\e605\"}[data-kentico-pop-up-listing-host] .icon-w-attachments-data-source[data-kentico-pop-up-listing]:before{content:\"\\e63d\"}[data-kentico-pop-up-listing-host] .icon-w-sql-search-results[data-kentico-pop-up-listing]:before{content:\"\\e6f8\"}[data-kentico-pop-up-listing-host] .icon-w-chat-search-on-line-users[data-kentico-pop-up-listing]:before{content:\"\\e657\"}[data-kentico-pop-up-listing-host] .icon-w-search-accelerator-for-ie8-and-higher[data-kentico-pop-up-listing]:before{content:\"\\e657\"}[data-kentico-pop-up-listing-host] .icon-w-search-engine-results-highlighter[data-kentico-pop-up-listing]:before{content:\"\\e6f6\"}[data-kentico-pop-up-listing-host] .icon-w-smart-search-box[data-kentico-pop-up-listing]:before{content:\"\\e657\"}[data-kentico-pop-up-listing-host] .icon-w-forum-search-advanced-dialog[data-kentico-pop-up-listing]:before{content:\"\\e657\"}[data-kentico-pop-up-listing-host] .icon-w-smart-search-dialog[data-kentico-pop-up-listing]:before{content:\"\\e657\"}[data-kentico-pop-up-listing-host] .icon-w-forum-search-box[data-kentico-pop-up-listing]:before{content:\"\\e657\"}[data-kentico-pop-up-listing-host] .icon-w-smart-search-dialog-with-results[data-kentico-pop-up-listing]:before{content:\"\\e657\"}[data-kentico-pop-up-listing-host] .icon-w-smart-search-filter[data-kentico-pop-up-listing]:before{content:\"\\e687\"}[data-kentico-pop-up-listing-host] .icon-w-smart-search-results[data-kentico-pop-up-listing]:before{content:\"\\e6f8\"}[data-kentico-pop-up-listing-host] .icon-w-message-board-rss-feed[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-forum-posts-rss-feed[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-query-rss-feed[data-kentico-pop-up-listing]:before{content:\"\\e6a0\"}[data-kentico-pop-up-listing-host] .icon-w-news-rss-feed[data-kentico-pop-up-listing]:before{content:\"\\e643\"}[data-kentico-pop-up-listing-host] .icon-w-web-service-rss-feed[data-kentico-pop-up-listing]:before{content:\"\\e6a6\"}[data-kentico-pop-up-listing-host] .icon-w-feed-link[data-kentico-pop-up-listing]:before{content:\"\\e6e9\"}[data-kentico-pop-up-listing-host] .icon-w-cms-rss-feed[data-kentico-pop-up-listing]:before{content:\"\\e6e9\"}[data-kentico-pop-up-listing-host] .icon-w-atom-feed[data-kentico-pop-up-listing]:before{content:\"\\e6e9\"}[data-kentico-pop-up-listing-host] .icon-w-media-files-rss-feed[data-kentico-pop-up-listing]:before{content:\"\\e632\"}[data-kentico-pop-up-listing-host] .icon-w-blog-comments-rss-feed[data-kentico-pop-up-listing]:before{content:\"\\e6e9\"}[data-kentico-pop-up-listing-host] .icon-w-events-rss-feed[data-kentico-pop-up-listing]:before{content:\"\\e6b8\"}[data-kentico-pop-up-listing-host] .icon-w-rss-data-source[data-kentico-pop-up-listing]:before{content:\"\\e6a0\"}[data-kentico-pop-up-listing-host] .icon-w-rss-feed[data-kentico-pop-up-listing]:before{content:\"\\e6e9\"}[data-kentico-pop-up-listing-host] .icon-w-products-rss-feed[data-kentico-pop-up-listing]:before{content:\"\\e6ce\"}[data-kentico-pop-up-listing-host] .icon-w-custom-table-rss-feed[data-kentico-pop-up-listing]:before{content:\"\\e612\"}[data-kentico-pop-up-listing-host] .icon-w-blog-posts-rss-feed[data-kentico-pop-up-listing]:before{content:\"\\e642\"}[data-kentico-pop-up-listing-host] .icon-w-rss-repeater[data-kentico-pop-up-listing]:before{content:\"\\e6e9\"}[data-kentico-pop-up-listing-host] .icon-w-web-part-zone[data-kentico-pop-up-listing]:before{content:\"\\e65c\"}[data-kentico-pop-up-listing-host] .icon-w-banner-rotator[data-kentico-pop-up-listing]:before{content:\"\\e624\"}[data-kentico-pop-up-listing-host] .icon-w-css-style-selector[data-kentico-pop-up-listing]:before{content:\"\\e63f\"}[data-kentico-pop-up-listing-host] .icon-w-report[data-kentico-pop-up-listing]:before{content:\"\\e684\"}[data-kentico-pop-up-listing-host] .icon-w-report-chart[data-kentico-pop-up-listing]:before{content:\"\\e684\"}[data-kentico-pop-up-listing-host] .icon-w-switch-mobile-device-detection[data-kentico-pop-up-listing]:before{content:\"\\e61d\"}[data-kentico-pop-up-listing-host] .icon-w-mobile-device-redirection[data-kentico-pop-up-listing]:before{content:\"\\e61d\"}[data-kentico-pop-up-listing-host] .icon-w-poll[data-kentico-pop-up-listing]:before{content:\"\\e61b\"}[data-kentico-pop-up-listing-host] .icon-w-group-polls[data-kentico-pop-up-listing]:before{content:\"\\e61b\"}[data-kentico-pop-up-listing-host] .icon-w-scrolling-text[data-kentico-pop-up-listing]:before{content:\"\\e625\"}[data-kentico-pop-up-listing-host] .icon-w-static-text[data-kentico-pop-up-listing]:before{content:\"\\e625\"}[data-kentico-pop-up-listing-host] .icon-w-paged-text[data-kentico-pop-up-listing]:before{content:\"\\e625\"}[data-kentico-pop-up-listing-host] .icon-w-editable-text[data-kentico-pop-up-listing]:before{content:\"\\e625\"}[data-kentico-pop-up-listing-host] .icon-w-change-password[data-kentico-pop-up-listing]:before{content:\"\\e65e\"}[data-kentico-pop-up-listing-host] .icon-w-unlock-user-accunt[data-kentico-pop-up-listing]:before{content:\"\\e6ec\"}[data-kentico-pop-up-listing-host] .icon-w-reset-password[data-kentico-pop-up-listing]:before{content:\"\\e65e\"}[data-kentico-pop-up-listing-host] .icon-w-automatically-initiated-chat[data-kentico-pop-up-listing]:before{content:\"\\e6c3\"}[data-kentico-pop-up-listing-host] .icon-w-chat-send-message[data-kentico-pop-up-listing]:before{content:\"\\e64f\"}[data-kentico-pop-up-listing-host] .icon-w-chat-support-request[data-kentico-pop-up-listing]:before{content:\"\\e6c3\"}[data-kentico-pop-up-listing-host] .icon-w-chat-web-part[data-kentico-pop-up-listing]:before{content:\"\\e6bb\"}[data-kentico-pop-up-listing-host] .icon-w-chat-errors[data-kentico-pop-up-listing]:before{content:\"\\e6f2\"}[data-kentico-pop-up-listing-host] .icon-w-chat-leave-room[data-kentico-pop-up-listing]:before{content:\"\\e6d9\"}[data-kentico-pop-up-listing-host] .icon-w-chat-login[data-kentico-pop-up-listing]:before{content:\"\\e65e\"}[data-kentico-pop-up-listing-host] .icon-w-chat-notifications[data-kentico-pop-up-listing]:before{content:\"\\e6c3\"}[data-kentico-pop-up-listing-host] .icon-w-chat-room-messages[data-kentico-pop-up-listing]:before{content:\"\\e6c3\"}[data-kentico-pop-up-listing-host] .icon-w-chat-room-name[data-kentico-pop-up-listing]:before{content:\"\\e6c3\"}[data-kentico-pop-up-listing-host] .icon-w-chat-room-users[data-kentico-pop-up-listing]:before{content:\"\\e605\"}[data-kentico-pop-up-listing-host] .icon-w-chat-rooms[data-kentico-pop-up-listing]:before{content:\"\\e6f3\"}[data-kentico-pop-up-listing-host] .icon-w-comment-view[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-forum-unsubscription[data-kentico-pop-up-listing]:before{content:\"\\e60d\"}[data-kentico-pop-up-listing-host] .icon-w-forum-most-active-threads[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-forum-recently-active-threads[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-forum-top-contributors[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-forum-single-forum-flat-layout[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-forum-single-forum-general[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-forum-single-forum-tree-layout[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-calendar[data-kentico-pop-up-listing]:before{content:\"\\e6b9\"}[data-kentico-pop-up-listing-host] .icon-w-date-and-time[data-kentico-pop-up-listing]:before{content:\"\\e6a8\"}[data-kentico-pop-up-listing-host] .icon-w-event-calendar[data-kentico-pop-up-listing]:before{content:\"\\e6b8\"}[data-kentico-pop-up-listing-host] .icon-w-event-registration[data-kentico-pop-up-listing]:before{content:\"\\e6b8\"}[data-kentico-pop-up-listing-host] .icon-w-content-rating[data-kentico-pop-up-listing]:before{content:\"\\e614\"}[data-kentico-pop-up-listing-host] .icon-w-shopping-cart-content[data-kentico-pop-up-listing]:before{content:\"\\e6f5\"}[data-kentico-pop-up-listing-host] .icon-w-shopping-cart-preview[data-kentico-pop-up-listing]:before{content:\"\\e6f5\"}[data-kentico-pop-up-listing-host] .icon-w-shopping-cart-totals[data-kentico-pop-up-listing]:before{content:\"\\e6f5\"}[data-kentico-pop-up-listing-host] .icon-w-attachment-image-gallery[data-kentico-pop-up-listing]:before{content:\"\\e633\"}[data-kentico-pop-up-listing-host] .icon-w-media-gallery-file-filter[data-kentico-pop-up-listing]:before{content:\"\\e633\"}[data-kentico-pop-up-listing-host] .icon-w-media-gallery-file-list[data-kentico-pop-up-listing]:before{content:\"\\e633\"}[data-kentico-pop-up-listing-host] .icon-w-media-gallery-folder-tree[data-kentico-pop-up-listing]:before{content:\"\\e633\"}[data-kentico-pop-up-listing-host] .icon-w-image-gallery[data-kentico-pop-up-listing]:before{content:\"\\e633\"}[data-kentico-pop-up-listing-host] .icon-w-media-libraries-viewer[data-kentico-pop-up-listing]:before{content:\"\\e633\"}[data-kentico-pop-up-listing-host] .icon-w-grid-with-custom-query[data-kentico-pop-up-listing]:before{content:\"\\e612\"}[data-kentico-pop-up-listing-host] .icon-w-custom-table-datalist[data-kentico-pop-up-listing]:before{content:\"\\e6f8\"}[data-kentico-pop-up-listing-host] .icon-w-grid[data-kentico-pop-up-listing]:before{content:\"\\e612\"}[data-kentico-pop-up-listing-host] .icon-w-table-layout[data-kentico-pop-up-listing]:before{content:\"\\e612\"}[data-kentico-pop-up-listing-host] .icon-w-sharepoint-datagrid[data-kentico-pop-up-listing]:before{content:\"\\e612\"}[data-kentico-pop-up-listing-host] .icon-w-grid-for-rest-service[data-kentico-pop-up-listing]:before{content:\"\\e612\"}[data-kentico-pop-up-listing-host] .icon-w-grid-for-web-service[data-kentico-pop-up-listing]:before{content:\"\\e6a6\"}[data-kentico-pop-up-listing-host] .icon-w-custom-table-datagrid[data-kentico-pop-up-listing]:before{content:\"\\e612\"}[data-kentico-pop-up-listing-host] .icon-w-basic-datalist[data-kentico-pop-up-listing]:before{content:\"\\e6f8\"}[data-kentico-pop-up-listing-host] .icon-w-sharepoint-datalist[data-kentico-pop-up-listing]:before{content:\"\\e6f8\"}[data-kentico-pop-up-listing-host] .icon-w-datalist-with-custom-query[data-kentico-pop-up-listing]:before{content:\"\\e6a0\"}[data-kentico-pop-up-listing-host] .icon-w-datalist[data-kentico-pop-up-listing]:before{content:\"\\e6f8\"}[data-kentico-pop-up-listing-host] .icon-w-group-forum-list[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-group-profile[data-kentico-pop-up-listing]:before{content:\"\\e602\"}[data-kentico-pop-up-listing-host] .icon-w-group-properties[data-kentico-pop-up-listing]:before{content:\"\\e602\"}[data-kentico-pop-up-listing-host] .icon-w-group-forum-post-viewer[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-group-public-profile[data-kentico-pop-up-listing]:before{content:\"\\e602\"}[data-kentico-pop-up-listing-host] .icon-w-group-forum-search-results[data-kentico-pop-up-listing]:before{content:\"\\e657\"}[data-kentico-pop-up-listing-host] .icon-w-group-registration[data-kentico-pop-up-listing]:before{content:\"\\e602\"}[data-kentico-pop-up-listing-host] .icon-w-group-forums[data-kentico-pop-up-listing]:before{content:\"\\e602\"}[data-kentico-pop-up-listing-host] .icon-w-group-roles[data-kentico-pop-up-listing]:before{content:\"\\e602\"}[data-kentico-pop-up-listing-host] .icon-w-group-invitation[data-kentico-pop-up-listing]:before{content:\"\\e64f\"}[data-kentico-pop-up-listing-host] .icon-w-group-security-access[data-kentico-pop-up-listing]:before{content:\"\\e658\"}[data-kentico-pop-up-listing-host] .icon-w-group-media-libraries[data-kentico-pop-up-listing]:before{content:\"\\e632\"}[data-kentico-pop-up-listing-host] .icon-w-department-members-viewer[data-kentico-pop-up-listing]:before{content:\"\\e640\"}[data-kentico-pop-up-listing-host] .icon-w-group-security-message[data-kentico-pop-up-listing]:before{content:\"\\e64f\"}[data-kentico-pop-up-listing-host] .icon-w-leave-group[data-kentico-pop-up-listing]:before{content:\"\\e6d9\"}[data-kentico-pop-up-listing-host] .icon-w-group-media-libraries-viewer[data-kentico-pop-up-listing]:before{content:\"\\e632\"}[data-kentico-pop-up-listing-host] .icon-w-groups-filter[data-kentico-pop-up-listing]:before{content:\"\\e687\"}[data-kentico-pop-up-listing-host] .icon-w-group-members[data-kentico-pop-up-listing]:before{content:\"\\e602\"}[data-kentico-pop-up-listing-host] .icon-w-groups-viewer[data-kentico-pop-up-listing]:before{content:\"\\e602\"}[data-kentico-pop-up-listing-host] .icon-w-group-members-viewer[data-kentico-pop-up-listing]:before{content:\"\\e602\"}[data-kentico-pop-up-listing-host] .icon-w-group-contribution-list[data-kentico-pop-up-listing]:before{content:\"\\e6f8\"}[data-kentico-pop-up-listing-host] .icon-w-chat-on-line-users[data-kentico-pop-up-listing]:before{content:\"\\e6c3\"}[data-kentico-pop-up-listing-host] .icon-w-group-message-board[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-group-document-library[data-kentico-pop-up-listing]:before{content:\"\\e632\"}[data-kentico-pop-up-listing-host] .icon-w-group-message-board-viewer[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-group-edit-contribution[data-kentico-pop-up-listing]:before{content:\"\\e696\"}[data-kentico-pop-up-listing-host] .icon-w-group-message-boards[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-group-forum-most-active-threads[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-group-permissions[data-kentico-pop-up-listing]:before{content:\"\\e634\"}[data-kentico-pop-up-listing-host] .icon-w-group-forum-recently-active-threads[data-kentico-pop-up-listing]:before{content:\"\\e6a8\"}[data-kentico-pop-up-listing-host] .icon-w-custom-registration-form[data-kentico-pop-up-listing]:before{content:\"\\e605\"}[data-kentico-pop-up-listing-host] .icon-w-on-line-form[data-kentico-pop-up-listing]:before{content:\"\\e689\"}[data-kentico-pop-up-listing-host] .icon-w-registration-form[data-kentico-pop-up-listing]:before{content:\"\\e605\"}[data-kentico-pop-up-listing-host] .icon-w-logon-form[data-kentico-pop-up-listing]:before{content:\"\\e65e\"}[data-kentico-pop-up-listing-host] .icon-w-logon-mini-form[data-kentico-pop-up-listing]:before{content:\"\\e65e\"}[data-kentico-pop-up-listing-host] .icon-w-discount-coupon[data-kentico-pop-up-listing]:before{content:\"\\e638\"}[data-kentico-pop-up-listing-host] .icon-w-my-account[data-kentico-pop-up-listing]:before{content:\"\\e663\"}[data-kentico-pop-up-listing-host] .icon-w-on-line-users[data-kentico-pop-up-listing]:before{content:\"\\e605\"}[data-kentico-pop-up-listing-host] .icon-w-my-profile[data-kentico-pop-up-listing]:before{content:\"\\e605\"}[data-kentico-pop-up-listing-host] .icon-w-user-public-profile[data-kentico-pop-up-listing]:before{content:\"\\e605\"}[data-kentico-pop-up-listing-host] .icon-w-users-filter[data-kentico-pop-up-listing]:before{content:\"\\e687\"}[data-kentico-pop-up-listing-host] .icon-w-document-name-filter[data-kentico-pop-up-listing]:before{content:\"\\e687\"}[data-kentico-pop-up-listing-host] .icon-w-filter[data-kentico-pop-up-listing]:before{content:\"\\e687\"}[data-kentico-pop-up-listing-host] .icon-w-remaining-amount-for-free-shipping[data-kentico-pop-up-listing]:before{content:\"\\e638\"}[data-kentico-pop-up-listing-host] .icon-w-shipping-option-selection[data-kentico-pop-up-listing]:before{content:\"\\e609\"}[data-kentico-pop-up-listing-host] .icon-w-tasks-owned-by-me[data-kentico-pop-up-listing]:before{content:\"\\e61b\"}[data-kentico-pop-up-listing-host] .icon-w-my-projects[data-kentico-pop-up-listing]:before{content:\"\\e62b\"}[data-kentico-pop-up-listing-host] .icon-w-project-list[data-kentico-pop-up-listing]:before{content:\"\\e62b\"}[data-kentico-pop-up-listing-host] .icon-w-project-tasks[data-kentico-pop-up-listing]:before{content:\"\\e61b\"}[data-kentico-pop-up-listing-host] .icon-w-tasks-assigned-to-me[data-kentico-pop-up-listing]:before{content:\"\\e61b\"}[data-kentico-pop-up-listing-host] .icon-w-customer-detail[data-kentico-pop-up-listing]:before{content:\"\\e604\"}[data-kentico-pop-up-listing-host] .icon-w-customer-address[data-kentico-pop-up-listing]:before{content:\"\\e604\"}[data-kentico-pop-up-listing-host] .icon-w-liveid-required-data[data-kentico-pop-up-listing]:before{content:\"\\e6bb\"}[data-kentico-pop-up-listing-host] .icon-w-windows-liveid[data-kentico-pop-up-listing]:before{content:\"\\e6bb\"}[data-kentico-pop-up-listing-host] .icon-w-openid-logon[data-kentico-pop-up-listing]:before{content:\"\\e6e4\"}[data-kentico-pop-up-listing-host] .icon-w-openid-required-data[data-kentico-pop-up-listing]:before{content:\"\\e6e4\"}[data-kentico-pop-up-listing-host] .icon-w-powered-by-kentico[data-kentico-pop-up-listing]:before{content:\"\\e65f\"}[data-kentico-pop-up-listing-host] .icon-w-bing-translator[data-kentico-pop-up-listing]:before{content:\"\\e6ca\"}[data-kentico-pop-up-listing-host] .icon-w-static-bing-maps[data-kentico-pop-up-listing]:before{content:\"\\e6ca\"}[data-kentico-pop-up-listing-host] .icon-w-basic-bing-maps[data-kentico-pop-up-listing]:before{content:\"\\e6ca\"}[data-kentico-pop-up-listing-host] .icon-w-bing-maps[data-kentico-pop-up-listing]:before{content:\"\\e6ca\"}[data-kentico-pop-up-listing-host] .icon-w-google-maps[data-kentico-pop-up-listing]:before{content:\"\\e6c8\"}[data-kentico-pop-up-listing-host] .icon-w-static-google-maps[data-kentico-pop-up-listing]:before{content:\"\\e6c8\"}[data-kentico-pop-up-listing-host] .icon-w-basic-google-maps[data-kentico-pop-up-listing]:before{content:\"\\e6c8\"}[data-kentico-pop-up-listing-host] .icon-w-google-activity-feed[data-kentico-pop-up-listing]:before{content:\"\\e6e6\"}[data-kentico-pop-up-listing-host] .icon-w-google-badge[data-kentico-pop-up-listing]:before{content:\"\\e6e6\"}[data-kentico-pop-up-listing-host] .icon-w-google-analytics[data-kentico-pop-up-listing]:before{content:\"\\e6c8\"}[data-kentico-pop-up-listing-host] .icon-w-google-search[data-kentico-pop-up-listing]:before{content:\"\\e6c8\"}[data-kentico-pop-up-listing-host] .icon-w-google-sitemap-xml-sitemap[data-kentico-pop-up-listing]:before{content:\"\\e6c8\"}[data-kentico-pop-up-listing-host] .icon-w-google-translator[data-kentico-pop-up-listing]:before{content:\"\\e6c8\"}[data-kentico-pop-up-listing-host] .icon-w-google-1-button[data-kentico-pop-up-listing]:before{content:\"\\e6e6\"}[data-kentico-pop-up-listing-host] .icon-w-facebook-activity-feed[data-kentico-pop-up-listing]:before{content:\"\\e6c9\"}[data-kentico-pop-up-listing-host] .icon-w-facebook-comments[data-kentico-pop-up-listing]:before{content:\"\\e6c9\"}[data-kentico-pop-up-listing-host] .icon-w-facebook-connect-logon[data-kentico-pop-up-listing]:before{content:\"\\e6c9\"}[data-kentico-pop-up-listing-host] .icon-w-facebook-facepile[data-kentico-pop-up-listing]:before{content:\"\\e6c9\"}[data-kentico-pop-up-listing-host] .icon-w-facebook-like-box[data-kentico-pop-up-listing]:before{content:\"\\e6c9\"}[data-kentico-pop-up-listing-host] .icon-w-facebook-like-button[data-kentico-pop-up-listing]:before{content:\"\\e6c9\"}[data-kentico-pop-up-listing-host] .icon-w-facebook-recommendations[data-kentico-pop-up-listing]:before{content:\"\\e6c9\"}[data-kentico-pop-up-listing-host] .icon-w-facebook-send-button[data-kentico-pop-up-listing]:before{content:\"\\e6c9\"}[data-kentico-pop-up-listing-host] .icon-w-twitter-feed[data-kentico-pop-up-listing]:before{content:\"\\e6c7\"}[data-kentico-pop-up-listing-host] .icon-w-twitter-follow-button[data-kentico-pop-up-listing]:before{content:\"\\e6c7\"}[data-kentico-pop-up-listing-host] .icon-w-twitter-tweet-button[data-kentico-pop-up-listing]:before{content:\"\\e6c7\"}[data-kentico-pop-up-listing-host] .icon-w-pinterest-follow-button[data-kentico-pop-up-listing]:before{content:\"\\e6e3\"}[data-kentico-pop-up-listing-host] .icon-w-pinterest-pin-it-button[data-kentico-pop-up-listing]:before{content:\"\\e6e3\"}[data-kentico-pop-up-listing-host] .icon-w-linkedin-apply-with[data-kentico-pop-up-listing]:before{content:\"\\e6e5\"}[data-kentico-pop-up-listing-host] .icon-w-linkedin-company-insider[data-kentico-pop-up-listing]:before{content:\"\\e6e5\"}[data-kentico-pop-up-listing-host] .icon-w-linkedin-company-profile[data-kentico-pop-up-listing]:before{content:\"\\e6e5\"}[data-kentico-pop-up-listing-host] .icon-w-linkedin-logon[data-kentico-pop-up-listing]:before{content:\"\\e6e5\"}[data-kentico-pop-up-listing-host] .icon-w-linkedin-member-profile[data-kentico-pop-up-listing]:before{content:\"\\e6e5\"}[data-kentico-pop-up-listing-host] .icon-w-linkedin-recommend-button[data-kentico-pop-up-listing]:before{content:\"\\e6e5\"}[data-kentico-pop-up-listing-host] .icon-w-linkedin-required-data[data-kentico-pop-up-listing]:before{content:\"\\e6e5\"}[data-kentico-pop-up-listing-host] .icon-w-linkedin-share-button[data-kentico-pop-up-listing]:before{content:\"\\e6e5\"}[data-kentico-pop-up-listing-host] .icon-w-flash-web-part[data-kentico-pop-up-listing]:before{content:\"\\e6bb\"}[data-kentico-pop-up-listing-host] .icon-w-flash-widget[data-kentico-pop-up-listing]:before{content:\"\\e6a5\"}[data-kentico-pop-up-listing-host] .icon-w-social-bookmarking[data-kentico-pop-up-listing]:before{content:\"\\e678\"}[data-kentico-pop-up-listing-host] .icon-w-wmp-video[data-kentico-pop-up-listing]:before{content:\"\\e6bb\"}[data-kentico-pop-up-listing-host] .icon-w-youtube-video[data-kentico-pop-up-listing]:before{content:\"\\e659\"}[data-kentico-pop-up-listing-host] .icon-w-silverlight-application-web-part[data-kentico-pop-up-listing]:before{content:\"\\e6bb\"}[data-kentico-pop-up-listing-host] .icon-w-silverlight-application-widget[data-kentico-pop-up-listing]:before{content:\"\\e6a5\"}[data-kentico-pop-up-listing-host] .icon-w-quicktime[data-kentico-pop-up-listing]:before{content:\"\\e6bb\"}[data-kentico-pop-up-listing-host] .icon-w-product-filter[data-kentico-pop-up-listing]:before{content:\"\\e6ce\"}[data-kentico-pop-up-listing-host] .icon-w-top-n-newest-products[data-kentico-pop-up-listing]:before{content:\"\\e6ce\"}[data-kentico-pop-up-listing-host] .icon-w-top-n-products-by-sales[data-kentico-pop-up-listing]:before{content:\"\\e6ce\"}[data-kentico-pop-up-listing-host] .icon-w-similar-products-by-sales[data-kentico-pop-up-listing]:before{content:\"\\e6ce\"}[data-kentico-pop-up-listing-host] .icon-w-random-products[data-kentico-pop-up-listing]:before{content:\"\\e6ce\"}[data-kentico-pop-up-listing-host] .icon-w-tag-cloud[data-kentico-pop-up-listing]:before{content:\"\\e701\"}[data-kentico-pop-up-listing-host] .icon-w-message-board[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-accordion-layout[data-kentico-pop-up-listing]:before{content:\"\\e704\"}[data-kentico-pop-up-listing-host] .icon-w-columns-layout[data-kentico-pop-up-listing]:before{content:\"\\e712\"}[data-kentico-pop-up-listing-host] .icon-w-tabs-layout[data-kentico-pop-up-listing]:before{content:\"\\e6fb\"}[data-kentico-pop-up-listing-host] .icon-w-wizard-layout[data-kentico-pop-up-listing]:before{content:\"\\e6fa\"}[data-kentico-pop-up-listing-host] .icon-w-rows-layout[data-kentico-pop-up-listing]:before{content:\"\\e72e\"}[data-kentico-pop-up-listing-host] .icon-w-new-blog[data-kentico-pop-up-listing]:before{content:\"\\e642\"}[data-kentico-pop-up-listing-host] .icon-w-abuse-report[data-kentico-pop-up-listing]:before{content:\"\\e6ea\"}[data-kentico-pop-up-listing-host] .icon-w-in-line-abuse-report[data-kentico-pop-up-listing]:before{content:\"\\e6ea\"}[data-kentico-pop-up-listing-host] .icon-w-message-board-subscription-confirmation[data-kentico-pop-up-listing]:before{content:\"\\e675\"}[data-kentico-pop-up-listing-host] .icon-w-datalist-for-web-service[data-kentico-pop-up-listing]:before{content:\"\\e6a6\"}[data-kentico-pop-up-listing-host] .icon-w-tree-view[data-kentico-pop-up-listing]:before{content:\"\\e73a\"}[data-kentico-pop-up-listing-host] .icon-w-admin-actions[data-kentico-pop-up-listing]:before{content:\"\\e67f\"}[data-kentico-pop-up-listing-host] .icon-w-simple-cookie-law-consent[data-kentico-pop-up-listing]:before{content:\"\\e6f7\"}[data-kentico-pop-up-listing-host] .icon-w-news-list[data-kentico-pop-up-listing]:before{content:\"\\e6f8\"}[data-kentico-pop-up-listing-host] .icon-w-message-board-unsubscription[data-kentico-pop-up-listing]:before{content:\"\\e60d\"}[data-kentico-pop-up-listing-host] .icon-w-keep-alive[data-kentico-pop-up-listing]:before{content:\"\\e622\"}[data-kentico-pop-up-listing-host] .icon-w-donate[data-kentico-pop-up-listing]:before{content:\"\\e708\"}[data-kentico-pop-up-listing-host] .icon-w-donations[data-kentico-pop-up-listing]:before{content:\"\\e708\"}[data-kentico-pop-up-listing-host] .icon-w-payment-form[data-kentico-pop-up-listing]:before{content:\"\\e708\"}[data-kentico-pop-up-listing-host] .icon-w-payment-method-selection[data-kentico-pop-up-listing]:before{content:\"\\e708\"}[data-kentico-pop-up-listing-host] .icon-w-currency-selection[data-kentico-pop-up-listing]:before{content:\"\\e6ed\"}[data-kentico-pop-up-listing-host] .icon-w-analytics-browser-capabilities[data-kentico-pop-up-listing]:before{content:\"\\e6ff\"}[data-kentico-pop-up-listing-host] .icon-w-strands-recommendations[data-kentico-pop-up-listing]:before{content:\"\\e6bb\"}[data-kentico-pop-up-listing-host] .icon-w-password-expiration[data-kentico-pop-up-listing]:before{content:\"\\e658\"}[data-kentico-pop-up-listing-host] .icon-w-message-board-viewer[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-checkout-process-obsolete[data-kentico-pop-up-listing]:before{content:\"\\e6bb\"}[data-kentico-pop-up-listing-host] .icon-w-category-list[data-kentico-pop-up-listing]:before{content:\"\\e6f8\"}[data-kentico-pop-up-listing-host] .icon-w-analytics-custom-statistics[data-kentico-pop-up-listing]:before{content:\"\\e631\"}[data-kentico-pop-up-listing-host] .icon-w-subscription-approval[data-kentico-pop-up-listing]:before{content:\"\\e675\"}[data-kentico-pop-up-listing-host] .icon-w-widget-actions[data-kentico-pop-up-listing]:before{content:\"\\e6a5\"}[data-kentico-pop-up-listing-host] .icon-w-message-panel[data-kentico-pop-up-listing]:before{content:\"\\e6f5\"}[data-kentico-pop-up-listing-host] .icon-w-article-list[data-kentico-pop-up-listing]:before{content:\"\\e6f8\"}[data-kentico-pop-up-listing-host] .icon-w-set-cookie[data-kentico-pop-up-listing]:before{content:\"\\e6f7\"}[data-kentico-pop-up-listing-host] .icon-w-random-document[data-kentico-pop-up-listing]:before{content:\"\\e69f\"}[data-kentico-pop-up-listing-host] .icon-w-edit-contribution[data-kentico-pop-up-listing]:before{content:\"\\e696\"}[data-kentico-pop-up-listing-host] .icon-w-universal-document-viewer[data-kentico-pop-up-listing]:before{content:\"\\e69f\"}[data-kentico-pop-up-listing-host] .icon-w-custom-response[data-kentico-pop-up-listing]:before{content:\"\\e698\"}[data-kentico-pop-up-listing-host] .icon-w-collapsible-panel[data-kentico-pop-up-listing]:before{content:\"\\e700\"}[data-kentico-pop-up-listing-host] .icon-w-wishlist[data-kentico-pop-up-listing]:before{content:\"\\e614\"}[data-kentico-pop-up-listing-host] .icon-w-latest-news[data-kentico-pop-up-listing]:before{content:\"\\e643\"}[data-kentico-pop-up-listing-host] .icon-w-edit-document-link[data-kentico-pop-up-listing]:before{content:\"\\e696\"}[data-kentico-pop-up-listing-host] .icon-w-did-you-mean[data-kentico-pop-up-listing]:before{content:\"\\e629\"}[data-kentico-pop-up-listing-host] .icon-w-universal-pager[data-kentico-pop-up-listing]:before{content:\"\\e6fe\"}[data-kentico-pop-up-listing-host] .icon-w-basic-universal-viewer[data-kentico-pop-up-listing]:before{content:\"\\e6fd\"}[data-kentico-pop-up-listing-host] .icon-w-random-redirection[data-kentico-pop-up-listing]:before{content:\"\\e703\"}[data-kentico-pop-up-listing-host] .icon-w-notification-subscription[data-kentico-pop-up-listing]:before{content:\"\\e675\"}[data-kentico-pop-up-listing-host] .icon-w-wizard-buttons[data-kentico-pop-up-listing]:before{content:\"\\e6fa\"}[data-kentico-pop-up-listing-host] .icon-w-universal-viewer[data-kentico-pop-up-listing]:before{content:\"\\e6fd\"}[data-kentico-pop-up-listing-host] .icon-w-report-value[data-kentico-pop-up-listing]:before{content:\"\\e749\"}[data-kentico-pop-up-listing-host] .icon-w-recent-posts[data-kentico-pop-up-listing]:before{content:\"\\e642\"}[data-kentico-pop-up-listing-host] .icon-w-object-management-buttons[data-kentico-pop-up-listing]:before{content:\"\\e696\"}[data-kentico-pop-up-listing-host] .icon-w-wizard-header[data-kentico-pop-up-listing]:before{content:\"\\e6fa\"}[data-kentico-pop-up-listing-host] .icon-w-universal-viewer-with-custom-query[data-kentico-pop-up-listing]:before{content:\"\\e6a0\"}[data-kentico-pop-up-listing-host] .icon-w-confirmation-checkbox[data-kentico-pop-up-listing]:before{content:\"\\e702\"}[data-kentico-pop-up-listing-host] .icon-w-sharepoint-repeater[data-kentico-pop-up-listing]:before{content:\"\\e6f4\"}[data-kentico-pop-up-listing-host] .icon-w-register-after-checkout[data-kentico-pop-up-listing]:before{content:\"\\e605\"}[data-kentico-pop-up-listing-host] .icon-w-post-archive[data-kentico-pop-up-listing]:before{content:\"\\e6f8\"}[data-kentico-pop-up-listing-host] .icon-w-my-invitations[data-kentico-pop-up-listing]:before{content:\"\\e64f\"}[data-kentico-pop-up-listing-host] .icon-w-link-button[data-kentico-pop-up-listing]:before{content:\"\\e67f\"}[data-kentico-pop-up-listing-host] .icon-w-contact-list[data-kentico-pop-up-listing]:before{content:\"\\e604\"}[data-kentico-pop-up-listing-host] .icon-w-task-info-panel[data-kentico-pop-up-listing]:before{content:\"\\e61b\"}[data-kentico-pop-up-listing-host] .icon-w-document-library[data-kentico-pop-up-listing]:before{content:\"\\e69f\"}[data-kentico-pop-up-listing-host] .icon-w-custom-table-form[data-kentico-pop-up-listing]:before{content:\"\\e612\"}[data-kentico-pop-up-listing-host] .icon-w-hierarchical-viewer[data-kentico-pop-up-listing]:before{content:\"\\e6fd\"}[data-kentico-pop-up-listing-host] .icon-w-user-control[data-kentico-pop-up-listing]:before{content:\"\\e6bb\"}[data-kentico-pop-up-listing-host] .icon-w-content-slider[data-kentico-pop-up-listing]:before{content:\"\\e6f1\"}[data-kentico-pop-up-listing-host] .icon-w-blog-post-subscription-confirmation[data-kentico-pop-up-listing]:before{content:\"\\e675\"}[data-kentico-pop-up-listing-host] .icon-w-ignore-list[data-kentico-pop-up-listing]:before{content:\"\\e6ea\"}[data-kentico-pop-up-listing-host] .icon-w-document-pager[data-kentico-pop-up-listing]:before{content:\"\\e6fe\"}[data-kentico-pop-up-listing-host] .icon-w-content-subscription[data-kentico-pop-up-listing]:before{content:\"\\e675\"}[data-kentico-pop-up-listing-host] .icon-w-blog-post-unsubscription[data-kentico-pop-up-listing]:before{content:\"\\e60d\"}[data-kentico-pop-up-listing-host] .icon-w-text-highlighter[data-kentico-pop-up-listing]:before{content:\"\\e6f6\"}[data-kentico-pop-up-listing-host] .icon-w-related-documents[data-kentico-pop-up-listing]:before{content:\"\\e69f\"}[data-kentico-pop-up-listing-host] .icon-w-order-note[data-kentico-pop-up-listing]:before{content:\"\\e660\"}[data-kentico-pop-up-listing-host] .icon-w-xslt-viewer[data-kentico-pop-up-listing]:before{content:\"\\e6e7\"}[data-kentico-pop-up-listing-host] .icon-w-document-wizard-button[data-kentico-pop-up-listing]:before{content:\"\\e6fa\"}[data-kentico-pop-up-listing-host] .icon-w-contribution-list[data-kentico-pop-up-listing]:before{content:\"\\e6f8\"}[data-kentico-pop-up-listing-host] .icon-w-timer[data-kentico-pop-up-listing]:before{content:\"\\e6a8\"}[data-kentico-pop-up-listing-host] .icon-w-shortcuts[data-kentico-pop-up-listing]:before{content:\"\\e67f\"}[data-kentico-pop-up-listing-host] .icon-w-document-wizard-manager[data-kentico-pop-up-listing]:before{content:\"\\e6fa\"}[data-kentico-pop-up-listing-host] .icon-w-cookie-law-consent[data-kentico-pop-up-listing]:before{content:\"\\e6f7\"}[data-kentico-pop-up-listing-host] .icon-w-blog-comments-viewer[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-sign-out-button[data-kentico-pop-up-listing]:before{content:\"\\e6d9\"}[data-kentico-pop-up-listing-host] .icon-w-scrolling-news[data-kentico-pop-up-listing]:before{content:\"\\e6f1\"}[data-kentico-pop-up-listing-host] .icon-w-output-cache-dependencies[data-kentico-pop-up-listing]:before{content:\"\\e6bb\"}[data-kentico-pop-up-listing-host] .icon-w-zones-with-effect[data-kentico-pop-up-listing]:before{content:\"\\e65c\"}[data-kentico-pop-up-listing-host] .icon-w-document-wizard-navigation[data-kentico-pop-up-listing]:before{content:\"\\e6fa\"}[data-kentico-pop-up-listing-host] .icon-w-my-subscriptions[data-kentico-pop-up-listing]:before{content:\"\\e634\"}[data-kentico-pop-up-listing-host] .icon-w-document-wizard-step-action[data-kentico-pop-up-listing]:before{content:\"\\e6fa\"}[data-kentico-pop-up-listing-host] .icon-w-page-views[data-kentico-pop-up-listing]:before{content:\"\\e6bb\"}[data-kentico-pop-up-listing-host] .icon-w-activities[data-kentico-pop-up-listing]:before{content:\"\\e695\"}[data-kentico-pop-up-listing-host] .icon-w-analytics-chart-viewer[data-kentico-pop-up-listing]:before{content:\"\\e631\"}[data-kentico-pop-up-listing-host] .icon-w-analytics-table-viewer[data-kentico-pop-up-listing]:before{content:\"\\e612\"}[data-kentico-pop-up-listing-host] .icon-w-articles-rss-feed[data-kentico-pop-up-listing]:before{content:\"\\e6e9\"}[data-kentico-pop-up-listing-host] .icon-w-blog-comments[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-building-your-on-line-store[data-kentico-pop-up-listing]:before{content:\"\\e6f5\"}[data-kentico-pop-up-listing-host] .icon-w-department-latest-blog-posts[data-kentico-pop-up-listing]:before{content:\"\\e642\"}[data-kentico-pop-up-listing-host] .icon-w-department-latest-forum-posts[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-department-latest-news[data-kentico-pop-up-listing]:before{content:\"\\e643\"}[data-kentico-pop-up-listing-host] .icon-w-department-quick-links[data-kentico-pop-up-listing]:before{content:\"\\e67f\"}[data-kentico-pop-up-listing-host] .icon-w-department-upcoming-events[data-kentico-pop-up-listing]:before{content:\"\\e6b8\"}[data-kentico-pop-up-listing-host] .icon-w-documents[data-kentico-pop-up-listing]:before{content:\"\\e69f\"}[data-kentico-pop-up-listing-host] .icon-w-e-commerce-settings-checker[data-kentico-pop-up-listing]:before{content:\"\\e702\"}[data-kentico-pop-up-listing-host] .icon-w-editable-image[data-kentico-pop-up-listing]:before{content:\"\\e633\"}[data-kentico-pop-up-listing-host] .icon-w-e-mail-queue[data-kentico-pop-up-listing]:before{content:\"\\e64e\"}[data-kentico-pop-up-listing-host] .icon-w-employee-of-the-month[data-kentico-pop-up-listing]:before{content:\"\\e604\"}[data-kentico-pop-up-listing-host] .icon-w-event-management[data-kentico-pop-up-listing]:before{content:\"\\e6b8\"}[data-kentico-pop-up-listing-host] .icon-w-eventlog[data-kentico-pop-up-listing]:before{content:\"\\e6a9\"}[data-kentico-pop-up-listing-host] .icon-w-forum-group[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-forum-posts-waiting-for-approval[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-group-administrators[data-kentico-pop-up-listing]:before{content:\"\\e605\"}[data-kentico-pop-up-listing-host] .icon-w-group-forum-posts-viewer[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-group-poll[data-kentico-pop-up-listing]:before{content:\"\\e61b\"}[data-kentico-pop-up-listing-host] .icon-w-intranet-canteen-menu[data-kentico-pop-up-listing]:before{content:\"\\e660\"}[data-kentico-pop-up-listing-host] .icon-w-intranet-departments[data-kentico-pop-up-listing]:before{content:\"\\e640\"}[data-kentico-pop-up-listing-host] .icon-w-intranet-employees[data-kentico-pop-up-listing]:before{content:\"\\e602\"}[data-kentico-pop-up-listing-host] .icon-w-intranet-latest-blog-posts[data-kentico-pop-up-listing]:before{content:\"\\e642\"}[data-kentico-pop-up-listing-host] .icon-w-intranet-latest-forum-posts[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-intranet-latest-news[data-kentico-pop-up-listing]:before{content:\"\\e643\"}[data-kentico-pop-up-listing-host] .icon-w-intranet-poll[data-kentico-pop-up-listing]:before{content:\"\\e631\"}[data-kentico-pop-up-listing-host] .icon-w-intranet-quick-links[data-kentico-pop-up-listing]:before{content:\"\\e67f\"}[data-kentico-pop-up-listing-host] .icon-w-intranet-upcoming-events[data-kentico-pop-up-listing]:before{content:\"\\e6b8\"}[data-kentico-pop-up-listing-host] .icon-w-latest-blog-posts[data-kentico-pop-up-listing]:before{content:\"\\e642\"}[data-kentico-pop-up-listing-host] .icon-w-latest-forum-posts[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-latest-news-for-corporate-site[data-kentico-pop-up-listing]:before{content:\"\\e643\"}[data-kentico-pop-up-listing-host] .icon-w-link[data-kentico-pop-up-listing]:before{content:\"\\e67f\"}[data-kentico-pop-up-listing-host] .icon-w-media-gallery[data-kentico-pop-up-listing]:before{content:\"\\e633\"}[data-kentico-pop-up-listing-host] .icon-w-message-list[data-kentico-pop-up-listing]:before{content:\"\\e6f8\"}[data-kentico-pop-up-listing-host] .icon-w-most-recent-pages[data-kentico-pop-up-listing]:before{content:\"\\e6f8\"}[data-kentico-pop-up-listing-host] .icon-w-my-accounts[data-kentico-pop-up-listing]:before{content:\"\\e6bc\"}[data-kentico-pop-up-listing-host] .icon-w-my-blogs[data-kentico-pop-up-listing]:before{content:\"\\e642\"}[data-kentico-pop-up-listing-host] .icon-w-my-blogs-comments[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-my-contacts[data-kentico-pop-up-listing]:before{content:\"\\e663\"}[data-kentico-pop-up-listing-host] .icon-w-my-inbox[data-kentico-pop-up-listing]:before{content:\"\\e64e\"}[data-kentico-pop-up-listing-host] .icon-w-my-pending-contacts[data-kentico-pop-up-listing]:before{content:\"\\e663\"}[data-kentico-pop-up-listing-host] .icon-w-my-projects-intranet-portal[data-kentico-pop-up-listing]:before{content:\"\\e62b\"}[data-kentico-pop-up-listing-host] .icon-w-my-workgroups[data-kentico-pop-up-listing]:before{content:\"\\e6c6\"}[data-kentico-pop-up-listing-host] .icon-w-object-recycle-bin[data-kentico-pop-up-listing]:before{content:\"\\e6d0\"}[data-kentico-pop-up-listing-host] .icon-w-orders[data-kentico-pop-up-listing]:before{content:\"\\e660\"}[data-kentico-pop-up-listing-host] .icon-w-persona-based-recommendations[data-kentico-pop-up-listing]:before{content:\"\\e604\"}[data-kentico-pop-up-listing-host] .icon-w-personal-category-list[data-kentico-pop-up-listing]:before{content:\"\\e6f8\"}[data-kentico-pop-up-listing-host] .icon-w-products[data-kentico-pop-up-listing]:before{content:\"\\e6ce\"}[data-kentico-pop-up-listing-host] .icon-w-random-products-for-corporate-site[data-kentico-pop-up-listing]:before{content:\"\\e6ce\"}[data-kentico-pop-up-listing-host] .icon-w-recent-users[data-kentico-pop-up-listing]:before{content:\"\\e605\"}[data-kentico-pop-up-listing-host] .icon-w-report-daily-sales[data-kentico-pop-up-listing]:before{content:\"\\e684\"}[data-kentico-pop-up-listing-host] .icon-w-report-monthly-sales[data-kentico-pop-up-listing]:before{content:\"\\e684\"}[data-kentico-pop-up-listing-host] .icon-w-report-number-of-orders-by-status[data-kentico-pop-up-listing]:before{content:\"\\e684\"}[data-kentico-pop-up-listing-host] .icon-w-report-sales-by-order-status[data-kentico-pop-up-listing]:before{content:\"\\e684\"}[data-kentico-pop-up-listing-host] .icon-w-reporting[data-kentico-pop-up-listing]:before{content:\"\\e684\"}[data-kentico-pop-up-listing-host] .icon-w-rich-text[data-kentico-pop-up-listing]:before{content:\"\\e728\"}[data-kentico-pop-up-listing-host] .icon-w-scrolling-news-for-corporate-site[data-kentico-pop-up-listing]:before{content:\"\\e643\"}[data-kentico-pop-up-listing-host] .icon-w-system[data-kentico-pop-up-listing]:before{content:\"\\e6ab\"}[data-kentico-pop-up-listing-host] .icon-w-tasks-assigned-to-me-intranet-portal[data-kentico-pop-up-listing]:before{content:\"\\e61b\"}[data-kentico-pop-up-listing-host] .icon-w-tasks-owned-by-me-intranet-portal[data-kentico-pop-up-listing]:before{content:\"\\e61b\"}[data-kentico-pop-up-listing-host] .icon-w-text[data-kentico-pop-up-listing]:before{content:\"\\e72c\"}[data-kentico-pop-up-listing-host] .icon-w-widget-zone[data-kentico-pop-up-listing]:before{content:\"\\e6a5\"}[data-kentico-pop-up-listing-host] .icon-w-workgroup-administrators[data-kentico-pop-up-listing]:before{content:\"\\e605\"}[data-kentico-pop-up-listing-host] .icon-w-workgroup-latest-blog-posts[data-kentico-pop-up-listing]:before{content:\"\\e642\"}[data-kentico-pop-up-listing-host] .icon-w-workgroup-latest-forum-posts[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-workgroup-latest-news[data-kentico-pop-up-listing]:before{content:\"\\e643\"}[data-kentico-pop-up-listing-host] .icon-w-workgroup-members[data-kentico-pop-up-listing]:before{content:\"\\e602\"}[data-kentico-pop-up-listing-host] .icon-w-workgroup-messages[data-kentico-pop-up-listing]:before{content:\"\\e64f\"}[data-kentico-pop-up-listing-host] .icon-w-workgroup-quick-links[data-kentico-pop-up-listing]:before{content:\"\\e67f\"}[data-kentico-pop-up-listing-host] .icon-w-workgroup-recent-pages[data-kentico-pop-up-listing]:before{content:\"\\e6f8\"}[data-kentico-pop-up-listing-host] .icon-w-workgroup-upcoming-events[data-kentico-pop-up-listing]:before{content:\"\\e6b8\"}[data-kentico-pop-up-listing-host] .icon-w-current-user[data-kentico-pop-up-listing]:before{content:\"\\e605\"}[data-kentico-pop-up-listing-host] .icon-w-disabled-module-info[data-kentico-pop-up-listing]:before{content:\"\\e664\"}[data-kentico-pop-up-listing-host] .icon-w-edit[data-kentico-pop-up-listing]:before{content:\"\\e696\"}[data-kentico-pop-up-listing-host] .icon-w-edit-parameters[data-kentico-pop-up-listing]:before{content:\"\\e696\"}[data-kentico-pop-up-listing-host] .icon-w-forum-favorites[data-kentico-pop-up-listing]:before{content:\"\\e614\"}[data-kentico-pop-up-listing-host] .icon-w-forum-posts-viewer[data-kentico-pop-up-listing]:before{content:\"\\e6c1\"}[data-kentico-pop-up-listing-host] .icon-w-forum-subscription-confirmation[data-kentico-pop-up-listing]:before{content:\"\\e675\"}[data-kentico-pop-up-listing-host] .icon-w-header-actions[data-kentico-pop-up-listing]:before{content:\"\\e6bb\"}[data-kentico-pop-up-listing-host] .icon-w-horizontal-tabs[data-kentico-pop-up-listing]:before{content:\"\\e6fb\"}[data-kentico-pop-up-listing-host] .icon-w-listing[data-kentico-pop-up-listing]:before{content:\"\\e728\"}[data-kentico-pop-up-listing-host] .icon-w-edit-bindings[data-kentico-pop-up-listing]:before{content:\"\\e696\"}[data-kentico-pop-up-listing-host] .icon-w-media-file-uploader[data-kentico-pop-up-listing]:before{content:\"\\e632\"}[data-kentico-pop-up-listing-host] .icon-w-messages-placeholder[data-kentico-pop-up-listing]:before{content:\"\\e630\"}[data-kentico-pop-up-listing-host] .icon-w-metafile-list[data-kentico-pop-up-listing]:before{content:\"\\e6f8\"}[data-kentico-pop-up-listing-host] .icon-w-new-header-action[data-kentico-pop-up-listing]:before{content:\"\\e6bb\"}[data-kentico-pop-up-listing-host] .icon-w-object-edit-panel[data-kentico-pop-up-listing]:before{content:\"\\e6bb\"}[data-kentico-pop-up-listing-host] .icon-w-object-tree-menu[data-kentico-pop-up-listing]:before{content:\"\\e73a\"}[data-kentico-pop-up-listing-host] .icon-w-page-title[data-kentico-pop-up-listing]:before{content:\"\\e727\"}[data-kentico-pop-up-listing-host] .icon-w-preview-edit[data-kentico-pop-up-listing]:before{content:\"\\e696\"}[data-kentico-pop-up-listing-host] .icon-w-selector[data-kentico-pop-up-listing]:before{content:\"\\e6bb\"}[data-kentico-pop-up-listing-host] .icon-w-select-site[data-kentico-pop-up-listing]:before{content:\"\\e698\"}[data-kentico-pop-up-listing-host] .icon-w-theme-file-manager[data-kentico-pop-up-listing]:before{content:\"\\e68a\"}[data-kentico-pop-up-listing-host] .icon-w-tree[data-kentico-pop-up-listing]:before{content:\"\\e73a\"}[data-kentico-pop-up-listing-host] .icon-w-tree-guide[data-kentico-pop-up-listing]:before{content:\"\\e73a\"}[data-kentico-pop-up-listing-host] .icon-w-users-viewer[data-kentico-pop-up-listing]:before{content:\"\\e605\"}[data-kentico-pop-up-listing-host] .icon-w-vertical-tabs[data-kentico-pop-up-listing]:before{content:\"\\e73c\"}[data-kentico-pop-up-listing-host] .icon-file-default[data-kentico-pop-up-listing]:before{content:\"\\e69c\"}[data-kentico-pop-up-listing-host] .icon-file-3gp[data-kentico-pop-up-listing]:before{content:\"\\e636\"}[data-kentico-pop-up-listing-host] .icon-file-accdb[data-kentico-pop-up-listing]:before{content:\"\\e6a0\"}[data-kentico-pop-up-listing-host] .icon-file-ai[data-kentico-pop-up-listing]:before{content:\"\\e717\"}[data-kentico-pop-up-listing-host] .icon-file-ascx[data-kentico-pop-up-listing]:before{content:\"\\e714\"}[data-kentico-pop-up-listing-host] .icon-file-aspx[data-kentico-pop-up-listing]:before{content:\"\\e69f\"}[data-kentico-pop-up-listing-host] .icon-file-au[data-kentico-pop-up-listing]:before{content:\"\\e71c\"}[data-kentico-pop-up-listing-host] .icon-file-avi[data-kentico-pop-up-listing]:before{content:\"\\e636\"}[data-kentico-pop-up-listing-host] .icon-file-bat[data-kentico-pop-up-listing]:before{content:\"\\e71a\"}[data-kentico-pop-up-listing-host] .icon-file-bmp[data-kentico-pop-up-listing]:before{content:\"\\e633\"}[data-kentico-pop-up-listing-host] .icon-file-cs[data-kentico-pop-up-listing]:before{content:\"\\e718\"}[data-kentico-pop-up-listing-host] .icon-file-css[data-kentico-pop-up-listing]:before{content:\"\\e63f\"}[data-kentico-pop-up-listing-host] .icon-file-csv[data-kentico-pop-up-listing]:before{content:\"\\e612\"}[data-kentico-pop-up-listing-host] .icon-file-dbm[data-kentico-pop-up-listing]:before{content:\"\\e6a0\"}[data-kentico-pop-up-listing-host] .icon-file-doc[data-kentico-pop-up-listing]:before{content:\"\\e625\"}[data-kentico-pop-up-listing-host] .icon-file-eps[data-kentico-pop-up-listing]:before{content:\"\\e717\"}[data-kentico-pop-up-listing-host] .icon-file-flv[data-kentico-pop-up-listing]:before{content:\"\\e636\"}[data-kentico-pop-up-listing-host] .icon-file-gif[data-kentico-pop-up-listing]:before{content:\"\\e633\"}[data-kentico-pop-up-listing-host] .icon-file-html[data-kentico-pop-up-listing]:before{content:\"\\e6e7\"}[data-kentico-pop-up-listing-host] .icon-file-jpeg[data-kentico-pop-up-listing]:before{content:\"\\e633\"}[data-kentico-pop-up-listing-host] .icon-file-js[data-kentico-pop-up-listing]:before{content:\"\\e6cb\"}[data-kentico-pop-up-listing-host] .icon-file-mdb[data-kentico-pop-up-listing]:before{content:\"\\e6a0\"}[data-kentico-pop-up-listing-host] .icon-file-mid[data-kentico-pop-up-listing]:before{content:\"\\e71c\"}[data-kentico-pop-up-listing-host] .icon-file-mov[data-kentico-pop-up-listing]:before{content:\"\\e636\"}[data-kentico-pop-up-listing-host] .icon-file-mp3[data-kentico-pop-up-listing]:before{content:\"\\e71c\"}[data-kentico-pop-up-listing-host] .icon-file-mp4[data-kentico-pop-up-listing]:before{content:\"\\e636\"}[data-kentico-pop-up-listing-host] .icon-file-mpeg[data-kentico-pop-up-listing]:before{content:\"\\e71c\"}[data-kentico-pop-up-listing-host] .icon-file-mpg[data-kentico-pop-up-listing]:before{content:\"\\e636\"}[data-kentico-pop-up-listing-host] .icon-file-mpg4[data-kentico-pop-up-listing]:before{content:\"\\e636\"}[data-kentico-pop-up-listing-host] .icon-file-oga[data-kentico-pop-up-listing]:before{content:\"\\e71c\"}[data-kentico-pop-up-listing-host] .icon-file-ogg[data-kentico-pop-up-listing]:before{content:\"\\e71c\"}[data-kentico-pop-up-listing-host] .icon-file-ogv[data-kentico-pop-up-listing]:before{content:\"\\e636\"}[data-kentico-pop-up-listing-host] .icon-file-pdf[data-kentico-pop-up-listing]:before{content:\"\\e6a3\"}[data-kentico-pop-up-listing-host] .icon-file-png[data-kentico-pop-up-listing]:before{content:\"\\e633\"}[data-kentico-pop-up-listing-host] .icon-file-pps[data-kentico-pop-up-listing]:before{content:\"\\e71d\"}[data-kentico-pop-up-listing-host] .icon-file-ppt[data-kentico-pop-up-listing]:before{content:\"\\e71d\"}[data-kentico-pop-up-listing-host] .icon-file-ps[data-kentico-pop-up-listing]:before{content:\"\\e717\"}[data-kentico-pop-up-listing-host] .icon-file-psd[data-kentico-pop-up-listing]:before{content:\"\\e633\"}[data-kentico-pop-up-listing-host] .icon-file-rtf[data-kentico-pop-up-listing]:before{content:\"\\e625\"}[data-kentico-pop-up-listing-host] .icon-file-sln[data-kentico-pop-up-listing]:before{content:\"\\e6ff\"}[data-kentico-pop-up-listing-host] .icon-file-swf[data-kentico-pop-up-listing]:before{content:\"\\e636\"}[data-kentico-pop-up-listing-host] .icon-file-tif[data-kentico-pop-up-listing]:before{content:\"\\e633\"}[data-kentico-pop-up-listing-host] .icon-file-tiff[data-kentico-pop-up-listing]:before{content:\"\\e633\"}[data-kentico-pop-up-listing-host] .icon-file-txt[data-kentico-pop-up-listing]:before{content:\"\\e625\"}[data-kentico-pop-up-listing-host] .icon-file-vb[data-kentico-pop-up-listing]:before{content:\"\\e716\"}[data-kentico-pop-up-listing-host] .icon-file-wav[data-kentico-pop-up-listing]:before{content:\"\\e71c\"}[data-kentico-pop-up-listing-host] .icon-file-webm[data-kentico-pop-up-listing]:before{content:\"\\e636\"}[data-kentico-pop-up-listing-host] .icon-file-wma[data-kentico-pop-up-listing]:before{content:\"\\e71c\"}[data-kentico-pop-up-listing-host] .icon-file-wmv[data-kentico-pop-up-listing]:before{content:\"\\e636\"}[data-kentico-pop-up-listing-host] .icon-file-xls[data-kentico-pop-up-listing]:before{content:\"\\e612\"}[data-kentico-pop-up-listing-host] .icon-file-xml[data-kentico-pop-up-listing]:before{content:\"\\e6e7\"}[data-kentico-pop-up-listing-host] .icon-file-xsl[data-kentico-pop-up-listing]:before{content:\"\\e6e7\"}[data-kentico-pop-up-listing-host] .icon-file-xslt[data-kentico-pop-up-listing]:before{content:\"\\e6e7\"}[data-kentico-pop-up-listing-host] .icon-file-zip[data-kentico-pop-up-listing]:before{content:\"\\e715\"}[data-kentico-pop-up-listing-host] .icon-me-abstractobjectcollection[data-kentico-pop-up-listing]:before{content:\"\\e68b\"}[data-kentico-pop-up-listing-host] .icon-me-binding[data-kentico-pop-up-listing]:before{content:\"\\e67f\"}[data-kentico-pop-up-listing-host] .icon-me-boolean[data-kentico-pop-up-listing]:before{content:\"\\e74a\"}[data-kentico-pop-up-listing-host] .icon-me-datetime[data-kentico-pop-up-listing]:before{content:\"\\e6a8\"}[data-kentico-pop-up-listing-host] .icon-me-double[data-kentico-pop-up-listing]:before{content:\"\\e752\"}[data-kentico-pop-up-listing-host] .icon-me-decimal[data-kentico-pop-up-listing]:before{content:\"\\e752\"}[data-kentico-pop-up-listing-host] .icon-me-false[data-kentico-pop-up-listing]:before{content:\"\\e74e\"}[data-kentico-pop-up-listing-host] .icon-me-children[data-kentico-pop-up-listing]:before{content:\"\\e67b\"}[data-kentico-pop-up-listing-host] .icon-me-icontext[data-kentico-pop-up-listing]:before{content:\"\\e654\"}[data-kentico-pop-up-listing-host] .icon-me-ilist[data-kentico-pop-up-listing]:before{content:\"\\e6f8\"}[data-kentico-pop-up-listing-host] .icon-me-imacronamespace[data-kentico-pop-up-listing]:before{content:\"\\e699\"}[data-kentico-pop-up-listing-host] .icon-me-info[data-kentico-pop-up-listing]:before{content:\"\\e6a9\"}[data-kentico-pop-up-listing-host] .icon-me-insertmacro[data-kentico-pop-up-listing]:before{content:\"\\e740\"}[data-kentico-pop-up-listing-host] .icon-me-int32[data-kentico-pop-up-listing]:before{content:\"\\e752\"}[data-kentico-pop-up-listing-host] .icon-me-method[data-kentico-pop-up-listing]:before{content:\"\\e6a6\"}[data-kentico-pop-up-listing-host] .icon-me-null[data-kentico-pop-up-listing]:before{content:\"\\e751\"}[data-kentico-pop-up-listing-host] .icon-me-number[data-kentico-pop-up-listing]:before{content:\"\\e752\"}[data-kentico-pop-up-listing-host] .icon-me-parent[data-kentico-pop-up-listing]:before{content:\"\\e74c\"}[data-kentico-pop-up-listing-host] .icon-me-property[data-kentico-pop-up-listing]:before{content:\"\\e6a9\"}[data-kentico-pop-up-listing-host] .icon-me-referring[data-kentico-pop-up-listing]:before{content:\"\\e67f\"}[data-kentico-pop-up-listing-host] .icon-me-sitebinding[data-kentico-pop-up-listing]:before{content:\"\\e67f\"}[data-kentico-pop-up-listing-host] .icon-me-snippet[data-kentico-pop-up-listing]:before{content:\"\\e750\"}[data-kentico-pop-up-listing-host] .icon-me-string[data-kentico-pop-up-listing]:before{content:\"\\e74f\"}[data-kentico-pop-up-listing-host] .icon-me-true[data-kentico-pop-up-listing]:before{content:\"\\e74b\"}[data-kentico-pop-up-listing-host] .icon-me-value[data-kentico-pop-up-listing]:before{content:\"\\e749\"}[data-kentico-pop-up-listing-host] .icon-me-exception[data-kentico-pop-up-listing]:before{content:\"\\e693\"}[data-kentico-pop-up-listing-host] .icon-personalisation-variants[data-kentico-pop-up-listing]:before{content:\"\\e901\"}[data-kentico-pop-up-listing-host] .icon-personalisation[data-kentico-pop-up-listing]:before{content:\"\\e900\"}[data-kentico-pop-up-listing-host] .icon-android[data-kentico-pop-up-listing]:before{content:\"\\f17b\"}[data-kentico-pop-up-listing-host] .icon-apple[data-kentico-pop-up-listing]:before{content:\"\\f179\"}[data-kentico-pop-up-listing-host] .icon-cancel[data-kentico-pop-up-listing]:before{content:\"\\e804\"}[data-kentico-pop-up-listing-host] .icon-chrome[data-kentico-pop-up-listing]:before{content:\"\\f268\"}[data-kentico-pop-up-listing-host] .icon-circle-empty[data-kentico-pop-up-listing]:before{content:\"\\f10c\"}[data-kentico-pop-up-listing-host] .icon-desktop[data-kentico-pop-up-listing]:before{content:\"\\f108\"}[data-kentico-pop-up-listing-host] .icon-down-dir[data-kentico-pop-up-listing]:before{content:\"\\e805\"}[data-kentico-pop-up-listing-host] .icon-edge[data-kentico-pop-up-listing]:before{content:\"\\f282\"}[data-kentico-pop-up-listing-host] .icon-filter-1[data-kentico-pop-up-listing]:before{content:\"\\f0b0\"}[data-kentico-pop-up-listing-host] .icon-firefox[data-kentico-pop-up-listing]:before{content:\"\\f269\"}[data-kentico-pop-up-listing-host] .icon-internet-explorer[data-kentico-pop-up-listing]:before{content:\"\\f26b\"}[data-kentico-pop-up-listing-host] .icon-linux[data-kentico-pop-up-listing]:before{content:\"\\f17c\"}[data-kentico-pop-up-listing-host] .icon-mobile[data-kentico-pop-up-listing]:before{content:\"\\f10b\"}[data-kentico-pop-up-listing-host] .icon-opera[data-kentico-pop-up-listing]:before{content:\"\\f26a\"}[data-kentico-pop-up-listing-host] .icon-paragraph-center[data-kentico-pop-up-listing]:before{content:\"\\e90a\"}[data-kentico-pop-up-listing-host] .icon-safari[data-kentico-pop-up-listing]:before{content:\"\\f267\"}[data-kentico-pop-up-listing-host] .icon-windows[data-kentico-pop-up-listing]:before{content:\"\\f17a\"}[data-kentico-pop-up-listing-host] .icon-add-module[data-kentico-pop-up-listing]:before{content:\"\\e90e\"}[data-kentico-pop-up-listing-host] .icon-convert[data-kentico-pop-up-listing]:before{content:\"\\e90d\"}[data-kentico-pop-up-listing-host] .icon-recaptcha[data-kentico-pop-up-listing]:before{content:\"\\e910\"}[data-kentico-pop-up-listing-host] .icon-scheme-path-circles-flipped[data-kentico-pop-up-listing]:before{content:\"\\e90f\"}[data-kentico-pop-up-listing-host] .icon-crosshair[data-kentico-pop-up-listing]{position:relative;display:inline-block}[data-kentico-pop-up-listing-host] .icon-crosshair[data-kentico-pop-up-listing]:before{content:\"\\e71b\";color:#fff;position:absolute;left:0;display:inline-block}[data-kentico-pop-up-listing-host] .icon-crosshair[data-kentico-pop-up-listing]:after{content:\"\\e71f\";position:absolute;left:0;display:inline-block}[data-kentico-pop-up-listing-host] .ktc-pop-up-item-listing[data-kentico-pop-up-listing]{background-color:#fff;padding-top:8px;padding-bottom:8px}[data-kentico-pop-up-listing-host] .ktc-pop-up-item-listing.ktc-pop-up-item-listing--empty[data-kentico-pop-up-listing]{padding:8px}[data-kentico-pop-up-listing-host] .ktc-pop-up-item-listing[data-kentico-pop-up-listing] ul[data-kentico-pop-up-listing]{margin:0;padding:0}[data-kentico-pop-up-listing-host] .ktc-pop-up-item-listing[data-kentico-pop-up-listing] ul[data-kentico-pop-up-listing] .ktc-pop-up-item-single-column[data-kentico-pop-up-listing]{width:292px}[data-kentico-pop-up-listing-host] .ktc-pop-up-item-listing[data-kentico-pop-up-listing] ul[data-kentico-pop-up-listing] .ktc-pop-up-item-single-column[data-kentico-pop-up-listing] .ktc-pop-up-item-label[data-kentico-pop-up-listing]{width:244px}[data-kentico-pop-up-listing-host] .ktc-pop-up-item-listing[data-kentico-pop-up-listing] ul[data-kentico-pop-up-listing] .ktc-pop-up-item-single-column[data-kentico-pop-up-listing] .ktc-pop-up-item-label--no-icon[data-kentico-pop-up-listing]{width:276px}[data-kentico-pop-up-listing-host] .ktc-pop-up-item-listing[data-kentico-pop-up-listing] ul[data-kentico-pop-up-listing] .ktc-pop-up-item-double-column[data-kentico-pop-up-listing]{width:142px}[data-kentico-pop-up-listing-host] .ktc-pop-up-item-listing[data-kentico-pop-up-listing] ul[data-kentico-pop-up-listing] .ktc-pop-up-item-double-column[data-kentico-pop-up-listing] .ktc-pop-up-item-label[data-kentico-pop-up-listing]{width:94px}[data-kentico-pop-up-listing-host] .ktc-pop-up-item-listing[data-kentico-pop-up-listing] ul[data-kentico-pop-up-listing] .ktc-pop-up-item-double-column[data-kentico-pop-up-listing] .ktc-pop-up-item-label--no-icon[data-kentico-pop-up-listing]{width:126px}[data-kentico-pop-up-listing-host] .ktc-pop-up-item-listing[data-kentico-pop-up-listing] ul[data-kentico-pop-up-listing] .ktc-pop-up-item[data-kentico-pop-up-listing]{vertical-align:top;display:inline-block;height:40px}[data-kentico-pop-up-listing-host] .ktc-pop-up-item-listing[data-kentico-pop-up-listing] ul[data-kentico-pop-up-listing] .ktc-pop-up-item[data-kentico-pop-up-listing] *[data-kentico-pop-up-listing]{cursor:pointer}[data-kentico-pop-up-listing-host] .ktc-pop-up-item-listing[data-kentico-pop-up-listing] ul[data-kentico-pop-up-listing] .ktc-pop-up-item[data-kentico-pop-up-listing]:hover{background-color:#d0e8ed}[data-kentico-pop-up-listing-host] .ktc-pop-up-item-listing[data-kentico-pop-up-listing] ul[data-kentico-pop-up-listing] .ktc-pop-up-item.ktc-pop-up-item--active[data-kentico-pop-up-listing]{background-color:#d0e8ed}[data-kentico-pop-up-listing-host] .ktc-pop-up-item-listing[data-kentico-pop-up-listing] ul[data-kentico-pop-up-listing] .ktc-pop-up-item.ktc-pop-up-item--active[data-kentico-pop-up-listing], [data-kentico-pop-up-listing-host] .ktc-pop-up-item-listing[data-kentico-pop-up-listing] ul[data-kentico-pop-up-listing] .ktc-pop-up-item.ktc-pop-up-item--active[data-kentico-pop-up-listing] *[data-kentico-pop-up-listing]{pointer-events:none}[data-kentico-pop-up-listing-host] .ktc-pop-up-item-listing[data-kentico-pop-up-listing] ul[data-kentico-pop-up-listing] .ktc-pop-up-item[data-kentico-pop-up-listing] .ktc-pop-up-item-icon[data-kentico-pop-up-listing]{-webkit-box-sizing:content-box;box-sizing:content-box;width:24px;height:24px;padding:8px;float:left}[data-kentico-pop-up-listing-host] .ktc-pop-up-item-listing[data-kentico-pop-up-listing] ul[data-kentico-pop-up-listing] .ktc-pop-up-item[data-kentico-pop-up-listing] .ktc-pop-up-item-icon[data-kentico-pop-up-listing] > i[data-kentico-pop-up-listing]{font-size:24px}[data-kentico-pop-up-listing-host] .ktc-pop-up-item-listing[data-kentico-pop-up-listing] ul[data-kentico-pop-up-listing] .ktc-pop-up-item[data-kentico-pop-up-listing] .ktc-pop-up-item-label[data-kentico-pop-up-listing]{height:40px;display:inline-block;line-height:40px;font-size:14px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding:0 8px}[data-kentico-pop-up-listing-host] .ktc-pop-up-item-listing[data-kentico-pop-up-listing] ul[data-kentico-pop-up-listing] .ktc-pop-up-item[data-kentico-pop-up-listing] .ktc-pop-up-item-icon[data-kentico-pop-up-listing] ~ .ktc-pop-up-item-label[data-kentico-pop-up-listing]{padding:0}"},enumerable:!0,configurable:!0}),e}();function o(e,t,n){if(void 0===n)return e&&e.h5s&&e.h5s.data&&e.h5s.data[t];e.h5s=e.h5s||{},e.h5s.data=e.h5s.data||{},e.h5s.data[t]=n}function a(e,t){if(!(e instanceof NodeList||e instanceof HTMLCollection||e instanceof Array))throw new Error("You must provide a nodeList/HTMLCollection/Array of elements to be filtered.");return"string"!=typeof t?Array.from(e):Array.from(e).filter(function(e){return 1===e.nodeType&&e.matches(t)})}var l=new Map,s=function(){function e(){this._config=new Map,this._placeholder=void 0,this._data=new Map}return Object.defineProperty(e.prototype,"config",{get:function(){var e={};return this._config.forEach(function(t,n){e[n]=t}),e},set:function(e){if("object"!=typeof e)throw new Error("You must provide a valid configuration object to the config setter.");var t=Object.assign({},e);this._config=new Map(Object.entries(t))},enumerable:!0,configurable:!0}),e.prototype.setConfig=function(e,t){if(!this._config.has(e))throw new Error("Trying to set invalid configuration item: "+e);this._config.set(e,t)},e.prototype.getConfig=function(e){if(!this._config.has(e))throw new Error("Invalid configuration item requested: "+e);return this._config.get(e)},Object.defineProperty(e.prototype,"placeholder",{get:function(){return this._placeholder},set:function(e){if(!(e instanceof HTMLElement)&&null!==e)throw new Error("A placeholder must be an html element or null.");this._placeholder=e},enumerable:!0,configurable:!0}),e.prototype.setData=function(e,t){if("string"!=typeof e)throw new Error("The key must be a string.");this._data.set(e,t)},e.prototype.getData=function(e){if("string"!=typeof e)throw new Error("The key must be a string.");return this._data.get(e)},e.prototype.deleteData=function(e){if("string"!=typeof e)throw new Error("The key must be a string.");return this._data.delete(e)},e}();function c(e){if(!(e instanceof HTMLElement))throw new Error("Please provide a sortable to the store function.");return l.has(e)||l.set(e,new s),l.get(e)}function u(e,t,n){if(e instanceof Array)for(var r=0;r<e.length;++r)u(e[r],t,n);else e.addEventListener(t,n),c(e).setData("event"+t,n)}function d(e,t){if(e instanceof Array)for(var n=0;n<e.length;++n)d(e[n],t);else e.removeEventListener(t,c(e).getData("event"+t)),c(e).deleteData("event"+t)}function f(e,t,n){if(e instanceof Array)for(var r=0;r<e.length;++r)f(e[r],t,n);else e.setAttribute(t,n)}function p(e,t){if(e instanceof Array)for(var n=0;n<e.length;++n)p(e[n],t);else e.removeAttribute(t)}function m(e){if(!e.parentElement||0===e.getClientRects().length)throw new Error("target element must be part of the dom");var t=e.getClientRects()[0];return{left:t.left+window.pageXOffset,right:t.right+window.pageXOffset,top:t.top+window.pageYOffset,bottom:t.bottom+window.pageYOffset}}function g(e,t){if(!(e instanceof HTMLElement&&(t instanceof NodeList||t instanceof HTMLCollection||t instanceof Array)))throw new Error("You must provide an element and a list of elements.");return Array.from(t).indexOf(e)}function h(e){if(!(e instanceof HTMLElement))throw new Error("Element is not a node element.");return null!==e.parentNode}var v=function(e,t,n){if(!(e instanceof HTMLElement&&e.parentElement instanceof HTMLElement))throw new Error("target and element must be a node");e.parentElement.insertBefore(t,"before"===n?e:e.nextElementSibling)},y=function(e,t){return v(e,t,"before")},b=function(e,t){return v(e,t,"after")};function E(e){if(!(e instanceof HTMLElement))throw new Error("You must provide a valid dom element");var t=window.getComputedStyle(e);return["height","padding-top","padding-bottom"].map(function(e){var n=parseInt(t.getPropertyValue(e),10);return isNaN(n)?0:n}).reduce(function(e,t){return e+t})}function w(e,t){if(!(e instanceof Array))throw new Error("You must provide a Array of HTMLElements to be filtered.");return"string"!=typeof t?e:e.filter(function(e){return e.querySelector(t)instanceof HTMLElement}).map(function(e){return e.querySelector(t)})}var C=function(e,t,n){return{element:e,posX:n.pageX-t.left,posY:n.pageY-t.top}};function L(e,t){if(!0===e.isSortable){var n=c(e).getConfig("acceptFrom");if(null!==n&&!1!==n&&"string"!=typeof n)throw new Error('HTML5Sortable: Wrong argument, "acceptFrom" must be "null", "false", or a valid selector string.');if(null!==n)return!1!==n&&n.split(",").filter(function(e){return e.length>0&&t.matches(e)}).length>0;if(e===t)return!0;if(void 0!==c(e).getConfig("connectWith")&&null!==c(e).getConfig("connectWith"))return c(e).getConfig("connectWith")===c(t).getConfig("connectWith")}return!1}var k,I,T,A,S,M,H,O={items:null,connectWith:null,disableIEFix:null,acceptFrom:null,copy:!1,placeholder:null,placeholderClass:"sortable-placeholder",draggingClass:"sortable-dragging",hoverClass:!1,debounce:0,throttleTime:100,maxItems:0,itemSerializer:void 0,containerSerializer:void 0,customDragImage:null};var D=function(e){d(e,"dragstart"),d(e,"dragend"),d(e,"dragover"),d(e,"dragenter"),d(e,"drop"),d(e,"mouseenter"),d(e,"mouseleave")},P=function(e,t){var n=e;return!0===c(t).getConfig("copy")&&(f(n=e.cloneNode(!0),"aria-copied","true"),e.parentElement.appendChild(n),n.style.display="none",n.oldDisplay=e.style.display),n};function x(e){for(;!0!==e.isSortable;)e=e.parentElement;return e}function j(e,t){var n=o(e,"opts"),r=a(e.children,n.items).filter(function(e){return e.contains(t)});return r.length>0?r[0]:t}var z=function(e){var t=o(e,"opts"),n=a(e.children,t.items),r=w(n,t.handle);f(e,"aria-dropeffect","move"),o(e,"_disabled","false"),f(r,"draggable","true"),!1===t.disableIEFix&&"function"==typeof(document||window.document).createElement("span").dragDrop&&u(r,"mousedown",function(){if(-1!==n.indexOf(this))this.dragDrop();else{for(var e=this.parentElement;-1===n.indexOf(e);)e=e.parentElement;e.dragDrop()}})},Y=function(e){var t=o(e,"opts"),n=a(e.children,t.items),r=w(n,t.handle);o(e,"_disabled","false"),D(n),d(r,"mousedown"),d(e,"dragover"),d(e,"dragenter"),d(e,"drop")};function _(e,t){var n=String(t);return t=Object.assign({connectWith:null,acceptFrom:null,copy:!1,placeholder:null,disableIEFix:null,placeholderClass:"sortable-placeholder",draggingClass:"sortable-dragging",hoverClass:!1,debounce:0,maxItems:0,itemSerializer:void 0,containerSerializer:void 0,customDragImage:null,items:null},"object"==typeof t?t:{}),"string"==typeof e&&(e=document.querySelectorAll(e)),e instanceof HTMLElement&&(e=[e]),e=Array.prototype.slice.call(e),/serialize/.test(n)?e.map(function(e){var t=o(e,"opts");return function(e,t,n){if(void 0===t&&(t=function(e,t){return e}),void 0===n&&(n=function(e){return e}),!(e instanceof HTMLElement)||1==!e.isSortable)throw new Error("You need to provide a sortableContainer to be serialized.");if("function"!=typeof t||"function"!=typeof n)throw new Error("You need to provide a valid serializer for items and the container.");var r=o(e,"opts").items,i=a(e.children,r),l=i.map(function(t){return{parent:e,node:t,html:t.outerHTML,index:g(t,i)}});return{container:n({node:e,itemCount:l.length}),items:l.map(function(n){return t(n,e)})}}(e,t.itemSerializer,t.containerSerializer)}):(e.forEach(function(e){if(/enable|disable|destroy/.test(n))return _[n](e);["connectWith","disableIEFix"].forEach(function(e){t.hasOwnProperty(e)&&null!==t[e]&&console.warn('HTML5Sortable: You are using the deprecated configuration "'+e+'". This will be removed in an upcoming version, make sure to migrate to the new options when updating.')}),t=Object.assign({},O,t),c(e).config=t,t=o(e,"opts")||t,o(e,"opts",t),e.isSortable=!0,Y(e);var r,i=a(e.children,t.items);if(null!==t.placeholder&&void 0!==t.placeholder){var s=document.createElement(e.tagName);s.innerHTML=t.placeholder,r=s.children[0]}c(e).placeholder=function(e,t,n){if(void 0===n&&(n="sortable-placeholder"),!(e instanceof HTMLElement))throw new Error("You must provide a valid element as a sortable.");if(!(t instanceof HTMLElement)&&void 0!==t)throw new Error("You must provide a valid element as a placeholder or set ot to undefined.");return void 0===t&&(["UL","OL"].includes(e.tagName)?t=document.createElement("li"):["TABLE","TBODY"].includes(e.tagName)?(t=document.createElement("tr")).innerHTML='<td colspan="100"></td>':t=document.createElement("div")),"string"==typeof n&&(r=t.classList).add.apply(r,n.split(" ")),t;var r}(e,r,t.placeholderClass),o(e,"items",t.items),t.acceptFrom?o(e,"acceptFrom",t.acceptFrom):t.connectWith&&o(e,"connectWith",t.connectWith),z(e),f(i,"role","option"),f(i,"aria-grabbed","false"),function(e,t){if("string"==typeof c(e).getConfig("hoverClass")){var n=c(e).getConfig("hoverClass").split(" ");!0===t?(u(e,"mousemove",function(e,t){var n=this;if(void 0===t&&(t=250),"number"!=typeof t)throw new Error("You must provide a number as the second argument for throttle.");var r=null;return function(){for(var i=[],o=0;o<arguments.length;o++)i[o-0]=arguments[o];var a=Date.now();(null===r||a-r>=t)&&(r=a,e.apply(n,i))}}(function(t){0===t.buttons&&a(e.children,c(e).getConfig("items")).forEach(function(e){var r,i;e!==t.target?(r=e.classList).remove.apply(r,n):(i=e.classList).add.apply(i,n)})},c(e).getConfig("throttleTime"))),u(e,"mouseleave",function(){a(e.children,c(e).getConfig("items")).forEach(function(e){var t;(t=e.classList).remove.apply(t,n)})})):(d(e,"mousemove"),d(e,"mouseleave"))}}(e,!0),u(e,"dragstart",function(e){if(!0!==e.target.isSortable&&(e.stopImmediatePropagation(),(!t.handle||e.target.matches(t.handle))&&"false"!==e.target.getAttribute("draggable"))){var n=x(e.target),r=j(n,e.target);M=a(n.children,t.items),A=M.indexOf(r),S=g(r,n.children),T=n,function(e,t,n){if(!(e instanceof Event))throw new Error("setDragImage requires a DragEvent as the first argument.");if(!(t instanceof HTMLElement))throw new Error("setDragImage requires the dragged element as the second argument.");if(n||(n=C),e.dataTransfer&&e.dataTransfer.setDragImage){var r=n(t,m(t),e);if(!(r.element instanceof HTMLElement)||"number"!=typeof r.posX||"number"!=typeof r.posY)throw new Error("The customDragImage function you provided must return and object with the properties element[string], posX[integer], posY[integer].");e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.setData("text/plain",e.target.id),e.dataTransfer.setDragImage(r.element,r.posX,r.posY)}}(e,r,t.customDragImage),I=E(r),r.classList.add(t.draggingClass),f(k=P(r,n),"aria-grabbed","true"),n.dispatchEvent(new CustomEvent("sortstart",{detail:{origin:{elementIndex:S,index:A,container:T},item:k}}))}}),u(e,"dragenter",function(t){if(!0!==t.target.isSortable){var n=x(t.target);H=a(n.children,o(n,"items")).filter(function(t){return t!==c(e).placeholder})}}),u(e,"dragend",function(n){if(k){k.classList.remove(t.draggingClass),f(k,"aria-grabbed","false"),"true"===k.getAttribute("aria-copied")&&"true"!==o(k,"dropped")&&k.remove(),k.style.display=k.oldDisplay,delete k.oldDisplay;var r=Array.from(l.values()).map(function(e){return e.placeholder}).filter(function(e){return e instanceof HTMLElement}).filter(h)[0];r&&r.remove(),e.dispatchEvent(new CustomEvent("sortstop",{detail:{origin:{elementIndex:S,index:A,container:T},item:k}})),k=null,I=null}}),u(e,"drop",function(n){if(L(e,k.parentElement)){n.preventDefault(),n.stopPropagation(),o(k,"dropped","true");var r=Array.from(l.values()).map(function(e){return e.placeholder}).filter(function(e){return e instanceof HTMLElement}).filter(h)[0];b(r,k),r.remove(),e.dispatchEvent(new CustomEvent("sortstop",{detail:{origin:{elementIndex:S,index:A,container:T},item:k}}));var i=c(e).placeholder,s=a(T.children,t.items).filter(function(e){return e!==i}),u=!0===this.isSortable?this:this.parentElement,d=a(u.children,o(u,"items")).filter(function(e){return e!==i}),f=g(k,Array.from(k.parentElement.children).filter(function(e){return e!==i})),p=g(k,d);S===f&&T===u||e.dispatchEvent(new CustomEvent("sortupdate",{detail:{origin:{elementIndex:S,index:A,container:T,itemsBeforeUpdate:M,items:s},destination:{index:p,elementIndex:f,container:u,itemsBeforeUpdate:H,items:d},item:k}}))}});var p,v,w,D=(p=function(e,n,r){if(k)if(t.forcePlaceholderSize&&(c(e).placeholder.style.height=I+"px"),Array.from(e.children).indexOf(n)>-1){var i=E(n),o=g(c(e).placeholder,n.parentElement.children),s=g(n,n.parentElement.children);if(i>I){var u=i-I,d=m(n).top;if(o<s&&r<d)return;if(o>s&&r>d+i-u)return}void 0===k.oldDisplay&&(k.oldDisplay=k.style.display),"none"!==k.style.display&&(k.style.display="none");var f=!1;try{f=r>=m(n).top+n.offsetHeight/2}catch(e){f=o<s}f?b(n,c(e).placeholder):y(n,c(e).placeholder),Array.from(l.values()).filter(function(e){return void 0!==e.placeholder}).forEach(function(t){t.placeholder!==c(e).placeholder&&t.placeholder.remove()})}else{var p=Array.from(l.values()).filter(function(e){return void 0!==e.placeholder}).map(function(e){return e.placeholder});-1!==p.indexOf(n)||e!==n||a(n.children,t.items).length||(p.forEach(function(e){return e.remove()}),n.appendChild(c(e).placeholder))}},void 0===(v=t.debounce)&&(v=0),function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];clearTimeout(w),w=setTimeout(function(){p.apply(void 0,e)},v)}),V=function(e){var t=e.target,n=!0===t.isSortable?t:x(t);if(t=j(n,t),k&&L(n,k.parentElement)&&"true"!==o(n,"_disabled")){var r=o(n,"opts");parseInt(r.maxItems)&&a(n.children,o(n,"items")).length>=parseInt(r.maxItems)&&k.parentElement!==n||(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=!0===c(n).getConfig("copy")?"copy":"move",D(n,t,e.pageY))}};u(i.concat(e),"dragover",V),u(i.concat(e),"dragenter",V)}),e)}_.destroy=function(e){!function(e){var t,n,r=o(e,"opts")||{},i=a(e.children,r.items),l=w(i,r.handle);d(e,"dragover"),d(e,"dragenter"),d(e,"drop"),(n=t=e).h5s&&delete n.h5s.data,p(t,"aria-dropeffect"),d(l,"mousedown"),D(i),function(e){p(e,"aria-grabbed"),p(e,"aria-copied"),p(e,"draggable"),p(e,"role")}(i)}(e)},_.enable=function(e){z(e)},_.disable=function(e){!function(e){var t=o(e,"opts"),n=w(a(e.children,t.items),t.handle);f(e,"aria-dropeffect","none"),o(e,"_disabled","true"),f(n,"draggable","false"),d(n,"mousedown")}(e)};var V=function(){function e(){var e=this;this.containerClass="ktc-variant-item-list",this.containerSortingClass="ktc-is-sorting",this.itemHoverClass="ktc-is-hovered",this.variants=[],this.onDeleteVariant=function(t,n){t.stopPropagation(),confirm(e.deleteConfirmationMessage)&&e.deleteVariant&&e.deleteVariant(n)},this.onEditButtonClick=function(t,n){t.stopPropagation(),e.editVariant&&e.editVariant(n)},this.onItemClick=function(t){t.key!==e.activeItemIdentifier&&e.selectVariant&&e.selectVariant(t)},this.removeHoveredClassesAfterDrag=function(){for(var t=e.hostElement.shadowRoot.querySelectorAll("."+e.itemHoverClass),n=0;n<t.length;n++)t[n].classList.remove(e.itemHoverClass)},this.addItemHoverClass=function(t){e.hostElement.shadowRoot.querySelector('[data-item-key="'+t.key+'"]').classList.add(e.itemHoverClass)},this.removeItemHoverClass=function(t){e.hostElement.shadowRoot.querySelector('[data-item-key="'+t.key+'"]').classList.remove(e.itemHoverClass)}}return Object.defineProperty(e.prototype,"deleteActionIconTitle",{get:function(){return this.getString(this.localizationService,"variant.delete")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"deleteConfirmationMessage",{get:function(){return this.getString(this.localizationService,"variant.delete.confirmation")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"editActionIconTitle",{get:function(){return this.getString(this.localizationService,"variant.edit")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dragTooltip",{get:function(){return this.getString(this.localizationService,"variant.drag.tooltip")},enumerable:!0,configurable:!0}),e.prototype.componentWillLoad=function(){this.items=this.variants},e.prototype.componentDidLoad=function(){var e=this;this.variantListing=this.hostElement.shadowRoot.querySelector("."+this.containerClass);var t=_(this.variantListing,{items:".ktc-variant-item--editable",placeholder:"<li data-"+this.hostElement.nodeName+"></li>"})[0];t.addEventListener("sortupdate",function(t){var n=t.detail.destination.items.map(function(e){return e.dataset.itemKey}).reverse();e.changeVariantsPriority&&e.changeVariantsPriority(n),e.removeHoveredClassesAfterDrag()}),t.addEventListener("sortstart",function(){return e.variantListing.classList.add(e.containerSortingClass)}),t.addEventListener("sortstop",function(){return e.variantListing.classList.remove(e.containerSortingClass)})},e.prototype.componentDidUnload=function(){_(this.variantListing,"destroy")},e.prototype.render=function(){var e=this;return n("ul",{class:this.containerClass},this.items.map(function(t){return n("li",{onClick:function(){return e.onItemClick(t)},class:{"ktc-variant-item":!0,"ktc-variant-item--active":t.key===e.activeItemIdentifier,"ktc-variant-item--editable":t.renderActionButtons},"data-item-key":t.key,onMouseEnter:function(){return e.addItemHoverClass(t)},onMouseLeave:function(){return e.removeItemHoverClass(t)}},t.renderActionButtons&&n("div",{class:"ktc-drag-icon"},n("i",{"aria-hidden":"true",title:e.dragTooltip,class:"icon-dots-vertical"})),n("div",{class:"ktc-variant-item-label",title:t.name},t.name),t.renderActionButtons&&n("div",{class:"ktc-variant-action-icons"},n("a",{class:"ktc-variant-action-icon"},n("i",{"aria-hidden":"true",class:"icon-edit",title:e.editActionIconTitle,onClick:function(n){return e.onEditButtonClick(n,t)}})),n("a",{class:"ktc-variant-action-icon"},n("i",{"aria-hidden":"true",class:"icon-bin",title:e.deleteActionIconTitle,onClick:function(n){return e.onDeleteVariant(n,t.key)}}))))}))},Object.defineProperty(e,"is",{get:function(){return"kentico-variant-listing"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"encapsulation",{get:function(){return"shadow"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"properties",{get:function(){return{activeItemIdentifier:{type:String,attr:"active-item-identifier"},changeVariantsPriority:{type:"Any",attr:"change-variants-priority"},deleteVariant:{type:"Any",attr:"delete-variant"},editVariant:{type:"Any",attr:"edit-variant"},getString:{context:"getString"},hostElement:{elementRef:!0},localizationService:{type:"Any",attr:"localization-service"},selectVariant:{type:"Any",attr:"select-variant"},variants:{type:"Any",attr:"variants"}}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"style",{get:function(){return"[data-kentico-variant-listing-host] [class*=\" icon-\"][data-kentico-variant-listing], [data-kentico-variant-listing-host] [class^=icon-][data-kentico-variant-listing]{font-family:Core-icons;display:inline-block;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;font-size:16px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background-image:none}[data-kentico-variant-listing-host] [class^=icon-][data-kentico-variant-listing]:before{content:\"\\e619\"}[data-kentico-variant-listing-host] .ktc-icon-only[data-kentico-variant-listing]:before{content:none}[data-kentico-variant-listing-host] .icon-arrow-right-top-square[data-kentico-variant-listing]:before{content:\"\\e6d8\"}[data-kentico-variant-listing-host] .icon-brand-mstranslator[data-kentico-variant-listing]:before{content:\"\\e90c\"}[data-kentico-variant-listing-host] .icon-brand-google[data-kentico-variant-listing]:before{content:\"\\e6c8\"}[data-kentico-variant-listing-host] .icon-brand-google-plus[data-kentico-variant-listing]:before{content:\"\\e6e6\"}[data-kentico-variant-listing-host] .icon-piechart[data-kentico-variant-listing]:before{content:\"\\e631\"}[data-kentico-variant-listing-host] .icon-arrow-curved-left[data-kentico-variant-listing]:before{content:\"\\e908\"}[data-kentico-variant-listing-host] .icon-arrow-curved-right[data-kentico-variant-listing]:before{content:\"\\e909\"}[data-kentico-variant-listing-host] .icon-two-rectangles-stacked[data-kentico-variant-listing]:before{content:\"\\e90b\"}[data-kentico-variant-listing-host] .icon-rb-check[data-kentico-variant-listing]:before{content:\"\\e907\"}[data-kentico-variant-listing-host] .icon-octothorpe[data-kentico-variant-listing]:before{content:\"\\e904\"}[data-kentico-variant-listing-host] .icon-paragraph[data-kentico-variant-listing]:before{content:\"\\e905\"}[data-kentico-variant-listing-host] .icon-paragraph-short[data-kentico-variant-listing]:before{content:\"\\e906\"}[data-kentico-variant-listing-host] .icon-brand-instagram[data-kentico-variant-listing]:before{content:\"\\e903\"}[data-kentico-variant-listing-host] .icon-cb-check[data-kentico-variant-listing]:before{content:\"\\e902\"}[data-kentico-variant-listing-host] .icon-arrow-leave-square[data-kentico-variant-listing]:before{content:\"\\e800\"}[data-kentico-variant-listing-host] .icon-arrow-enter-square[data-kentico-variant-listing]:before{content:\"\\e801\"}[data-kentico-variant-listing-host] .icon-scheme-connected-circles[data-kentico-variant-listing]:before{content:\"\\e802\"}[data-kentico-variant-listing-host] .icon-scheme-path-circles[data-kentico-variant-listing]:before{content:\"\\e803\"}[data-kentico-variant-listing-host] .icon-dots-vertical[data-kentico-variant-listing]:before{content:\"\\e75d\"}[data-kentico-variant-listing-host] .icon-chain[data-kentico-variant-listing]:before{content:\"\\e67f\"}[data-kentico-variant-listing-host] .icon-chain-slash[data-kentico-variant-listing]:before{content:\"\\e691\"}[data-kentico-variant-listing-host] .icon-list-bullets[data-kentico-variant-listing]:before{content:\"\\e754\"}[data-kentico-variant-listing-host] .icon-list-numbers[data-kentico-variant-listing]:before{content:\"\\e75b\"}[data-kentico-variant-listing-host] .icon-eye-slash[data-kentico-variant-listing]:before{content:\"\\e75c\"}[data-kentico-variant-listing-host] .icon-arrow-u-right[data-kentico-variant-listing]:before{content:\"\\e703\"}[data-kentico-variant-listing-host] .icon-arrow-u-left[data-kentico-variant-listing]:before{content:\"\\e677\"}[data-kentico-variant-listing-host] .icon-arrow-down[data-kentico-variant-listing]:before{content:\"\\e682\"}[data-kentico-variant-listing-host] .icon-arrow-up[data-kentico-variant-listing]:before{content:\"\\e64c\"}[data-kentico-variant-listing-host] .icon-arrow-left[data-kentico-variant-listing]:before{content:\"\\e6dc\"}[data-kentico-variant-listing-host] .icon-arrow-right[data-kentico-variant-listing]:before{content:\"\\e6da\"}[data-kentico-variant-listing-host] .icon-arrow-down-circle[data-kentico-variant-listing]:before{content:\"\\e6ae\"}[data-kentico-variant-listing-host] .icon-arrow-left-circle[data-kentico-variant-listing]:before{content:\"\\e6af\"}[data-kentico-variant-listing-host] .icon-arrow-right-circle[data-kentico-variant-listing]:before{content:\"\\e6b1\"}[data-kentico-variant-listing-host] .icon-arrow-up-circle[data-kentico-variant-listing]:before{content:\"\\e6bf\"}[data-kentico-variant-listing-host] .icon-arrow-left-rect[data-kentico-variant-listing]:before{content:\"\\e6db\"}[data-kentico-variant-listing-host] .icon-arrow-right-rect[data-kentico-variant-listing]:before{content:\"\\e6d9\"}[data-kentico-variant-listing-host] .icon-arrow-crooked-left[data-kentico-variant-listing]:before{content:\"\\e6e0\"}[data-kentico-variant-listing-host] .icon-arrow-crooked-right[data-kentico-variant-listing]:before{content:\"\\e6e1\"}[data-kentico-variant-listing-host] .icon-arrow-double-left[data-kentico-variant-listing]:before{content:\"\\e6df\"}[data-kentico-variant-listing-host] .icon-arrow-double-right[data-kentico-variant-listing]:before{content:\"\\e6de\"}[data-kentico-variant-listing-host] .icon-arrow-down-line[data-kentico-variant-listing]:before{content:\"\\e6dd\"}[data-kentico-variant-listing-host] .icon-arrow-up-line[data-kentico-variant-listing]:before{content:\"\\e6d3\"}[data-kentico-variant-listing-host] .icon-arrows[data-kentico-variant-listing]:before{content:\"\\e6d7\"}[data-kentico-variant-listing-host] .icon-arrows-h[data-kentico-variant-listing]:before{content:\"\\e6d5\"}[data-kentico-variant-listing-host] .icon-arrows-v[data-kentico-variant-listing]:before{content:\"\\e6d4\"}[data-kentico-variant-listing-host] .icon-magnifier[data-kentico-variant-listing]:before{content:\"\\e657\"}[data-kentico-variant-listing-host] .icon-magnifier-minus[data-kentico-variant-listing]:before{content:\"\\e656\"}[data-kentico-variant-listing-host] .icon-magnifier-plus[data-kentico-variant-listing]:before{content:\"\\e655\"}[data-kentico-variant-listing-host] .icon-minus[data-kentico-variant-listing]:before{content:\"\\e73f\"}[data-kentico-variant-listing-host] .icon-loop[data-kentico-variant-listing]:before{content:\"\\e600\"}[data-kentico-variant-listing-host] .icon-merge[data-kentico-variant-listing]:before{content:\"\\e709\"}[data-kentico-variant-listing-host] .icon-separate[data-kentico-variant-listing]:before{content:\"\\e70a\"}[data-kentico-variant-listing-host] .icon-scheme-circles-triangle[data-kentico-variant-listing]:before{content:\"\\e73e\"}[data-kentico-variant-listing-host] .icon-market[data-kentico-variant-listing]:before{content:\"\\e68e\"}[data-kentico-variant-listing-host] .icon-bubble-o[data-kentico-variant-listing]:before{content:\"\\e6f3\"}[data-kentico-variant-listing-host] .icon-bubble-times[data-kentico-variant-listing]:before{content:\"\\e6f2\"}[data-kentico-variant-listing-host] .icon-clapperboard[data-kentico-variant-listing]:before{content:\"\\e636\"}[data-kentico-variant-listing-host] .icon-collapse[data-kentico-variant-listing]:before{content:\"\\e745\"}[data-kentico-variant-listing-host] .icon-collapse-scheme[data-kentico-variant-listing]:before{content:\"\\e700\"}[data-kentico-variant-listing-host] .icon-dialog-window[data-kentico-variant-listing]:before{content:\"\\e6ff\"}[data-kentico-variant-listing-host] .icon-dialog-window-cogwheel[data-kentico-variant-listing]:before{content:\"\\e71a\"}[data-kentico-variant-listing-host] .icon-doc-ban-sign[data-kentico-variant-listing]:before{content:\"\\e6ef\"}[data-kentico-variant-listing-host] .icon-doc-o[data-kentico-variant-listing]:before{content:\"\\e69c\"}[data-kentico-variant-listing-host] .icon-doc-user[data-kentico-variant-listing]:before{content:\"\\e714\"}[data-kentico-variant-listing-host] .icon-expand[data-kentico-variant-listing]:before{content:\"\\e744\"}[data-kentico-variant-listing-host] .icon-file[data-kentico-variant-listing]:before{content:\"\\e719\"}[data-kentico-variant-listing-host] .icon-folder-belt[data-kentico-variant-listing]:before{content:\"\\e715\"}[data-kentico-variant-listing-host] .icon-folder-o[data-kentico-variant-listing]:before{content:\"\\e68b\"}[data-kentico-variant-listing-host] .icon-hat-moustache[data-kentico-variant-listing]:before{content:\"\\e75a\"}[data-kentico-variant-listing-host] .icon-key[data-kentico-variant-listing]:before{content:\"\\e65e\"}[data-kentico-variant-listing-host] .icon-rectangle-a[data-kentico-variant-listing]:before{content:\"\\e61e\"}[data-kentico-variant-listing-host] .icon-rectangle-a-o[data-kentico-variant-listing]:before{content:\"\\e623\"}[data-kentico-variant-listing-host] .icon-rectangle-o-h[data-kentico-variant-listing]:before{content:\"\\e758\"}[data-kentico-variant-listing-host] .icon-rectangle-o-v[data-kentico-variant-listing]:before{content:\"\\e759\"}[data-kentico-variant-listing-host] .icon-rectangle-paragraph[data-kentico-variant-listing]:before{content:\"\\e625\"}[data-kentico-variant-listing-host] .icon-tab[data-kentico-variant-listing]:before{content:\"\\e6fb\"}[data-kentico-variant-listing-host] .icon-graduate-cap[data-kentico-variant-listing]:before{content:\"\\e713\"}[data-kentico-variant-listing-host] .icon-clipboard-list[data-kentico-variant-listing]:before{content:\"\\e6a9\"}[data-kentico-variant-listing-host] .icon-user-checkbox[data-kentico-variant-listing]:before{content:\"\\e603\"}[data-kentico-variant-listing-host] .icon-box-cart[data-kentico-variant-listing]:before{content:\"\\e6cd\"}[data-kentico-variant-listing-host] .icon-bubble-censored[data-kentico-variant-listing]:before{content:\"\\e6c2\"}[data-kentico-variant-listing-host] .icon-drawers[data-kentico-variant-listing]:before{content:\"\\e699\"}[data-kentico-variant-listing-host] .icon-earth[data-kentico-variant-listing]:before{content:\"\\e698\"}[data-kentico-variant-listing-host] .icon-form[data-kentico-variant-listing]:before{content:\"\\e689\"}[data-kentico-variant-listing-host] .icon-invoice[data-kentico-variant-listing]:before{content:\"\\e660\"}[data-kentico-variant-listing-host] .icon-mug[data-kentico-variant-listing]:before{content:\"\\e644\"}[data-kentico-variant-listing-host] .icon-square-dashed-line[data-kentico-variant-listing]:before{content:\"\\e617\"}[data-kentico-variant-listing-host] .icon-briefcase[data-kentico-variant-listing]:before{content:\"\\e6c6\"}[data-kentico-variant-listing-host] .icon-funnel[data-kentico-variant-listing]:before{content:\"\\e687\"}[data-kentico-variant-listing-host] .icon-map[data-kentico-variant-listing]:before{content:\"\\e654\"}[data-kentico-variant-listing-host] .icon-notebook[data-kentico-variant-listing]:before{content:\"\\e642\"}[data-kentico-variant-listing-host] .icon-user-frame[data-kentico-variant-listing]:before{content:\"\\e604\"}[data-kentico-variant-listing-host] .icon-clipboard-checklist[data-kentico-variant-listing]:before{content:\"\\e6aa\"}[data-kentico-variant-listing-host] .icon-pictures[data-kentico-variant-listing]:before{content:\"\\e632\"}[data-kentico-variant-listing-host] .icon-flag[data-kentico-variant-listing]:before{content:\"\\e68f\"}[data-kentico-variant-listing-host] .icon-folder[data-kentico-variant-listing]:before{content:\"\\e68d\"}[data-kentico-variant-listing-host] .icon-folder-opened[data-kentico-variant-listing]:before{content:\"\\e68a\"}[data-kentico-variant-listing-host] .icon-picture[data-kentico-variant-listing]:before{content:\"\\e633\"}[data-kentico-variant-listing-host] .icon-bin[data-kentico-variant-listing]:before{content:\"\\e6d0\"}[data-kentico-variant-listing-host] .icon-bubble[data-kentico-variant-listing]:before{content:\"\\e6c3\"}[data-kentico-variant-listing-host] .icon-doc[data-kentico-variant-listing]:before{content:\"\\e69f\"}[data-kentico-variant-listing-host] .icon-doc-move[data-kentico-variant-listing]:before{content:\"\\e69d\"}[data-kentico-variant-listing-host] .icon-edit[data-kentico-variant-listing]:before{content:\"\\e696\"}[data-kentico-variant-listing-host] .icon-menu[data-kentico-variant-listing]:before{content:\"\\e650\"}[data-kentico-variant-listing-host] .icon-message[data-kentico-variant-listing]:before{content:\"\\e64f\"}[data-kentico-variant-listing-host] .icon-user[data-kentico-variant-listing]:before{content:\"\\e605\"}[data-kentico-variant-listing-host] .icon-monitor-broken[data-kentico-variant-listing]:before{content:\"\\e70b\"}[data-kentico-variant-listing-host] .icon-monitor[data-kentico-variant-listing]:before{content:\"\\e646\"}[data-kentico-variant-listing-host] .icon-chevron-down-line[data-kentico-variant-listing]:before{content:\"\\e6c0\"}[data-kentico-variant-listing-host] .icon-chevron-left-line[data-kentico-variant-listing]:before{content:\"\\e6d6\"}[data-kentico-variant-listing-host] .icon-chevron-right-line[data-kentico-variant-listing]:before{content:\"\\e6e2\"}[data-kentico-variant-listing-host] .icon-chevron-up-line[data-kentico-variant-listing]:before{content:\"\\e6ee\"}[data-kentico-variant-listing-host] .icon-pin-o[data-kentico-variant-listing]:before{content:\"\\e705\"}[data-kentico-variant-listing-host] .icon-brand-sharepoint[data-kentico-variant-listing]:before{content:\"\\e707\"}[data-kentico-variant-listing-host] .icon-heartshake[data-kentico-variant-listing]:before{content:\"\\e681\"}[data-kentico-variant-listing-host] .icon-pin[data-kentico-variant-listing]:before{content:\"\\e71e\"}[data-kentico-variant-listing-host] .icon-checklist[data-kentico-variant-listing]:before{content:\"\\e61b\"}[data-kentico-variant-listing-host] .icon-watch[data-kentico-variant-listing]:before{content:\"\\e601\"}[data-kentico-variant-listing-host] .icon-permission-list[data-kentico-variant-listing]:before{content:\"\\e634\"}[data-kentico-variant-listing-host] .icon-users[data-kentico-variant-listing]:before{content:\"\\e602\"}[data-kentico-variant-listing-host] .icon-brand-youtube[data-kentico-variant-listing]:before{content:\"\\e659\"}[data-kentico-variant-listing-host] .icon-brand-pinterest[data-kentico-variant-listing]:before{content:\"\\e6e3\"}[data-kentico-variant-listing-host] .icon-brand-open-id[data-kentico-variant-listing]:before{content:\"\\e6e4\"}[data-kentico-variant-listing-host] .icon-two-rectangles-v[data-kentico-variant-listing]:before{content:\"\\e606\"}[data-kentico-variant-listing-host] .icon-brand-linkedin[data-kentico-variant-listing]:before{content:\"\\e6e5\"}[data-kentico-variant-listing-host] .icon-two-rectangles-h[data-kentico-variant-listing]:before{content:\"\\e607\"}[data-kentico-variant-listing-host] .icon-t-shirt[data-kentico-variant-listing]:before{content:\"\\e608\"}[data-kentico-variant-listing-host] .icon-xml-tag[data-kentico-variant-listing]:before{content:\"\\e6e7\"}[data-kentico-variant-listing-host] .icon-truck[data-kentico-variant-listing]:before{content:\"\\e609\"}[data-kentico-variant-listing-host] .icon-trophy[data-kentico-variant-listing]:before{content:\"\\e60a\"}[data-kentico-variant-listing-host] .icon-rss[data-kentico-variant-listing]:before{content:\"\\e6e9\"}[data-kentico-variant-listing-host] .icon-triangle-right[data-kentico-variant-listing]:before{content:\"\\e60b\"}[data-kentico-variant-listing-host] .icon-restriction-list[data-kentico-variant-listing]:before{content:\"\\e6ea\"}[data-kentico-variant-listing-host] .icon-translate[data-kentico-variant-listing]:before{content:\"\\e60c\"}[data-kentico-variant-listing-host] .icon-qr-code[data-kentico-variant-listing]:before{content:\"\\e6eb\"}[data-kentico-variant-listing-host] .icon-times-circle[data-kentico-variant-listing]:before{content:\"\\e60d\"}[data-kentico-variant-listing-host] .icon-lock-unlocked[data-kentico-variant-listing]:before{content:\"\\e6ec\"}[data-kentico-variant-listing-host] .icon-times[data-kentico-variant-listing]:before{content:\"\\e60e\"}[data-kentico-variant-listing-host] .icon-dollar-sign[data-kentico-variant-listing]:before{content:\"\\e6ed\"}[data-kentico-variant-listing-host] .icon-tag[data-kentico-variant-listing]:before{content:\"\\e60f\"}[data-kentico-variant-listing-host] .icon-tablet[data-kentico-variant-listing]:before{content:\"\\e610\"}[data-kentico-variant-listing-host] .icon-cb-check-disabled[data-kentico-variant-listing]:before{content:\"\\e6f0\"}[data-kentico-variant-listing-host] .icon-table[data-kentico-variant-listing]:before{content:\"\\e612\"}[data-kentico-variant-listing-host] .icon-carousel[data-kentico-variant-listing]:before{content:\"\\e6f1\"}[data-kentico-variant-listing-host] .icon-star-full[data-kentico-variant-listing]:before{content:\"\\e614\"}[data-kentico-variant-listing-host] .icon-star-semi[data-kentico-variant-listing]:before{content:\"\\e613\"}[data-kentico-variant-listing-host] .icon-star-empty[data-kentico-variant-listing]:before{content:\"\\e615\"}[data-kentico-variant-listing-host] .icon-arrows-crooked[data-kentico-variant-listing]:before{content:\"\\e6f4\"}[data-kentico-variant-listing-host] .icon-staging-scheme[data-kentico-variant-listing]:before{content:\"\\e616\"}[data-kentico-variant-listing-host] .icon-shopping-cart[data-kentico-variant-listing]:before{content:\"\\e6f5\"}[data-kentico-variant-listing-host] .icon-highlighter[data-kentico-variant-listing]:before{content:\"\\e6f6\"}[data-kentico-variant-listing-host] .icon-square-dashed[data-kentico-variant-listing]:before{content:\"\\e618\"}[data-kentico-variant-listing-host] .icon-cookie[data-kentico-variant-listing]:before{content:\"\\e6f7\"}[data-kentico-variant-listing-host] .icon-square[data-kentico-variant-listing]:before{content:\"\\e619\"}[data-kentico-variant-listing-host] .icon-software-package[data-kentico-variant-listing]:before{content:\"\\e61c\"}[data-kentico-variant-listing-host] .icon-smartphone[data-kentico-variant-listing]:before{content:\"\\e61d\"}[data-kentico-variant-listing-host] .icon-scissors[data-kentico-variant-listing]:before{content:\"\\e61f\"}[data-kentico-variant-listing-host] .icon-rotate-right[data-kentico-variant-listing]:before{content:\"\\e620\"}[data-kentico-variant-listing-host] .icon-rotate-left[data-kentico-variant-listing]:before{content:\"\\e621\"}[data-kentico-variant-listing-host] .icon-rotate-double-right[data-kentico-variant-listing]:before{content:\"\\e622\"}[data-kentico-variant-listing-host] .icon-ribbon[data-kentico-variant-listing]:before{content:\"\\e624\"}[data-kentico-variant-listing-host] .icon-rb-uncheck[data-kentico-variant-listing]:before{content:\"\\e626\"}[data-kentico-variant-listing-host] .icon-rb-check-sign[data-kentico-variant-listing]:before{content:\"\\e627\"}[data-kentico-variant-listing-host] .icon-question-circle[data-kentico-variant-listing]:before{content:\"\\e629\"}[data-kentico-variant-listing-host] .icon-project-scheme[data-kentico-variant-listing]:before{content:\"\\e62b\"}[data-kentico-variant-listing-host] .icon-process-scheme[data-kentico-variant-listing]:before{content:\"\\e62c\"}[data-kentico-variant-listing-host] .icon-plus-square[data-kentico-variant-listing]:before{content:\"\\e62d\"}[data-kentico-variant-listing-host] .icon-plus-circle[data-kentico-variant-listing]:before{content:\"\\e62e\"}[data-kentico-variant-listing-host] .icon-plus[data-kentico-variant-listing]:before{content:\"\\e62f\"}[data-kentico-variant-listing-host] .icon-placeholder[data-kentico-variant-listing]:before{content:\"\\e630\"}[data-kentico-variant-listing-host] .icon-perfume[data-kentico-variant-listing]:before{content:\"\\e635\"}[data-kentico-variant-listing-host] .icon-percent-sign[data-kentico-variant-listing]:before{content:\"\\e638\"}[data-kentico-variant-listing-host] .icon-pda[data-kentico-variant-listing]:before{content:\"\\e639\"}[data-kentico-variant-listing-host] .icon-pc[data-kentico-variant-listing]:before{content:\"\\e63a\"}[data-kentico-variant-listing-host] .icon-pause[data-kentico-variant-listing]:before{content:\"\\e63b\"}[data-kentico-variant-listing-host] .icon-parent-children-scheme[data-kentico-variant-listing]:before{content:\"\\e63c\"}[data-kentico-variant-listing-host] .icon-paperclip[data-kentico-variant-listing]:before{content:\"\\e63d\"}[data-kentico-variant-listing-host] .icon-pants[data-kentico-variant-listing]:before{content:\"\\e63e\"}[data-kentico-variant-listing-host] .icon-palette[data-kentico-variant-listing]:before{content:\"\\e63f\"}[data-kentico-variant-listing-host] .icon-organisational-scheme[data-kentico-variant-listing]:before{content:\"\\e640\"}[data-kentico-variant-listing-host] .icon-newspaper[data-kentico-variant-listing]:before{content:\"\\e643\"}[data-kentico-variant-listing-host] .icon-monitor-smartphone[data-kentico-variant-listing]:before{content:\"\\e645\"}[data-kentico-variant-listing-host] .icon-modal-question[data-kentico-variant-listing]:before{content:\"\\e647\"}[data-kentico-variant-listing-host] .icon-modal-minimize[data-kentico-variant-listing]:before{content:\"\\e648\"}[data-kentico-variant-listing-host] .icon-modal-maximize[data-kentico-variant-listing]:before{content:\"\\e649\"}[data-kentico-variant-listing-host] .icon-modal-close[data-kentico-variant-listing]:before{content:\"\\e64a\"}[data-kentico-variant-listing-host] .icon-minus-circle[data-kentico-variant-listing]:before{content:\"\\e64b\"}[data-kentico-variant-listing-host] .icon-microphone[data-kentico-variant-listing]:before{content:\"\\e64d\"}[data-kentico-variant-listing-host] .icon-messages[data-kentico-variant-listing]:before{content:\"\\e64e\"}[data-kentico-variant-listing-host] .icon-media-player[data-kentico-variant-listing]:before{content:\"\\e651\"}[data-kentico-variant-listing-host] .icon-mask[data-kentico-variant-listing]:before{content:\"\\e652\"}[data-kentico-variant-listing-host] .icon-map-marker[data-kentico-variant-listing]:before{content:\"\\e653\"}[data-kentico-variant-listing-host] .icon-lock[data-kentico-variant-listing]:before{content:\"\\e658\"}[data-kentico-variant-listing-host] .icon-life-belt[data-kentico-variant-listing]:before{content:\"\\e65a\"}[data-kentico-variant-listing-host] .icon-laptop[data-kentico-variant-listing]:before{content:\"\\e65d\"}[data-kentico-variant-listing-host] .icon-kentico[data-kentico-variant-listing]:before{content:\"\\e65f\"}[data-kentico-variant-listing-host] .icon-integration-scheme[data-kentico-variant-listing]:before{content:\"\\e661\"}[data-kentico-variant-listing-host] .icon-i-circle[data-kentico-variant-listing]:before{content:\"\\e664\"}[data-kentico-variant-listing-host] .icon-chevron-up-square[data-kentico-variant-listing]:before{content:\"\\e665\"}[data-kentico-variant-listing-host] .icon-chevron-up-circle[data-kentico-variant-listing]:before{content:\"\\e666\"}[data-kentico-variant-listing-host] .icon-chevron-up[data-kentico-variant-listing]:before{content:\"\\e667\"}[data-kentico-variant-listing-host] .icon-chevron-right-square[data-kentico-variant-listing]:before{content:\"\\e668\"}[data-kentico-variant-listing-host] .icon-chevron-right[data-kentico-variant-listing]:before{content:\"\\e669\"}[data-kentico-variant-listing-host] .icon-chevron-left-square[data-kentico-variant-listing]:before{content:\"\\e66a\"}[data-kentico-variant-listing-host] .icon-chevron-left-circle[data-kentico-variant-listing]:before{content:\"\\e66b\"}[data-kentico-variant-listing-host] .icon-chevron-left[data-kentico-variant-listing]:before{content:\"\\e66c\"}[data-kentico-variant-listing-host] .icon-chevron-down-square[data-kentico-variant-listing]:before{content:\"\\e66d\"}[data-kentico-variant-listing-host] .icon-chevron-down-circle[data-kentico-variant-listing]:before{content:\"\\e66e\"}[data-kentico-variant-listing-host] .icon-chevron-down[data-kentico-variant-listing]:before{content:\"\\e66f\"}[data-kentico-variant-listing-host] .icon-chevron-double-up[data-kentico-variant-listing]:before{content:\"\\e670\"}[data-kentico-variant-listing-host] .icon-chevron-double-right[data-kentico-variant-listing]:before{content:\"\\e671\"}[data-kentico-variant-listing-host] .icon-chevron-double-left[data-kentico-variant-listing]:before{content:\"\\e672\"}[data-kentico-variant-listing-host] .icon-chevron-double-down[data-kentico-variant-listing]:before{content:\"\\e673\"}[data-kentico-variant-listing-host] .icon-checklist2[data-kentico-variant-listing]:before{content:\"\\e674\"}[data-kentico-variant-listing-host] .icon-check-circle[data-kentico-variant-listing]:before{content:\"\\e675\"}[data-kentico-variant-listing-host] .icon-check[data-kentico-variant-listing]:before{content:\"\\e676\"}[data-kentico-variant-listing-host] .icon-tags[data-kentico-variant-listing]:before{content:\"\\e678\"}[data-kentico-variant-listing-host] .icon-shoe-women[data-kentico-variant-listing]:before{content:\"\\e679\"}[data-kentico-variant-listing-host] .icon-printer[data-kentico-variant-listing]:before{content:\"\\e67a\"}[data-kentico-variant-listing-host] .icon-parent-child-scheme[data-kentico-variant-listing]:before{content:\"\\e67b\"}[data-kentico-variant-listing-host] .icon-minus-square[data-kentico-variant-listing]:before{content:\"\\e67c\"}[data-kentico-variant-listing-host] .icon-light-bulb[data-kentico-variant-listing]:before{content:\"\\e67d\"}[data-kentico-variant-listing-host] .icon-chevron-right-circle[data-kentico-variant-listing]:before{content:\"\\e67e\"}[data-kentico-variant-listing-host] .icon-home[data-kentico-variant-listing]:before{content:\"\\e680\"}[data-kentico-variant-listing-host] .icon-half-arrows-right-left[data-kentico-variant-listing]:before{content:\"\\e683\"}[data-kentico-variant-listing-host] .icon-graph[data-kentico-variant-listing]:before{content:\"\\e684\"}[data-kentico-variant-listing-host] .icon-factory[data-kentico-variant-listing]:before{content:\"\\e690\"}[data-kentico-variant-listing-host] .icon-exclamation-triangle[data-kentico-variant-listing]:before{content:\"\\e693\"}[data-kentico-variant-listing-host] .icon-ellipsis[data-kentico-variant-listing]:before{content:\"\\e694\"}[data-kentico-variant-listing-host] .icon-ekg-line[data-kentico-variant-listing]:before{content:\"\\e695\"}[data-kentico-variant-listing-host] .icon-doc-paste[data-kentico-variant-listing]:before{content:\"\\e69a\"}[data-kentico-variant-listing-host] .icon-doc-copy[data-kentico-variant-listing]:before{content:\"\\e69e\"}[data-kentico-variant-listing-host] .icon-database[data-kentico-variant-listing]:before{content:\"\\e6a0\"}[data-kentico-variant-listing-host] .icon-cup[data-kentico-variant-listing]:before{content:\"\\e6a2\"}[data-kentico-variant-listing-host] .icon-compass[data-kentico-variant-listing]:before{content:\"\\e6a4\"}[data-kentico-variant-listing-host] .icon-cogwheel-square[data-kentico-variant-listing]:before{content:\"\\e6a5\"}[data-kentico-variant-listing-host] .icon-cogwheels[data-kentico-variant-listing]:before{content:\"\\e6a6\"}[data-kentico-variant-listing-host] .icon-cogwheel[data-kentico-variant-listing]:before{content:\"\\e6a7\"}[data-kentico-variant-listing-host] .icon-circle-square[data-kentico-variant-listing]:before{content:\"\\e6ab\"}[data-kentico-variant-listing-host] .icon-circle[data-kentico-variant-listing]:before{content:\"\\e6ac\"}[data-kentico-variant-listing-host] .icon-cb-uncheck[data-kentico-variant-listing]:before{content:\"\\e6ad\"}[data-kentico-variant-listing-host] .icon-cb-check-sign[data-kentico-variant-listing]:before{content:\"\\e6b0\"}[data-kentico-variant-listing-host] .icon-caret-up[data-kentico-variant-listing]:before{content:\"\\e6b2\"}[data-kentico-variant-listing-host] .icon-caret-right-down[data-kentico-variant-listing]:before{content:\"\\e6b3\"}[data-kentico-variant-listing-host] .icon-caret-right[data-kentico-variant-listing]:before{content:\"\\e6b4\"}[data-kentico-variant-listing-host] .icon-caret-left[data-kentico-variant-listing]:before{content:\"\\e6b5\"}[data-kentico-variant-listing-host] .icon-caret-down[data-kentico-variant-listing]:before{content:\"\\e6b6\"}[data-kentico-variant-listing-host] .icon-camera[data-kentico-variant-listing]:before{content:\"\\e6b7\"}[data-kentico-variant-listing-host] .icon-calendar-number[data-kentico-variant-listing]:before{content:\"\\e6b8\"}[data-kentico-variant-listing-host] .icon-calendar[data-kentico-variant-listing]:before{content:\"\\e6b9\"}[data-kentico-variant-listing-host] .icon-bullseye[data-kentico-variant-listing]:before{content:\"\\e6ba\"}[data-kentico-variant-listing-host] .icon-building-block[data-kentico-variant-listing]:before{content:\"\\e6bb\"}[data-kentico-variant-listing-host] .icon-building[data-kentico-variant-listing]:before{content:\"\\e6bc\"}[data-kentico-variant-listing-host] .icon-bug[data-kentico-variant-listing]:before{content:\"\\e6bd\"}[data-kentico-variant-listing-host] .icon-bucket-shovel[data-kentico-variant-listing]:before{content:\"\\e6be\"}[data-kentico-variant-listing-host] .icon-bubbles[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-brush[data-kentico-variant-listing]:before{content:\"\\e6c4\"}[data-kentico-variant-listing-host] .icon-broom[data-kentico-variant-listing]:before{content:\"\\e6c5\"}[data-kentico-variant-listing-host] .icon-brand-twitter[data-kentico-variant-listing]:before{content:\"\\e6c7\"}[data-kentico-variant-listing-host] .icon-brand-facebook[data-kentico-variant-listing]:before{content:\"\\e6c9\"}[data-kentico-variant-listing-host] .icon-brand-bing[data-kentico-variant-listing]:before{content:\"\\e6ca\"}[data-kentico-variant-listing-host] .icon-braces[data-kentico-variant-listing]:before{content:\"\\e6cb\"}[data-kentico-variant-listing-host] .icon-boxes[data-kentico-variant-listing]:before{content:\"\\e6cc\"}[data-kentico-variant-listing-host] .icon-box[data-kentico-variant-listing]:before{content:\"\\e6ce\"}[data-kentico-variant-listing-host] .icon-ban-sign[data-kentico-variant-listing]:before{content:\"\\e6d1\"}[data-kentico-variant-listing-host] .icon-badge[data-kentico-variant-listing]:before{content:\"\\e6d2\"}[data-kentico-variant-listing-host] .icon-breadcrumb[data-kentico-variant-listing]:before{content:\"\\e6f9\"}[data-kentico-variant-listing-host] .icon-clock[data-kentico-variant-listing]:before{content:\"\\e6a8\"}[data-kentico-variant-listing-host] .icon-cloud[data-kentico-variant-listing]:before{content:\"\\e701\"}[data-kentico-variant-listing-host] .icon-cb-check-preview[data-kentico-variant-listing]:before{content:\"\\e702\"}[data-kentico-variant-listing-host] .icon-accordion[data-kentico-variant-listing]:before{content:\"\\e704\"}[data-kentico-variant-listing-host] .icon-two-squares-line[data-kentico-variant-listing]:before{content:\"\\e706\"}[data-kentico-variant-listing-host] .icon-money-bill[data-kentico-variant-listing]:before{content:\"\\e708\"}[data-kentico-variant-listing-host] .icon-puzzle[data-kentico-variant-listing]:before{content:\"\\e62a\"}[data-kentico-variant-listing-host] .icon-wizard-stick[data-kentico-variant-listing]:before{content:\"\\e6fa\"}[data-kentico-variant-listing-host] .icon-lines-rectangle-o[data-kentico-variant-listing]:before{content:\"\\e6fd\"}[data-kentico-variant-listing-host] .icon-doc-arrows[data-kentico-variant-listing]:before{content:\"\\e6fe\"}[data-kentico-variant-listing-host] .icon-l-text-col[data-kentico-variant-listing]:before{content:\"\\e685\"}[data-kentico-variant-listing-host] .icon-l-menu-text-col[data-kentico-variant-listing]:before{content:\"\\e69b\"}[data-kentico-variant-listing-host] .icon-l-menu-cols-3[data-kentico-variant-listing]:before{content:\"\\e6e8\"}[data-kentico-variant-listing-host] .icon-l-logotype-menu-v-col[data-kentico-variant-listing]:before{content:\"\\e6fc\"}[data-kentico-variant-listing-host] .icon-l-logotype-menu-h-col[data-kentico-variant-listing]:before{content:\"\\e70c\"}[data-kentico-variant-listing-host] .icon-l-header-cols-3-footer[data-kentico-variant-listing]:before{content:\"\\e70d\"}[data-kentico-variant-listing-host] .icon-l-cols-80-20[data-kentico-variant-listing]:before{content:\"\\e70e\"}[data-kentico-variant-listing-host] .icon-l-cols-20-80[data-kentico-variant-listing]:before{content:\"\\e70f\"}[data-kentico-variant-listing-host] .icon-l-cols-4[data-kentico-variant-listing]:before{content:\"\\e710\"}[data-kentico-variant-listing-host] .icon-l-cols-3[data-kentico-variant-listing]:before{content:\"\\e711\"}[data-kentico-variant-listing-host] .icon-l-cols-2[data-kentico-variant-listing]:before{content:\"\\e712\"}[data-kentico-variant-listing-host] .icon-bezier-scheme[data-kentico-variant-listing]:before{content:\"\\e717\"}[data-kentico-variant-listing-host] .icon-note[data-kentico-variant-listing]:before{content:\"\\e71c\"}[data-kentico-variant-listing-host] .icon-piechart-lines[data-kentico-variant-listing]:before{content:\"\\e71d\"}[data-kentico-variant-listing-host] .icon-l-article-map[data-kentico-variant-listing]:before{content:\"\\e721\"}[data-kentico-variant-listing-host] .icon-l-calendar-number-article[data-kentico-variant-listing]:before{content:\"\\e722\"}[data-kentico-variant-listing-host] .icon-l-forms-2[data-kentico-variant-listing]:before{content:\"\\e723\"}[data-kentico-variant-listing-host] .icon-l-header-cols-2-footer[data-kentico-variant-listing]:before{content:\"\\e724\"}[data-kentico-variant-listing-host] .icon-l-header-list-img[data-kentico-variant-listing]:before{content:\"\\e725\"}[data-kentico-variant-listing-host] .icon-l-header-menu-text[data-kentico-variant-listing]:before{content:\"\\e726\"}[data-kentico-variant-listing-host] .icon-l-header-text[data-kentico-variant-listing]:before{content:\"\\e727\"}[data-kentico-variant-listing-host] .icon-l-list-article[data-kentico-variant-listing]:before{content:\"\\e728\"}[data-kentico-variant-listing-host] .icon-l-lightbox[data-kentico-variant-listing]:before{content:\"\\e729\"}[data-kentico-variant-listing-host] .icon-l-img-3-cols-3[data-kentico-variant-listing]:before{content:\"\\e72a\"}[data-kentico-variant-listing-host] .icon-l-img-2-cols-3[data-kentico-variant-listing]:before{content:\"\\e72b\"}[data-kentico-variant-listing-host] .icon-l-text[data-kentico-variant-listing]:before{content:\"\\e72c\"}[data-kentico-variant-listing-host] .icon-l-rows-4[data-kentico-variant-listing]:before{content:\"\\e72d\"}[data-kentico-variant-listing-host] .icon-l-rows-3[data-kentico-variant-listing]:before{content:\"\\e72e\"}[data-kentico-variant-listing-host] .icon-l-rows-2[data-kentico-variant-listing]:before{content:\"\\e72f\"}[data-kentico-variant-listing-host] .icon-l-menu-text-col-bottom[data-kentico-variant-listing]:before{content:\"\\e730\"}[data-kentico-variant-listing-host] .icon-l-menu-text[data-kentico-variant-listing]:before{content:\"\\e731\"}[data-kentico-variant-listing-host] .icon-l-menu-list-img-col[data-kentico-variant-listing]:before{content:\"\\e732\"}[data-kentico-variant-listing-host] .icon-l-menu-list-img[data-kentico-variant-listing]:before{content:\"\\e733\"}[data-kentico-variant-listing-host] .icon-l-menu-list[data-kentico-variant-listing]:before{content:\"\\e734\"}[data-kentico-variant-listing-host] .icon-l-menu-cols-2[data-kentico-variant-listing]:before{content:\"\\e735\"}[data-kentico-variant-listing-host] .icon-l-logotype-menu-col-footer[data-kentico-variant-listing]:before{content:\"\\e736\"}[data-kentico-variant-listing-host] .icon-l-list-title[data-kentico-variant-listing]:before{content:\"\\e737\"}[data-kentico-variant-listing-host] .icon-l-list-img-article[data-kentico-variant-listing]:before{content:\"\\e738\"}[data-kentico-variant-listing-host] .icon-l-list-article-col[data-kentico-variant-listing]:before{content:\"\\e739\"}[data-kentico-variant-listing-host] .icon-tree-structure[data-kentico-variant-listing]:before{content:\"\\e73a\"}[data-kentico-variant-listing-host] .icon-vb[data-kentico-variant-listing]:before{content:\"\\e716\"}[data-kentico-variant-listing-host] .icon-crosshair-o[data-kentico-variant-listing]:before{content:\"\\e71b\"}[data-kentico-variant-listing-host] .icon-crosshair-f[data-kentico-variant-listing]:before{content:\"\\e71f\"}[data-kentico-variant-listing-host] .icon-caret-right-aligned-left[data-kentico-variant-listing]:before{content:\"\\e720\"}[data-kentico-variant-listing-host] .icon-caret-left-aligned-right[data-kentico-variant-listing]:before{content:\"\\e73b\"}[data-kentico-variant-listing-host] .icon-gauge[data-kentico-variant-listing]:before{content:\"\\e686\"}[data-kentico-variant-listing-host] .icon-c-sharp[data-kentico-variant-listing]:before{content:\"\\e718\"}[data-kentico-variant-listing-host] .icon-tab-vertical[data-kentico-variant-listing]:before{content:\"\\e73c\"}[data-kentico-variant-listing-host] .icon-right-double-quotation-mark[data-kentico-variant-listing]:before{content:\"\\e73d\"}[data-kentico-variant-listing-host] .icon-braces-octothorpe[data-kentico-variant-listing]:before{content:\"\\e740\"}[data-kentico-variant-listing-host] .icon-outdent[data-kentico-variant-listing]:before{content:\"\\e741\"}[data-kentico-variant-listing-host] .icon-indent[data-kentico-variant-listing]:before{content:\"\\e742\"}[data-kentico-variant-listing-host] .icon-i[data-kentico-variant-listing]:before{content:\"\\e743\"}[data-kentico-variant-listing-host] .icon-b[data-kentico-variant-listing]:before{content:\"\\e746\"}[data-kentico-variant-listing-host] .icon-u[data-kentico-variant-listing]:before{content:\"\\e747\"}[data-kentico-variant-listing-host] .icon-s[data-kentico-variant-listing]:before{content:\"\\e748\"}[data-kentico-variant-listing-host] .icon-x[data-kentico-variant-listing]:before{content:\"\\e749\"}[data-kentico-variant-listing-host] .icon-t-f[data-kentico-variant-listing]:before{content:\"\\e74a\"}[data-kentico-variant-listing-host] .icon-t[data-kentico-variant-listing]:before{content:\"\\e74b\"}[data-kentico-variant-listing-host] .icon-parent-child-scheme-2[data-kentico-variant-listing]:before{content:\"\\e74c\"}[data-kentico-variant-listing-host] .icon-parent-child-scheme2[data-kentico-variant-listing]:before{content:\"\\e74d\"}[data-kentico-variant-listing-host] .icon-doc-torn[data-kentico-variant-listing]:before{content:\"\\e750\"}[data-kentico-variant-listing-host] .icon-f[data-kentico-variant-listing]:before{content:\"\\e74e\"}[data-kentico-variant-listing-host] .icon-a-lowercase[data-kentico-variant-listing]:before{content:\"\\e74f\"}[data-kentico-variant-listing-host] .icon-circle-slashed[data-kentico-variant-listing]:before{content:\"\\e751\"}[data-kentico-variant-listing-host] .icon-one[data-kentico-variant-listing]:before{content:\"\\e752\"}[data-kentico-variant-listing-host] .icon-diamond[data-kentico-variant-listing]:before{content:\"\\e756\"}[data-kentico-variant-listing-host] .icon-choice-user-scheme[data-kentico-variant-listing]:before{content:\"\\e753\"}[data-kentico-variant-listing-host] .icon-choice-single-scheme[data-kentico-variant-listing]:before{content:\"\\e755\"}[data-kentico-variant-listing-host] .icon-choice-multi-scheme[data-kentico-variant-listing]:before{content:\"\\e757\"}[data-kentico-variant-listing-host] .icon-book-opened[data-kentico-variant-listing]:before{content:\"\\e6cf\"}[data-kentico-variant-listing-host] .icon-e-book[data-kentico-variant-listing]:before{content:\"\\e697\"}[data-kentico-variant-listing-host] .icon-spinner[data-kentico-variant-listing]:before{content:\"\\e61a\"}[data-kentico-variant-listing-host] .icon-layouts[data-kentico-variant-listing]:before{content:\"\\e65b\"}[data-kentico-variant-listing-host] .icon-layout[data-kentico-variant-listing]:before{content:\"\\e65c\"}[data-kentico-variant-listing-host] .icon-id-card[data-kentico-variant-listing]:before{content:\"\\e663\"}[data-kentico-variant-listing-host] .icon-id-cards[data-kentico-variant-listing]:before{content:\"\\e662\"}[data-kentico-variant-listing-host] .icon-l-grid-3-2[data-kentico-variant-listing]:before{content:\"\\e611\"}[data-kentico-variant-listing-host] .icon-l-grid-2-2[data-kentico-variant-listing]:before{content:\"\\e628\"}[data-kentico-variant-listing-host] .icon-l-cols-70-30[data-kentico-variant-listing]:before{content:\"\\e637\"}[data-kentico-variant-listing-host] .icon-l-cols-30-70[data-kentico-variant-listing]:before{content:\"\\e641\"}[data-kentico-variant-listing-host] .icon-l-cols-25-50-25[data-kentico-variant-listing]:before{content:\"\\e688\"}[data-kentico-variant-listing-host] .icon-l-cols-20-60-20[data-kentico-variant-listing]:before{content:\"\\e6a1\"}[data-kentico-variant-listing-host] .icon-eye[data-kentico-variant-listing]:before{content:\"\\e692\"}[data-kentico-variant-listing-host] .icon-list[data-kentico-variant-listing]:before{content:\"\\e6f8\"}[data-kentico-variant-listing-host] .icon-folder-clock[data-kentico-variant-listing]:before{content:\"\\e68c\"}[data-kentico-variant-listing-host] .icon-app-default[data-kentico-variant-listing]:before{content:\"\\e618\"}[data-kentico-variant-listing-host] .icon-app-blogs[data-kentico-variant-listing]:before{content:\"\\e642\"}[data-kentico-variant-listing-host] .icon-app-content[data-kentico-variant-listing]:before{content:\"\\e6cf\"}[data-kentico-variant-listing-host] .icon-app-content-dashboard[data-kentico-variant-listing]:before{content:\"\\e686\"}[data-kentico-variant-listing-host] .icon-app-file-import[data-kentico-variant-listing]:before{content:\"\\e6db\"}[data-kentico-variant-listing-host] .icon-app-forms[data-kentico-variant-listing]:before{content:\"\\e689\"}[data-kentico-variant-listing-host] .icon-app-checked-out[data-kentico-variant-listing]:before{content:\"\\e6c6\"}[data-kentico-variant-listing-host] .icon-app-media[data-kentico-variant-listing]:before{content:\"\\e632\"}[data-kentico-variant-listing-host] .icon-app-my-blogs[data-kentico-variant-listing]:before{content:\"\\e642\"}[data-kentico-variant-listing-host] .icon-app-my-documents[data-kentico-variant-listing]:before{content:\"\\e6c6\"}[data-kentico-variant-listing-host] .icon-app-outdated[data-kentico-variant-listing]:before{content:\"\\e6c6\"}[data-kentico-variant-listing-host] .icon-app-pending[data-kentico-variant-listing]:before{content:\"\\e6c6\"}[data-kentico-variant-listing-host] .icon-app-polls[data-kentico-variant-listing]:before{content:\"\\e6aa\"}[data-kentico-variant-listing-host] .icon-app-recent[data-kentico-variant-listing]:before{content:\"\\e6c6\"}[data-kentico-variant-listing-host] .icon-app-translations[data-kentico-variant-listing]:before{content:\"\\e698\"}[data-kentico-variant-listing-host] .icon-app-activities[data-kentico-variant-listing]:before{content:\"\\e695\"}[data-kentico-variant-listing-host] .icon-app-banners[data-kentico-variant-listing]:before{content:\"\\e624\"}[data-kentico-variant-listing-host] .icon-app-campaigns[data-kentico-variant-listing]:before{content:\"\\e6ba\"}[data-kentico-variant-listing-host] .icon-app-contacts[data-kentico-variant-listing]:before{content:\"\\e663\"}[data-kentico-variant-listing-host] .icon-app-contact-groups[data-kentico-variant-listing]:before{content:\"\\e662\"}[data-kentico-variant-listing-host] .icon-app-conversions[data-kentico-variant-listing]:before{content:\"\\e683\"}[data-kentico-variant-listing-host] .icon-app-marketing-dashboard[data-kentico-variant-listing]:before{content:\"\\e686\"}[data-kentico-variant-listing-host] .icon-app-marketing-reports[data-kentico-variant-listing]:before{content:\"\\e684\"}[data-kentico-variant-listing-host] .icon-app-newsletters[data-kentico-variant-listing]:before{content:\"\\e64f\"}[data-kentico-variant-listing-host] .icon-app-processes[data-kentico-variant-listing]:before{content:\"\\e62c\"}[data-kentico-variant-listing-host] .icon-app-scoring[data-kentico-variant-listing]:before{content:\"\\e687\"}[data-kentico-variant-listing-host] .icon-app-web-analytics[data-kentico-variant-listing]:before{content:\"\\e631\"}[data-kentico-variant-listing-host] .icon-app-ab-test[data-kentico-variant-listing]:before{content:\"\\e706\"}[data-kentico-variant-listing-host] .icon-app-mvt[data-kentico-variant-listing]:before{content:\"\\e65c\"}[data-kentico-variant-listing-host] .icon-app-catalog-discounts[data-kentico-variant-listing]:before{content:\"\\e638\"}[data-kentico-variant-listing-host] .icon-app-customers[data-kentico-variant-listing]:before{content:\"\\e604\"}[data-kentico-variant-listing-host] .icon-app-ecommerce-dashboard[data-kentico-variant-listing]:before{content:\"\\e686\"}[data-kentico-variant-listing-host] .icon-app-ecommerce-reports[data-kentico-variant-listing]:before{content:\"\\e684\"}[data-kentico-variant-listing-host] .icon-app-free-shipping-offers[data-kentico-variant-listing]:before{content:\"\\e638\"}[data-kentico-variant-listing-host] .icon-app-manufacturers[data-kentico-variant-listing]:before{content:\"\\e690\"}[data-kentico-variant-listing-host] .icon-app-order-discounts[data-kentico-variant-listing]:before{content:\"\\e638\"}[data-kentico-variant-listing-host] .icon-app-orders[data-kentico-variant-listing]:before{content:\"\\e660\"}[data-kentico-variant-listing-host] .icon-app-product-coupons[data-kentico-variant-listing]:before{content:\"\\e638\"}[data-kentico-variant-listing-host] .icon-app-product-options[data-kentico-variant-listing]:before{content:\"\\e6cc\"}[data-kentico-variant-listing-host] .icon-app-products[data-kentico-variant-listing]:before{content:\"\\e6ce\"}[data-kentico-variant-listing-host] .icon-app-suppliers[data-kentico-variant-listing]:before{content:\"\\e6cd\"}[data-kentico-variant-listing-host] .icon-app-abuse-reports[data-kentico-variant-listing]:before{content:\"\\e6ea\"}[data-kentico-variant-listing-host] .icon-app-avatars[data-kentico-variant-listing]:before{content:\"\\e652\"}[data-kentico-variant-listing-host] .icon-app-bad-words[data-kentico-variant-listing]:before{content:\"\\e6c2\"}[data-kentico-variant-listing-host] .icon-app-badges[data-kentico-variant-listing]:before{content:\"\\e6d2\"}[data-kentico-variant-listing-host] .icon-app-events[data-kentico-variant-listing]:before{content:\"\\e6b8\"}[data-kentico-variant-listing-host] .icon-app-facebook[data-kentico-variant-listing]:before{content:\"\\e6c9\"}[data-kentico-variant-listing-host] .icon-app-forums[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-app-groups[data-kentico-variant-listing]:before{content:\"\\e602\"}[data-kentico-variant-listing-host] .icon-app-chat[data-kentico-variant-listing]:before{content:\"\\e6c3\"}[data-kentico-variant-listing-host] .icon-app-message-boards[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-app-messages[data-kentico-variant-listing]:before{content:\"\\e64e\"}[data-kentico-variant-listing-host] .icon-app-my-projects[data-kentico-variant-listing]:before{content:\"\\e62b\"}[data-kentico-variant-listing-host] .icon-app-projects[data-kentico-variant-listing]:before{content:\"\\e62b\"}[data-kentico-variant-listing-host] .icon-app-api-examples[data-kentico-variant-listing]:before{content:\"\\e6a6\"}[data-kentico-variant-listing-host] .icon-app-classes[data-kentico-variant-listing]:before{content:\"\\e6cb\"}[data-kentico-variant-listing-host] .icon-app-css-stylesheets[data-kentico-variant-listing]:before{content:\"\\e63f\"}[data-kentico-variant-listing-host] .icon-app-custom-tables[data-kentico-variant-listing]:before{content:\"\\e612\"}[data-kentico-variant-listing-host] .icon-app-database-objects[data-kentico-variant-listing]:before{content:\"\\e6a0\"}[data-kentico-variant-listing-host] .icon-app-device-profiles[data-kentico-variant-listing]:before{content:\"\\e645\"}[data-kentico-variant-listing-host] .icon-app-document-types[data-kentico-variant-listing]:before{content:\"\\e69f\"}[data-kentico-variant-listing-host] .icon-app-email-templates[data-kentico-variant-listing]:before{content:\"\\e64f\"}[data-kentico-variant-listing-host] .icon-app-form-controls[data-kentico-variant-listing]:before{content:\"\\e689\"}[data-kentico-variant-listing-host] .icon-app-javascript-files[data-kentico-variant-listing]:before{content:\"\\e6cb\"}[data-kentico-variant-listing-host] .icon-app-macro-rules[data-kentico-variant-listing]:before{content:\"\\e740\"}[data-kentico-variant-listing-host] .icon-app-modules[data-kentico-variant-listing]:before{content:\"\\e62a\"}[data-kentico-variant-listing-host] .icon-app-notifications[data-kentico-variant-listing]:before{content:\"\\e68f\"}[data-kentico-variant-listing-host] .icon-app-page-layouts[data-kentico-variant-listing]:before{content:\"\\e65c\"}[data-kentico-variant-listing-host] .icon-app-page-templates[data-kentico-variant-listing]:before{content:\"\\e65c\"}[data-kentico-variant-listing-host] .icon-app-web-part-containers[data-kentico-variant-listing]:before{content:\"\\e617\"}[data-kentico-variant-listing-host] .icon-app-web-parts[data-kentico-variant-listing]:before{content:\"\\e6bb\"}[data-kentico-variant-listing-host] .icon-app-web-templates[data-kentico-variant-listing]:before{content:\"\\e65c\"}[data-kentico-variant-listing-host] .icon-app-widgets[data-kentico-variant-listing]:before{content:\"\\e6a5\"}[data-kentico-variant-listing-host] .icon-app-banned-ips[data-kentico-variant-listing]:before{content:\"\\e6ea\"}[data-kentico-variant-listing-host] .icon-app-categories[data-kentico-variant-listing]:before{content:\"\\e699\"}[data-kentico-variant-listing-host] .icon-app-content-reports[data-kentico-variant-listing]:before{content:\"\\e6a7\"}[data-kentico-variant-listing-host] .icon-app-countries[data-kentico-variant-listing]:before{content:\"\\e653\"}[data-kentico-variant-listing-host] .icon-app-ecommerce-configuration[data-kentico-variant-listing]:before{content:\"\\e6a7\"}[data-kentico-variant-listing-host] .icon-app-email-queue[data-kentico-variant-listing]:before{content:\"\\e64e\"}[data-kentico-variant-listing-host] .icon-app-event-log[data-kentico-variant-listing]:before{content:\"\\e6a9\"}[data-kentico-variant-listing-host] .icon-app-integration-bus[data-kentico-variant-listing]:before{content:\"\\e661\"}[data-kentico-variant-listing-host] .icon-app-localization[data-kentico-variant-listing]:before{content:\"\\e698\"}[data-kentico-variant-listing-host] .icon-app-membership[data-kentico-variant-listing]:before{content:\"\\e663\"}[data-kentico-variant-listing-host] .icon-app-marketing-configuration[data-kentico-variant-listing]:before{content:\"\\e6a7\"}[data-kentico-variant-listing-host] .icon-app-permissions[data-kentico-variant-listing]:before{content:\"\\e634\"}[data-kentico-variant-listing-host] .icon-app-recycle-bin[data-kentico-variant-listing]:before{content:\"\\e6d0\"}[data-kentico-variant-listing-host] .icon-app-relationship-names[data-kentico-variant-listing]:before{content:\"\\e67f\"}[data-kentico-variant-listing-host] .icon-app-roles[data-kentico-variant-listing]:before{content:\"\\e603\"}[data-kentico-variant-listing-host] .icon-app-search-engines[data-kentico-variant-listing]:before{content:\"\\e657\"}[data-kentico-variant-listing-host] .icon-app-settings[data-kentico-variant-listing]:before{content:\"\\e6a7\"}[data-kentico-variant-listing-host] .icon-app-scheduled-tasks[data-kentico-variant-listing]:before{content:\"\\e68c\"}[data-kentico-variant-listing-host] .icon-app-sites[data-kentico-variant-listing]:before{content:\"\\e65b\"}[data-kentico-variant-listing-host] .icon-app-smart-search[data-kentico-variant-listing]:before{content:\"\\e657\"}[data-kentico-variant-listing-host] .icon-app-smtp-servers[data-kentico-variant-listing]:before{content:\"\\e64f\"}[data-kentico-variant-listing-host] .icon-app-staging[data-kentico-variant-listing]:before{content:\"\\e616\"}[data-kentico-variant-listing-host] .icon-app-system[data-kentico-variant-listing]:before{content:\"\\e6ab\"}[data-kentico-variant-listing-host] .icon-app-tag-groups[data-kentico-variant-listing]:before{content:\"\\e678\"}[data-kentico-variant-listing-host] .icon-app-time-zones[data-kentico-variant-listing]:before{content:\"\\e6a8\"}[data-kentico-variant-listing-host] .icon-app-translation-services[data-kentico-variant-listing]:before{content:\"\\e60c\"}[data-kentico-variant-listing-host] .icon-app-ui-personalization[data-kentico-variant-listing]:before{content:\"\\e65c\"}[data-kentico-variant-listing-host] .icon-app-users[data-kentico-variant-listing]:before{content:\"\\e602\"}[data-kentico-variant-listing-host] .icon-app-web-farm[data-kentico-variant-listing]:before{content:\"\\e63c\"}[data-kentico-variant-listing-host] .icon-app-workflows[data-kentico-variant-listing]:before{content:\"\\e756\"}[data-kentico-variant-listing-host] .icon-app-personas[data-kentico-variant-listing]:before{content:\"\\e75a\"}[data-kentico-variant-listing-host] .icon-app-unit-tests[data-kentico-variant-listing]:before{content:\"\\e61b\"}[data-kentico-variant-listing-host] .icon-app-licenses[data-kentico-variant-listing]:before{content:\"\\e65e\"}[data-kentico-variant-listing-host] .icon-app-my-profile[data-kentico-variant-listing]:before{content:\"\\e605\"}[data-kentico-variant-listing-host] .icon-app-debug[data-kentico-variant-listing]:before{content:\"\\e6bd\"}[data-kentico-variant-listing-host] .icon-app-twitter[data-kentico-variant-listing]:before{content:\"\\e6c7\"}[data-kentico-variant-listing-host] .icon-app-continuous-integration[data-kentico-variant-listing]:before{content:\"\\e600\"}[data-kentico-variant-listing-host] .icon-app-gift-cards[data-kentico-variant-listing]:before{content:\"\\e708\"}[data-kentico-variant-listing-host] .icon-app-brand[data-kentico-variant-listing]:before{content:\"\\e690\"}[data-kentico-variant-listing-host] .icon-app-collection[data-kentico-variant-listing]:before{content:\"\\e6cc\"}[data-kentico-variant-listing-host] .icon-googletranslator[data-kentico-variant-listing]:before{content:\"\\e6c8\"}[data-kentico-variant-listing-host] .icon-microsofttranslator[data-kentico-variant-listing]:before{content:\"\\e90c\"}[data-kentico-variant-listing-host] .icon-external-link[data-kentico-variant-listing]:before{content:\"\\e6d8\"}[data-kentico-variant-listing-host] .icon-mvc[data-kentico-variant-listing]:before{content:\"\\e73e\"}[data-kentico-variant-listing-host] .icon-w-webpart-default[data-kentico-variant-listing]:before{content:\"\\e6bb\"}[data-kentico-variant-listing-host] .icon-w-widget-default[data-kentico-variant-listing]:before{content:\"\\e6a5\"}[data-kentico-variant-listing-host] .icon-w-css-list-menu[data-kentico-variant-listing]:before{content:\"\\e6f8\"}[data-kentico-variant-listing-host] .icon-w-tree-menu[data-kentico-variant-listing]:before{content:\"\\e73a\"}[data-kentico-variant-listing-host] .icon-w-category-menu[data-kentico-variant-listing]:before{content:\"\\e6f8\"}[data-kentico-variant-listing-host] .icon-w-tab-menu[data-kentico-variant-listing]:before{content:\"\\e6f8\"}[data-kentico-variant-listing-host] .icon-w-drop-down-menu[data-kentico-variant-listing]:before{content:\"\\e6f8\"}[data-kentico-variant-listing-host] .icon-w-language-selection[data-kentico-variant-listing]:before{content:\"\\e698\"}[data-kentico-variant-listing-host] .icon-w-language-selection-dropdown[data-kentico-variant-listing]:before{content:\"\\e698\"}[data-kentico-variant-listing-host] .icon-w-language-selection-with-flags[data-kentico-variant-listing]:before{content:\"\\e698\"}[data-kentico-variant-listing-host] .icon-w-page-placeholder[data-kentico-variant-listing]:before{content:\"\\e630\"}[data-kentico-variant-listing-host] .icon-w-site-map[data-kentico-variant-listing]:before{content:\"\\e73a\"}[data-kentico-variant-listing-host] .icon-w-qr-code[data-kentico-variant-listing]:before{content:\"\\e6eb\"}[data-kentico-variant-listing-host] .icon-w-repeater[data-kentico-variant-listing]:before{content:\"\\e6f4\"}[data-kentico-variant-listing-host] .icon-w-repeater-for-web-service[data-kentico-variant-listing]:before{content:\"\\e6a6\"}[data-kentico-variant-listing-host] .icon-w-repeater-with-carousel[data-kentico-variant-listing]:before{content:\"\\e6f1\"}[data-kentico-variant-listing-host] .icon-w-repeater-with-custom-query[data-kentico-variant-listing]:before{content:\"\\e6a0\"}[data-kentico-variant-listing-host] .icon-w-query-repeater-with-effect[data-kentico-variant-listing]:before{content:\"\\e6a0\"}[data-kentico-variant-listing-host] .icon-w-repeater-with-effect[data-kentico-variant-listing]:before{content:\"\\e6f4\"}[data-kentico-variant-listing-host] .icon-w-repeater-with-lightbox[data-kentico-variant-listing]:before{content:\"\\e633\"}[data-kentico-variant-listing-host] .icon-w-basic-repeater[data-kentico-variant-listing]:before{content:\"\\e6f4\"}[data-kentico-variant-listing-host] .icon-w-basic-repeater-with-effect[data-kentico-variant-listing]:before{content:\"\\e6f4\"}[data-kentico-variant-listing-host] .icon-w-custom-table-repeater[data-kentico-variant-listing]:before{content:\"\\e612\"}[data-kentico-variant-listing-host] .icon-w-custom-table-repeater-with-effect[data-kentico-variant-listing]:before{content:\"\\e612\"}[data-kentico-variant-listing-host] .icon-w-report-table[data-kentico-variant-listing]:before{content:\"\\e612\"}[data-kentico-variant-listing-host] .icon-w-atom-repeater[data-kentico-variant-listing]:before{content:\"\\e6e9\"}[data-kentico-variant-listing-host] .icon-w-xml-repeater[data-kentico-variant-listing]:before{content:\"\\e6e7\"}[data-kentico-variant-listing-host] .icon-w-head-html-code[data-kentico-variant-listing]:before{content:\"\\e6e7\"}[data-kentico-variant-listing-host] .icon-w-static-html[data-kentico-variant-listing]:before{content:\"\\e6e7\"}[data-kentico-variant-listing-host] .icon-w-javascript[data-kentico-variant-listing]:before{content:\"\\e6cb\"}[data-kentico-variant-listing-host] .icon-w-breadcrumbs[data-kentico-variant-listing]:before{content:\"\\e6f9\"}[data-kentico-variant-listing-host] .icon-w-category-breadcrumbs[data-kentico-variant-listing]:before{content:\"\\e6f9\"}[data-kentico-variant-listing-host] .icon-w-forum-breadcrumbs[data-kentico-variant-listing]:before{content:\"\\e6f9\"}[data-kentico-variant-listing-host] .icon-w-document-attachments[data-kentico-variant-listing]:before{content:\"\\e63d\"}[data-kentico-variant-listing-host] .icon-w-document-attachments-with-effect[data-kentico-variant-listing]:before{content:\"\\e63d\"}[data-kentico-variant-listing-host] .icon-w-attachments[data-kentico-variant-listing]:before{content:\"\\e63d\"}[data-kentico-variant-listing-host] .icon-w-attachments-carousel[data-kentico-variant-listing]:before{content:\"\\e6f1\"}[data-kentico-variant-listing-host] .icon-w-attachments-carousel-3d[data-kentico-variant-listing]:before{content:\"\\e6f1\"}[data-kentico-variant-listing-host] .icon-w-attachments-lightbox[data-kentico-variant-listing]:before{content:\"\\e633\"}[data-kentico-variant-listing-host] .icon-w-lightbox-gallery[data-kentico-variant-listing]:before{content:\"\\e633\"}[data-kentico-variant-listing-host] .icon-w-inbox[data-kentico-variant-listing]:before{content:\"\\e64f\"}[data-kentico-variant-listing-host] .icon-w-send-message[data-kentico-variant-listing]:before{content:\"\\e64f\"}[data-kentico-variant-listing-host] .icon-w-send-to-friend[data-kentico-variant-listing]:before{content:\"\\e64f\"}[data-kentico-variant-listing-host] .icon-w-newsletter-archive[data-kentico-variant-listing]:before{content:\"\\e6f8\"}[data-kentico-variant-listing-host] .icon-w-newsletter-subscription[data-kentico-variant-listing]:before{content:\"\\e675\"}[data-kentico-variant-listing-host] .icon-w-messaging-info-panel[data-kentico-variant-listing]:before{content:\"\\e64f\"}[data-kentico-variant-listing-host] .icon-w-newsletter-unsubscription[data-kentico-variant-listing]:before{content:\"\\e60d\"}[data-kentico-variant-listing-host] .icon-w-custom-subscription-form[data-kentico-variant-listing]:before{content:\"\\e675\"}[data-kentico-variant-listing-host] .icon-w-registration-e-mail-confirmation[data-kentico-variant-listing]:before{content:\"\\e64f\"}[data-kentico-variant-listing-host] .icon-w-my-messages[data-kentico-variant-listing]:before{content:\"\\e64f\"}[data-kentico-variant-listing-host] .icon-w-outbox[data-kentico-variant-listing]:before{content:\"\\e64f\"}[data-kentico-variant-listing-host] .icon-w-my-sent-invitations[data-kentico-variant-listing]:before{content:\"\\e64f\"}[data-kentico-variant-listing-host] .icon-w-board-messages-data-source[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-group-forum-posts-data-source[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-query-data-source[data-kentico-variant-listing]:before{content:\"\\e6a0\"}[data-kentico-variant-listing-host] .icon-w-forum-posts-data-source[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-documents-data-source[data-kentico-variant-listing]:before{content:\"\\e69f\"}[data-kentico-variant-listing-host] .icon-w-web-service-data-source[data-kentico-variant-listing]:before{content:\"\\e6a6\"}[data-kentico-variant-listing-host] .icon-w-department-members-data-source[data-kentico-variant-listing]:before{content:\"\\e640\"}[data-kentico-variant-listing-host] .icon-w-macro-data-source[data-kentico-variant-listing]:before{content:\"\\e740\"}[data-kentico-variant-listing-host] .icon-w-file-system-data-source[data-kentico-variant-listing]:before{content:\"\\e68a\"}[data-kentico-variant-listing-host] .icon-w-sharepoint-data-source[data-kentico-variant-listing]:before{content:\"\\e6bb\"}[data-kentico-variant-listing-host] .icon-w-group-media-libraries-data-source[data-kentico-variant-listing]:before{content:\"\\e632\"}[data-kentico-variant-listing-host] .icon-w-atom-data-source[data-kentico-variant-listing]:before{content:\"\\e6e9\"}[data-kentico-variant-listing-host] .icon-w-media-files-data-source[data-kentico-variant-listing]:before{content:\"\\e632\"}[data-kentico-variant-listing-host] .icon-w-groups-data-source[data-kentico-variant-listing]:before{content:\"\\e602\"}[data-kentico-variant-listing-host] .icon-w-custom-table-data-source[data-kentico-variant-listing]:before{content:\"\\e612\"}[data-kentico-variant-listing-host] .icon-w-group-members-data-source[data-kentico-variant-listing]:before{content:\"\\e602\"}[data-kentico-variant-listing-host] .icon-w-blog-comments-data-source[data-kentico-variant-listing]:before{content:\"\\e642\"}[data-kentico-variant-listing-host] .icon-w-sql-data-source[data-kentico-variant-listing]:before{content:\"\\e6a0\"}[data-kentico-variant-listing-host] .icon-w-sql-search-box[data-kentico-variant-listing]:before{content:\"\\e657\"}[data-kentico-variant-listing-host] .icon-w-xml-data-source[data-kentico-variant-listing]:before{content:\"\\e6e7\"}[data-kentico-variant-listing-host] .icon-w-sql-search-dialog[data-kentico-variant-listing]:before{content:\"\\e657\"}[data-kentico-variant-listing-host] .icon-w-products-data-source[data-kentico-variant-listing]:before{content:\"\\e6ce\"}[data-kentico-variant-listing-host] .icon-w-sql-search-dialog-with-results[data-kentico-variant-listing]:before{content:\"\\e657\"}[data-kentico-variant-listing-host] .icon-w-media-libraries-data-source[data-kentico-variant-listing]:before{content:\"\\e632\"}[data-kentico-variant-listing-host] .icon-w-users-data-source[data-kentico-variant-listing]:before{content:\"\\e605\"}[data-kentico-variant-listing-host] .icon-w-attachments-data-source[data-kentico-variant-listing]:before{content:\"\\e63d\"}[data-kentico-variant-listing-host] .icon-w-sql-search-results[data-kentico-variant-listing]:before{content:\"\\e6f8\"}[data-kentico-variant-listing-host] .icon-w-chat-search-on-line-users[data-kentico-variant-listing]:before{content:\"\\e657\"}[data-kentico-variant-listing-host] .icon-w-search-accelerator-for-ie8-and-higher[data-kentico-variant-listing]:before{content:\"\\e657\"}[data-kentico-variant-listing-host] .icon-w-search-engine-results-highlighter[data-kentico-variant-listing]:before{content:\"\\e6f6\"}[data-kentico-variant-listing-host] .icon-w-smart-search-box[data-kentico-variant-listing]:before{content:\"\\e657\"}[data-kentico-variant-listing-host] .icon-w-forum-search-advanced-dialog[data-kentico-variant-listing]:before{content:\"\\e657\"}[data-kentico-variant-listing-host] .icon-w-smart-search-dialog[data-kentico-variant-listing]:before{content:\"\\e657\"}[data-kentico-variant-listing-host] .icon-w-forum-search-box[data-kentico-variant-listing]:before{content:\"\\e657\"}[data-kentico-variant-listing-host] .icon-w-smart-search-dialog-with-results[data-kentico-variant-listing]:before{content:\"\\e657\"}[data-kentico-variant-listing-host] .icon-w-smart-search-filter[data-kentico-variant-listing]:before{content:\"\\e687\"}[data-kentico-variant-listing-host] .icon-w-smart-search-results[data-kentico-variant-listing]:before{content:\"\\e6f8\"}[data-kentico-variant-listing-host] .icon-w-message-board-rss-feed[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-forum-posts-rss-feed[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-query-rss-feed[data-kentico-variant-listing]:before{content:\"\\e6a0\"}[data-kentico-variant-listing-host] .icon-w-news-rss-feed[data-kentico-variant-listing]:before{content:\"\\e643\"}[data-kentico-variant-listing-host] .icon-w-web-service-rss-feed[data-kentico-variant-listing]:before{content:\"\\e6a6\"}[data-kentico-variant-listing-host] .icon-w-feed-link[data-kentico-variant-listing]:before{content:\"\\e6e9\"}[data-kentico-variant-listing-host] .icon-w-cms-rss-feed[data-kentico-variant-listing]:before{content:\"\\e6e9\"}[data-kentico-variant-listing-host] .icon-w-atom-feed[data-kentico-variant-listing]:before{content:\"\\e6e9\"}[data-kentico-variant-listing-host] .icon-w-media-files-rss-feed[data-kentico-variant-listing]:before{content:\"\\e632\"}[data-kentico-variant-listing-host] .icon-w-blog-comments-rss-feed[data-kentico-variant-listing]:before{content:\"\\e6e9\"}[data-kentico-variant-listing-host] .icon-w-events-rss-feed[data-kentico-variant-listing]:before{content:\"\\e6b8\"}[data-kentico-variant-listing-host] .icon-w-rss-data-source[data-kentico-variant-listing]:before{content:\"\\e6a0\"}[data-kentico-variant-listing-host] .icon-w-rss-feed[data-kentico-variant-listing]:before{content:\"\\e6e9\"}[data-kentico-variant-listing-host] .icon-w-products-rss-feed[data-kentico-variant-listing]:before{content:\"\\e6ce\"}[data-kentico-variant-listing-host] .icon-w-custom-table-rss-feed[data-kentico-variant-listing]:before{content:\"\\e612\"}[data-kentico-variant-listing-host] .icon-w-blog-posts-rss-feed[data-kentico-variant-listing]:before{content:\"\\e642\"}[data-kentico-variant-listing-host] .icon-w-rss-repeater[data-kentico-variant-listing]:before{content:\"\\e6e9\"}[data-kentico-variant-listing-host] .icon-w-web-part-zone[data-kentico-variant-listing]:before{content:\"\\e65c\"}[data-kentico-variant-listing-host] .icon-w-banner-rotator[data-kentico-variant-listing]:before{content:\"\\e624\"}[data-kentico-variant-listing-host] .icon-w-css-style-selector[data-kentico-variant-listing]:before{content:\"\\e63f\"}[data-kentico-variant-listing-host] .icon-w-report[data-kentico-variant-listing]:before{content:\"\\e684\"}[data-kentico-variant-listing-host] .icon-w-report-chart[data-kentico-variant-listing]:before{content:\"\\e684\"}[data-kentico-variant-listing-host] .icon-w-switch-mobile-device-detection[data-kentico-variant-listing]:before{content:\"\\e61d\"}[data-kentico-variant-listing-host] .icon-w-mobile-device-redirection[data-kentico-variant-listing]:before{content:\"\\e61d\"}[data-kentico-variant-listing-host] .icon-w-poll[data-kentico-variant-listing]:before{content:\"\\e61b\"}[data-kentico-variant-listing-host] .icon-w-group-polls[data-kentico-variant-listing]:before{content:\"\\e61b\"}[data-kentico-variant-listing-host] .icon-w-scrolling-text[data-kentico-variant-listing]:before{content:\"\\e625\"}[data-kentico-variant-listing-host] .icon-w-static-text[data-kentico-variant-listing]:before{content:\"\\e625\"}[data-kentico-variant-listing-host] .icon-w-paged-text[data-kentico-variant-listing]:before{content:\"\\e625\"}[data-kentico-variant-listing-host] .icon-w-editable-text[data-kentico-variant-listing]:before{content:\"\\e625\"}[data-kentico-variant-listing-host] .icon-w-change-password[data-kentico-variant-listing]:before{content:\"\\e65e\"}[data-kentico-variant-listing-host] .icon-w-unlock-user-accunt[data-kentico-variant-listing]:before{content:\"\\e6ec\"}[data-kentico-variant-listing-host] .icon-w-reset-password[data-kentico-variant-listing]:before{content:\"\\e65e\"}[data-kentico-variant-listing-host] .icon-w-automatically-initiated-chat[data-kentico-variant-listing]:before{content:\"\\e6c3\"}[data-kentico-variant-listing-host] .icon-w-chat-send-message[data-kentico-variant-listing]:before{content:\"\\e64f\"}[data-kentico-variant-listing-host] .icon-w-chat-support-request[data-kentico-variant-listing]:before{content:\"\\e6c3\"}[data-kentico-variant-listing-host] .icon-w-chat-web-part[data-kentico-variant-listing]:before{content:\"\\e6bb\"}[data-kentico-variant-listing-host] .icon-w-chat-errors[data-kentico-variant-listing]:before{content:\"\\e6f2\"}[data-kentico-variant-listing-host] .icon-w-chat-leave-room[data-kentico-variant-listing]:before{content:\"\\e6d9\"}[data-kentico-variant-listing-host] .icon-w-chat-login[data-kentico-variant-listing]:before{content:\"\\e65e\"}[data-kentico-variant-listing-host] .icon-w-chat-notifications[data-kentico-variant-listing]:before{content:\"\\e6c3\"}[data-kentico-variant-listing-host] .icon-w-chat-room-messages[data-kentico-variant-listing]:before{content:\"\\e6c3\"}[data-kentico-variant-listing-host] .icon-w-chat-room-name[data-kentico-variant-listing]:before{content:\"\\e6c3\"}[data-kentico-variant-listing-host] .icon-w-chat-room-users[data-kentico-variant-listing]:before{content:\"\\e605\"}[data-kentico-variant-listing-host] .icon-w-chat-rooms[data-kentico-variant-listing]:before{content:\"\\e6f3\"}[data-kentico-variant-listing-host] .icon-w-comment-view[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-forum-unsubscription[data-kentico-variant-listing]:before{content:\"\\e60d\"}[data-kentico-variant-listing-host] .icon-w-forum-most-active-threads[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-forum-recently-active-threads[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-forum-top-contributors[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-forum-single-forum-flat-layout[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-forum-single-forum-general[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-forum-single-forum-tree-layout[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-calendar[data-kentico-variant-listing]:before{content:\"\\e6b9\"}[data-kentico-variant-listing-host] .icon-w-date-and-time[data-kentico-variant-listing]:before{content:\"\\e6a8\"}[data-kentico-variant-listing-host] .icon-w-event-calendar[data-kentico-variant-listing]:before{content:\"\\e6b8\"}[data-kentico-variant-listing-host] .icon-w-event-registration[data-kentico-variant-listing]:before{content:\"\\e6b8\"}[data-kentico-variant-listing-host] .icon-w-content-rating[data-kentico-variant-listing]:before{content:\"\\e614\"}[data-kentico-variant-listing-host] .icon-w-shopping-cart-content[data-kentico-variant-listing]:before{content:\"\\e6f5\"}[data-kentico-variant-listing-host] .icon-w-shopping-cart-preview[data-kentico-variant-listing]:before{content:\"\\e6f5\"}[data-kentico-variant-listing-host] .icon-w-shopping-cart-totals[data-kentico-variant-listing]:before{content:\"\\e6f5\"}[data-kentico-variant-listing-host] .icon-w-attachment-image-gallery[data-kentico-variant-listing]:before{content:\"\\e633\"}[data-kentico-variant-listing-host] .icon-w-media-gallery-file-filter[data-kentico-variant-listing]:before{content:\"\\e633\"}[data-kentico-variant-listing-host] .icon-w-media-gallery-file-list[data-kentico-variant-listing]:before{content:\"\\e633\"}[data-kentico-variant-listing-host] .icon-w-media-gallery-folder-tree[data-kentico-variant-listing]:before{content:\"\\e633\"}[data-kentico-variant-listing-host] .icon-w-image-gallery[data-kentico-variant-listing]:before{content:\"\\e633\"}[data-kentico-variant-listing-host] .icon-w-media-libraries-viewer[data-kentico-variant-listing]:before{content:\"\\e633\"}[data-kentico-variant-listing-host] .icon-w-grid-with-custom-query[data-kentico-variant-listing]:before{content:\"\\e612\"}[data-kentico-variant-listing-host] .icon-w-custom-table-datalist[data-kentico-variant-listing]:before{content:\"\\e6f8\"}[data-kentico-variant-listing-host] .icon-w-grid[data-kentico-variant-listing]:before{content:\"\\e612\"}[data-kentico-variant-listing-host] .icon-w-table-layout[data-kentico-variant-listing]:before{content:\"\\e612\"}[data-kentico-variant-listing-host] .icon-w-sharepoint-datagrid[data-kentico-variant-listing]:before{content:\"\\e612\"}[data-kentico-variant-listing-host] .icon-w-grid-for-rest-service[data-kentico-variant-listing]:before{content:\"\\e612\"}[data-kentico-variant-listing-host] .icon-w-grid-for-web-service[data-kentico-variant-listing]:before{content:\"\\e6a6\"}[data-kentico-variant-listing-host] .icon-w-custom-table-datagrid[data-kentico-variant-listing]:before{content:\"\\e612\"}[data-kentico-variant-listing-host] .icon-w-basic-datalist[data-kentico-variant-listing]:before{content:\"\\e6f8\"}[data-kentico-variant-listing-host] .icon-w-sharepoint-datalist[data-kentico-variant-listing]:before{content:\"\\e6f8\"}[data-kentico-variant-listing-host] .icon-w-datalist-with-custom-query[data-kentico-variant-listing]:before{content:\"\\e6a0\"}[data-kentico-variant-listing-host] .icon-w-datalist[data-kentico-variant-listing]:before{content:\"\\e6f8\"}[data-kentico-variant-listing-host] .icon-w-group-forum-list[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-group-profile[data-kentico-variant-listing]:before{content:\"\\e602\"}[data-kentico-variant-listing-host] .icon-w-group-properties[data-kentico-variant-listing]:before{content:\"\\e602\"}[data-kentico-variant-listing-host] .icon-w-group-forum-post-viewer[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-group-public-profile[data-kentico-variant-listing]:before{content:\"\\e602\"}[data-kentico-variant-listing-host] .icon-w-group-forum-search-results[data-kentico-variant-listing]:before{content:\"\\e657\"}[data-kentico-variant-listing-host] .icon-w-group-registration[data-kentico-variant-listing]:before{content:\"\\e602\"}[data-kentico-variant-listing-host] .icon-w-group-forums[data-kentico-variant-listing]:before{content:\"\\e602\"}[data-kentico-variant-listing-host] .icon-w-group-roles[data-kentico-variant-listing]:before{content:\"\\e602\"}[data-kentico-variant-listing-host] .icon-w-group-invitation[data-kentico-variant-listing]:before{content:\"\\e64f\"}[data-kentico-variant-listing-host] .icon-w-group-security-access[data-kentico-variant-listing]:before{content:\"\\e658\"}[data-kentico-variant-listing-host] .icon-w-group-media-libraries[data-kentico-variant-listing]:before{content:\"\\e632\"}[data-kentico-variant-listing-host] .icon-w-department-members-viewer[data-kentico-variant-listing]:before{content:\"\\e640\"}[data-kentico-variant-listing-host] .icon-w-group-security-message[data-kentico-variant-listing]:before{content:\"\\e64f\"}[data-kentico-variant-listing-host] .icon-w-leave-group[data-kentico-variant-listing]:before{content:\"\\e6d9\"}[data-kentico-variant-listing-host] .icon-w-group-media-libraries-viewer[data-kentico-variant-listing]:before{content:\"\\e632\"}[data-kentico-variant-listing-host] .icon-w-groups-filter[data-kentico-variant-listing]:before{content:\"\\e687\"}[data-kentico-variant-listing-host] .icon-w-group-members[data-kentico-variant-listing]:before{content:\"\\e602\"}[data-kentico-variant-listing-host] .icon-w-groups-viewer[data-kentico-variant-listing]:before{content:\"\\e602\"}[data-kentico-variant-listing-host] .icon-w-group-members-viewer[data-kentico-variant-listing]:before{content:\"\\e602\"}[data-kentico-variant-listing-host] .icon-w-group-contribution-list[data-kentico-variant-listing]:before{content:\"\\e6f8\"}[data-kentico-variant-listing-host] .icon-w-chat-on-line-users[data-kentico-variant-listing]:before{content:\"\\e6c3\"}[data-kentico-variant-listing-host] .icon-w-group-message-board[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-group-document-library[data-kentico-variant-listing]:before{content:\"\\e632\"}[data-kentico-variant-listing-host] .icon-w-group-message-board-viewer[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-group-edit-contribution[data-kentico-variant-listing]:before{content:\"\\e696\"}[data-kentico-variant-listing-host] .icon-w-group-message-boards[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-group-forum-most-active-threads[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-group-permissions[data-kentico-variant-listing]:before{content:\"\\e634\"}[data-kentico-variant-listing-host] .icon-w-group-forum-recently-active-threads[data-kentico-variant-listing]:before{content:\"\\e6a8\"}[data-kentico-variant-listing-host] .icon-w-custom-registration-form[data-kentico-variant-listing]:before{content:\"\\e605\"}[data-kentico-variant-listing-host] .icon-w-on-line-form[data-kentico-variant-listing]:before{content:\"\\e689\"}[data-kentico-variant-listing-host] .icon-w-registration-form[data-kentico-variant-listing]:before{content:\"\\e605\"}[data-kentico-variant-listing-host] .icon-w-logon-form[data-kentico-variant-listing]:before{content:\"\\e65e\"}[data-kentico-variant-listing-host] .icon-w-logon-mini-form[data-kentico-variant-listing]:before{content:\"\\e65e\"}[data-kentico-variant-listing-host] .icon-w-discount-coupon[data-kentico-variant-listing]:before{content:\"\\e638\"}[data-kentico-variant-listing-host] .icon-w-my-account[data-kentico-variant-listing]:before{content:\"\\e663\"}[data-kentico-variant-listing-host] .icon-w-on-line-users[data-kentico-variant-listing]:before{content:\"\\e605\"}[data-kentico-variant-listing-host] .icon-w-my-profile[data-kentico-variant-listing]:before{content:\"\\e605\"}[data-kentico-variant-listing-host] .icon-w-user-public-profile[data-kentico-variant-listing]:before{content:\"\\e605\"}[data-kentico-variant-listing-host] .icon-w-users-filter[data-kentico-variant-listing]:before{content:\"\\e687\"}[data-kentico-variant-listing-host] .icon-w-document-name-filter[data-kentico-variant-listing]:before{content:\"\\e687\"}[data-kentico-variant-listing-host] .icon-w-filter[data-kentico-variant-listing]:before{content:\"\\e687\"}[data-kentico-variant-listing-host] .icon-w-remaining-amount-for-free-shipping[data-kentico-variant-listing]:before{content:\"\\e638\"}[data-kentico-variant-listing-host] .icon-w-shipping-option-selection[data-kentico-variant-listing]:before{content:\"\\e609\"}[data-kentico-variant-listing-host] .icon-w-tasks-owned-by-me[data-kentico-variant-listing]:before{content:\"\\e61b\"}[data-kentico-variant-listing-host] .icon-w-my-projects[data-kentico-variant-listing]:before{content:\"\\e62b\"}[data-kentico-variant-listing-host] .icon-w-project-list[data-kentico-variant-listing]:before{content:\"\\e62b\"}[data-kentico-variant-listing-host] .icon-w-project-tasks[data-kentico-variant-listing]:before{content:\"\\e61b\"}[data-kentico-variant-listing-host] .icon-w-tasks-assigned-to-me[data-kentico-variant-listing]:before{content:\"\\e61b\"}[data-kentico-variant-listing-host] .icon-w-customer-detail[data-kentico-variant-listing]:before{content:\"\\e604\"}[data-kentico-variant-listing-host] .icon-w-customer-address[data-kentico-variant-listing]:before{content:\"\\e604\"}[data-kentico-variant-listing-host] .icon-w-liveid-required-data[data-kentico-variant-listing]:before{content:\"\\e6bb\"}[data-kentico-variant-listing-host] .icon-w-windows-liveid[data-kentico-variant-listing]:before{content:\"\\e6bb\"}[data-kentico-variant-listing-host] .icon-w-openid-logon[data-kentico-variant-listing]:before{content:\"\\e6e4\"}[data-kentico-variant-listing-host] .icon-w-openid-required-data[data-kentico-variant-listing]:before{content:\"\\e6e4\"}[data-kentico-variant-listing-host] .icon-w-powered-by-kentico[data-kentico-variant-listing]:before{content:\"\\e65f\"}[data-kentico-variant-listing-host] .icon-w-bing-translator[data-kentico-variant-listing]:before{content:\"\\e6ca\"}[data-kentico-variant-listing-host] .icon-w-static-bing-maps[data-kentico-variant-listing]:before{content:\"\\e6ca\"}[data-kentico-variant-listing-host] .icon-w-basic-bing-maps[data-kentico-variant-listing]:before{content:\"\\e6ca\"}[data-kentico-variant-listing-host] .icon-w-bing-maps[data-kentico-variant-listing]:before{content:\"\\e6ca\"}[data-kentico-variant-listing-host] .icon-w-google-maps[data-kentico-variant-listing]:before{content:\"\\e6c8\"}[data-kentico-variant-listing-host] .icon-w-static-google-maps[data-kentico-variant-listing]:before{content:\"\\e6c8\"}[data-kentico-variant-listing-host] .icon-w-basic-google-maps[data-kentico-variant-listing]:before{content:\"\\e6c8\"}[data-kentico-variant-listing-host] .icon-w-google-activity-feed[data-kentico-variant-listing]:before{content:\"\\e6e6\"}[data-kentico-variant-listing-host] .icon-w-google-badge[data-kentico-variant-listing]:before{content:\"\\e6e6\"}[data-kentico-variant-listing-host] .icon-w-google-analytics[data-kentico-variant-listing]:before{content:\"\\e6c8\"}[data-kentico-variant-listing-host] .icon-w-google-search[data-kentico-variant-listing]:before{content:\"\\e6c8\"}[data-kentico-variant-listing-host] .icon-w-google-sitemap-xml-sitemap[data-kentico-variant-listing]:before{content:\"\\e6c8\"}[data-kentico-variant-listing-host] .icon-w-google-translator[data-kentico-variant-listing]:before{content:\"\\e6c8\"}[data-kentico-variant-listing-host] .icon-w-google-1-button[data-kentico-variant-listing]:before{content:\"\\e6e6\"}[data-kentico-variant-listing-host] .icon-w-facebook-activity-feed[data-kentico-variant-listing]:before{content:\"\\e6c9\"}[data-kentico-variant-listing-host] .icon-w-facebook-comments[data-kentico-variant-listing]:before{content:\"\\e6c9\"}[data-kentico-variant-listing-host] .icon-w-facebook-connect-logon[data-kentico-variant-listing]:before{content:\"\\e6c9\"}[data-kentico-variant-listing-host] .icon-w-facebook-facepile[data-kentico-variant-listing]:before{content:\"\\e6c9\"}[data-kentico-variant-listing-host] .icon-w-facebook-like-box[data-kentico-variant-listing]:before{content:\"\\e6c9\"}[data-kentico-variant-listing-host] .icon-w-facebook-like-button[data-kentico-variant-listing]:before{content:\"\\e6c9\"}[data-kentico-variant-listing-host] .icon-w-facebook-recommendations[data-kentico-variant-listing]:before{content:\"\\e6c9\"}[data-kentico-variant-listing-host] .icon-w-facebook-send-button[data-kentico-variant-listing]:before{content:\"\\e6c9\"}[data-kentico-variant-listing-host] .icon-w-twitter-feed[data-kentico-variant-listing]:before{content:\"\\e6c7\"}[data-kentico-variant-listing-host] .icon-w-twitter-follow-button[data-kentico-variant-listing]:before{content:\"\\e6c7\"}[data-kentico-variant-listing-host] .icon-w-twitter-tweet-button[data-kentico-variant-listing]:before{content:\"\\e6c7\"}[data-kentico-variant-listing-host] .icon-w-pinterest-follow-button[data-kentico-variant-listing]:before{content:\"\\e6e3\"}[data-kentico-variant-listing-host] .icon-w-pinterest-pin-it-button[data-kentico-variant-listing]:before{content:\"\\e6e3\"}[data-kentico-variant-listing-host] .icon-w-linkedin-apply-with[data-kentico-variant-listing]:before{content:\"\\e6e5\"}[data-kentico-variant-listing-host] .icon-w-linkedin-company-insider[data-kentico-variant-listing]:before{content:\"\\e6e5\"}[data-kentico-variant-listing-host] .icon-w-linkedin-company-profile[data-kentico-variant-listing]:before{content:\"\\e6e5\"}[data-kentico-variant-listing-host] .icon-w-linkedin-logon[data-kentico-variant-listing]:before{content:\"\\e6e5\"}[data-kentico-variant-listing-host] .icon-w-linkedin-member-profile[data-kentico-variant-listing]:before{content:\"\\e6e5\"}[data-kentico-variant-listing-host] .icon-w-linkedin-recommend-button[data-kentico-variant-listing]:before{content:\"\\e6e5\"}[data-kentico-variant-listing-host] .icon-w-linkedin-required-data[data-kentico-variant-listing]:before{content:\"\\e6e5\"}[data-kentico-variant-listing-host] .icon-w-linkedin-share-button[data-kentico-variant-listing]:before{content:\"\\e6e5\"}[data-kentico-variant-listing-host] .icon-w-flash-web-part[data-kentico-variant-listing]:before{content:\"\\e6bb\"}[data-kentico-variant-listing-host] .icon-w-flash-widget[data-kentico-variant-listing]:before{content:\"\\e6a5\"}[data-kentico-variant-listing-host] .icon-w-social-bookmarking[data-kentico-variant-listing]:before{content:\"\\e678\"}[data-kentico-variant-listing-host] .icon-w-wmp-video[data-kentico-variant-listing]:before{content:\"\\e6bb\"}[data-kentico-variant-listing-host] .icon-w-youtube-video[data-kentico-variant-listing]:before{content:\"\\e659\"}[data-kentico-variant-listing-host] .icon-w-silverlight-application-web-part[data-kentico-variant-listing]:before{content:\"\\e6bb\"}[data-kentico-variant-listing-host] .icon-w-silverlight-application-widget[data-kentico-variant-listing]:before{content:\"\\e6a5\"}[data-kentico-variant-listing-host] .icon-w-quicktime[data-kentico-variant-listing]:before{content:\"\\e6bb\"}[data-kentico-variant-listing-host] .icon-w-product-filter[data-kentico-variant-listing]:before{content:\"\\e6ce\"}[data-kentico-variant-listing-host] .icon-w-top-n-newest-products[data-kentico-variant-listing]:before{content:\"\\e6ce\"}[data-kentico-variant-listing-host] .icon-w-top-n-products-by-sales[data-kentico-variant-listing]:before{content:\"\\e6ce\"}[data-kentico-variant-listing-host] .icon-w-similar-products-by-sales[data-kentico-variant-listing]:before{content:\"\\e6ce\"}[data-kentico-variant-listing-host] .icon-w-random-products[data-kentico-variant-listing]:before{content:\"\\e6ce\"}[data-kentico-variant-listing-host] .icon-w-tag-cloud[data-kentico-variant-listing]:before{content:\"\\e701\"}[data-kentico-variant-listing-host] .icon-w-message-board[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-accordion-layout[data-kentico-variant-listing]:before{content:\"\\e704\"}[data-kentico-variant-listing-host] .icon-w-columns-layout[data-kentico-variant-listing]:before{content:\"\\e712\"}[data-kentico-variant-listing-host] .icon-w-tabs-layout[data-kentico-variant-listing]:before{content:\"\\e6fb\"}[data-kentico-variant-listing-host] .icon-w-wizard-layout[data-kentico-variant-listing]:before{content:\"\\e6fa\"}[data-kentico-variant-listing-host] .icon-w-rows-layout[data-kentico-variant-listing]:before{content:\"\\e72e\"}[data-kentico-variant-listing-host] .icon-w-new-blog[data-kentico-variant-listing]:before{content:\"\\e642\"}[data-kentico-variant-listing-host] .icon-w-abuse-report[data-kentico-variant-listing]:before{content:\"\\e6ea\"}[data-kentico-variant-listing-host] .icon-w-in-line-abuse-report[data-kentico-variant-listing]:before{content:\"\\e6ea\"}[data-kentico-variant-listing-host] .icon-w-message-board-subscription-confirmation[data-kentico-variant-listing]:before{content:\"\\e675\"}[data-kentico-variant-listing-host] .icon-w-datalist-for-web-service[data-kentico-variant-listing]:before{content:\"\\e6a6\"}[data-kentico-variant-listing-host] .icon-w-tree-view[data-kentico-variant-listing]:before{content:\"\\e73a\"}[data-kentico-variant-listing-host] .icon-w-admin-actions[data-kentico-variant-listing]:before{content:\"\\e67f\"}[data-kentico-variant-listing-host] .icon-w-simple-cookie-law-consent[data-kentico-variant-listing]:before{content:\"\\e6f7\"}[data-kentico-variant-listing-host] .icon-w-news-list[data-kentico-variant-listing]:before{content:\"\\e6f8\"}[data-kentico-variant-listing-host] .icon-w-message-board-unsubscription[data-kentico-variant-listing]:before{content:\"\\e60d\"}[data-kentico-variant-listing-host] .icon-w-keep-alive[data-kentico-variant-listing]:before{content:\"\\e622\"}[data-kentico-variant-listing-host] .icon-w-donate[data-kentico-variant-listing]:before{content:\"\\e708\"}[data-kentico-variant-listing-host] .icon-w-donations[data-kentico-variant-listing]:before{content:\"\\e708\"}[data-kentico-variant-listing-host] .icon-w-payment-form[data-kentico-variant-listing]:before{content:\"\\e708\"}[data-kentico-variant-listing-host] .icon-w-payment-method-selection[data-kentico-variant-listing]:before{content:\"\\e708\"}[data-kentico-variant-listing-host] .icon-w-currency-selection[data-kentico-variant-listing]:before{content:\"\\e6ed\"}[data-kentico-variant-listing-host] .icon-w-analytics-browser-capabilities[data-kentico-variant-listing]:before{content:\"\\e6ff\"}[data-kentico-variant-listing-host] .icon-w-strands-recommendations[data-kentico-variant-listing]:before{content:\"\\e6bb\"}[data-kentico-variant-listing-host] .icon-w-password-expiration[data-kentico-variant-listing]:before{content:\"\\e658\"}[data-kentico-variant-listing-host] .icon-w-message-board-viewer[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-checkout-process-obsolete[data-kentico-variant-listing]:before{content:\"\\e6bb\"}[data-kentico-variant-listing-host] .icon-w-category-list[data-kentico-variant-listing]:before{content:\"\\e6f8\"}[data-kentico-variant-listing-host] .icon-w-analytics-custom-statistics[data-kentico-variant-listing]:before{content:\"\\e631\"}[data-kentico-variant-listing-host] .icon-w-subscription-approval[data-kentico-variant-listing]:before{content:\"\\e675\"}[data-kentico-variant-listing-host] .icon-w-widget-actions[data-kentico-variant-listing]:before{content:\"\\e6a5\"}[data-kentico-variant-listing-host] .icon-w-message-panel[data-kentico-variant-listing]:before{content:\"\\e6f5\"}[data-kentico-variant-listing-host] .icon-w-article-list[data-kentico-variant-listing]:before{content:\"\\e6f8\"}[data-kentico-variant-listing-host] .icon-w-set-cookie[data-kentico-variant-listing]:before{content:\"\\e6f7\"}[data-kentico-variant-listing-host] .icon-w-random-document[data-kentico-variant-listing]:before{content:\"\\e69f\"}[data-kentico-variant-listing-host] .icon-w-edit-contribution[data-kentico-variant-listing]:before{content:\"\\e696\"}[data-kentico-variant-listing-host] .icon-w-universal-document-viewer[data-kentico-variant-listing]:before{content:\"\\e69f\"}[data-kentico-variant-listing-host] .icon-w-custom-response[data-kentico-variant-listing]:before{content:\"\\e698\"}[data-kentico-variant-listing-host] .icon-w-collapsible-panel[data-kentico-variant-listing]:before{content:\"\\e700\"}[data-kentico-variant-listing-host] .icon-w-wishlist[data-kentico-variant-listing]:before{content:\"\\e614\"}[data-kentico-variant-listing-host] .icon-w-latest-news[data-kentico-variant-listing]:before{content:\"\\e643\"}[data-kentico-variant-listing-host] .icon-w-edit-document-link[data-kentico-variant-listing]:before{content:\"\\e696\"}[data-kentico-variant-listing-host] .icon-w-did-you-mean[data-kentico-variant-listing]:before{content:\"\\e629\"}[data-kentico-variant-listing-host] .icon-w-universal-pager[data-kentico-variant-listing]:before{content:\"\\e6fe\"}[data-kentico-variant-listing-host] .icon-w-basic-universal-viewer[data-kentico-variant-listing]:before{content:\"\\e6fd\"}[data-kentico-variant-listing-host] .icon-w-random-redirection[data-kentico-variant-listing]:before{content:\"\\e703\"}[data-kentico-variant-listing-host] .icon-w-notification-subscription[data-kentico-variant-listing]:before{content:\"\\e675\"}[data-kentico-variant-listing-host] .icon-w-wizard-buttons[data-kentico-variant-listing]:before{content:\"\\e6fa\"}[data-kentico-variant-listing-host] .icon-w-universal-viewer[data-kentico-variant-listing]:before{content:\"\\e6fd\"}[data-kentico-variant-listing-host] .icon-w-report-value[data-kentico-variant-listing]:before{content:\"\\e749\"}[data-kentico-variant-listing-host] .icon-w-recent-posts[data-kentico-variant-listing]:before{content:\"\\e642\"}[data-kentico-variant-listing-host] .icon-w-object-management-buttons[data-kentico-variant-listing]:before{content:\"\\e696\"}[data-kentico-variant-listing-host] .icon-w-wizard-header[data-kentico-variant-listing]:before{content:\"\\e6fa\"}[data-kentico-variant-listing-host] .icon-w-universal-viewer-with-custom-query[data-kentico-variant-listing]:before{content:\"\\e6a0\"}[data-kentico-variant-listing-host] .icon-w-confirmation-checkbox[data-kentico-variant-listing]:before{content:\"\\e702\"}[data-kentico-variant-listing-host] .icon-w-sharepoint-repeater[data-kentico-variant-listing]:before{content:\"\\e6f4\"}[data-kentico-variant-listing-host] .icon-w-register-after-checkout[data-kentico-variant-listing]:before{content:\"\\e605\"}[data-kentico-variant-listing-host] .icon-w-post-archive[data-kentico-variant-listing]:before{content:\"\\e6f8\"}[data-kentico-variant-listing-host] .icon-w-my-invitations[data-kentico-variant-listing]:before{content:\"\\e64f\"}[data-kentico-variant-listing-host] .icon-w-link-button[data-kentico-variant-listing]:before{content:\"\\e67f\"}[data-kentico-variant-listing-host] .icon-w-contact-list[data-kentico-variant-listing]:before{content:\"\\e604\"}[data-kentico-variant-listing-host] .icon-w-task-info-panel[data-kentico-variant-listing]:before{content:\"\\e61b\"}[data-kentico-variant-listing-host] .icon-w-document-library[data-kentico-variant-listing]:before{content:\"\\e69f\"}[data-kentico-variant-listing-host] .icon-w-custom-table-form[data-kentico-variant-listing]:before{content:\"\\e612\"}[data-kentico-variant-listing-host] .icon-w-hierarchical-viewer[data-kentico-variant-listing]:before{content:\"\\e6fd\"}[data-kentico-variant-listing-host] .icon-w-user-control[data-kentico-variant-listing]:before{content:\"\\e6bb\"}[data-kentico-variant-listing-host] .icon-w-content-slider[data-kentico-variant-listing]:before{content:\"\\e6f1\"}[data-kentico-variant-listing-host] .icon-w-blog-post-subscription-confirmation[data-kentico-variant-listing]:before{content:\"\\e675\"}[data-kentico-variant-listing-host] .icon-w-ignore-list[data-kentico-variant-listing]:before{content:\"\\e6ea\"}[data-kentico-variant-listing-host] .icon-w-document-pager[data-kentico-variant-listing]:before{content:\"\\e6fe\"}[data-kentico-variant-listing-host] .icon-w-content-subscription[data-kentico-variant-listing]:before{content:\"\\e675\"}[data-kentico-variant-listing-host] .icon-w-blog-post-unsubscription[data-kentico-variant-listing]:before{content:\"\\e60d\"}[data-kentico-variant-listing-host] .icon-w-text-highlighter[data-kentico-variant-listing]:before{content:\"\\e6f6\"}[data-kentico-variant-listing-host] .icon-w-related-documents[data-kentico-variant-listing]:before{content:\"\\e69f\"}[data-kentico-variant-listing-host] .icon-w-order-note[data-kentico-variant-listing]:before{content:\"\\e660\"}[data-kentico-variant-listing-host] .icon-w-xslt-viewer[data-kentico-variant-listing]:before{content:\"\\e6e7\"}[data-kentico-variant-listing-host] .icon-w-document-wizard-button[data-kentico-variant-listing]:before{content:\"\\e6fa\"}[data-kentico-variant-listing-host] .icon-w-contribution-list[data-kentico-variant-listing]:before{content:\"\\e6f8\"}[data-kentico-variant-listing-host] .icon-w-timer[data-kentico-variant-listing]:before{content:\"\\e6a8\"}[data-kentico-variant-listing-host] .icon-w-shortcuts[data-kentico-variant-listing]:before{content:\"\\e67f\"}[data-kentico-variant-listing-host] .icon-w-document-wizard-manager[data-kentico-variant-listing]:before{content:\"\\e6fa\"}[data-kentico-variant-listing-host] .icon-w-cookie-law-consent[data-kentico-variant-listing]:before{content:\"\\e6f7\"}[data-kentico-variant-listing-host] .icon-w-blog-comments-viewer[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-sign-out-button[data-kentico-variant-listing]:before{content:\"\\e6d9\"}[data-kentico-variant-listing-host] .icon-w-scrolling-news[data-kentico-variant-listing]:before{content:\"\\e6f1\"}[data-kentico-variant-listing-host] .icon-w-output-cache-dependencies[data-kentico-variant-listing]:before{content:\"\\e6bb\"}[data-kentico-variant-listing-host] .icon-w-zones-with-effect[data-kentico-variant-listing]:before{content:\"\\e65c\"}[data-kentico-variant-listing-host] .icon-w-document-wizard-navigation[data-kentico-variant-listing]:before{content:\"\\e6fa\"}[data-kentico-variant-listing-host] .icon-w-my-subscriptions[data-kentico-variant-listing]:before{content:\"\\e634\"}[data-kentico-variant-listing-host] .icon-w-document-wizard-step-action[data-kentico-variant-listing]:before{content:\"\\e6fa\"}[data-kentico-variant-listing-host] .icon-w-page-views[data-kentico-variant-listing]:before{content:\"\\e6bb\"}[data-kentico-variant-listing-host] .icon-w-activities[data-kentico-variant-listing]:before{content:\"\\e695\"}[data-kentico-variant-listing-host] .icon-w-analytics-chart-viewer[data-kentico-variant-listing]:before{content:\"\\e631\"}[data-kentico-variant-listing-host] .icon-w-analytics-table-viewer[data-kentico-variant-listing]:before{content:\"\\e612\"}[data-kentico-variant-listing-host] .icon-w-articles-rss-feed[data-kentico-variant-listing]:before{content:\"\\e6e9\"}[data-kentico-variant-listing-host] .icon-w-blog-comments[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-building-your-on-line-store[data-kentico-variant-listing]:before{content:\"\\e6f5\"}[data-kentico-variant-listing-host] .icon-w-department-latest-blog-posts[data-kentico-variant-listing]:before{content:\"\\e642\"}[data-kentico-variant-listing-host] .icon-w-department-latest-forum-posts[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-department-latest-news[data-kentico-variant-listing]:before{content:\"\\e643\"}[data-kentico-variant-listing-host] .icon-w-department-quick-links[data-kentico-variant-listing]:before{content:\"\\e67f\"}[data-kentico-variant-listing-host] .icon-w-department-upcoming-events[data-kentico-variant-listing]:before{content:\"\\e6b8\"}[data-kentico-variant-listing-host] .icon-w-documents[data-kentico-variant-listing]:before{content:\"\\e69f\"}[data-kentico-variant-listing-host] .icon-w-e-commerce-settings-checker[data-kentico-variant-listing]:before{content:\"\\e702\"}[data-kentico-variant-listing-host] .icon-w-editable-image[data-kentico-variant-listing]:before{content:\"\\e633\"}[data-kentico-variant-listing-host] .icon-w-e-mail-queue[data-kentico-variant-listing]:before{content:\"\\e64e\"}[data-kentico-variant-listing-host] .icon-w-employee-of-the-month[data-kentico-variant-listing]:before{content:\"\\e604\"}[data-kentico-variant-listing-host] .icon-w-event-management[data-kentico-variant-listing]:before{content:\"\\e6b8\"}[data-kentico-variant-listing-host] .icon-w-eventlog[data-kentico-variant-listing]:before{content:\"\\e6a9\"}[data-kentico-variant-listing-host] .icon-w-forum-group[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-forum-posts-waiting-for-approval[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-group-administrators[data-kentico-variant-listing]:before{content:\"\\e605\"}[data-kentico-variant-listing-host] .icon-w-group-forum-posts-viewer[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-group-poll[data-kentico-variant-listing]:before{content:\"\\e61b\"}[data-kentico-variant-listing-host] .icon-w-intranet-canteen-menu[data-kentico-variant-listing]:before{content:\"\\e660\"}[data-kentico-variant-listing-host] .icon-w-intranet-departments[data-kentico-variant-listing]:before{content:\"\\e640\"}[data-kentico-variant-listing-host] .icon-w-intranet-employees[data-kentico-variant-listing]:before{content:\"\\e602\"}[data-kentico-variant-listing-host] .icon-w-intranet-latest-blog-posts[data-kentico-variant-listing]:before{content:\"\\e642\"}[data-kentico-variant-listing-host] .icon-w-intranet-latest-forum-posts[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-intranet-latest-news[data-kentico-variant-listing]:before{content:\"\\e643\"}[data-kentico-variant-listing-host] .icon-w-intranet-poll[data-kentico-variant-listing]:before{content:\"\\e631\"}[data-kentico-variant-listing-host] .icon-w-intranet-quick-links[data-kentico-variant-listing]:before{content:\"\\e67f\"}[data-kentico-variant-listing-host] .icon-w-intranet-upcoming-events[data-kentico-variant-listing]:before{content:\"\\e6b8\"}[data-kentico-variant-listing-host] .icon-w-latest-blog-posts[data-kentico-variant-listing]:before{content:\"\\e642\"}[data-kentico-variant-listing-host] .icon-w-latest-forum-posts[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-latest-news-for-corporate-site[data-kentico-variant-listing]:before{content:\"\\e643\"}[data-kentico-variant-listing-host] .icon-w-link[data-kentico-variant-listing]:before{content:\"\\e67f\"}[data-kentico-variant-listing-host] .icon-w-media-gallery[data-kentico-variant-listing]:before{content:\"\\e633\"}[data-kentico-variant-listing-host] .icon-w-message-list[data-kentico-variant-listing]:before{content:\"\\e6f8\"}[data-kentico-variant-listing-host] .icon-w-most-recent-pages[data-kentico-variant-listing]:before{content:\"\\e6f8\"}[data-kentico-variant-listing-host] .icon-w-my-accounts[data-kentico-variant-listing]:before{content:\"\\e6bc\"}[data-kentico-variant-listing-host] .icon-w-my-blogs[data-kentico-variant-listing]:before{content:\"\\e642\"}[data-kentico-variant-listing-host] .icon-w-my-blogs-comments[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-my-contacts[data-kentico-variant-listing]:before{content:\"\\e663\"}[data-kentico-variant-listing-host] .icon-w-my-inbox[data-kentico-variant-listing]:before{content:\"\\e64e\"}[data-kentico-variant-listing-host] .icon-w-my-pending-contacts[data-kentico-variant-listing]:before{content:\"\\e663\"}[data-kentico-variant-listing-host] .icon-w-my-projects-intranet-portal[data-kentico-variant-listing]:before{content:\"\\e62b\"}[data-kentico-variant-listing-host] .icon-w-my-workgroups[data-kentico-variant-listing]:before{content:\"\\e6c6\"}[data-kentico-variant-listing-host] .icon-w-object-recycle-bin[data-kentico-variant-listing]:before{content:\"\\e6d0\"}[data-kentico-variant-listing-host] .icon-w-orders[data-kentico-variant-listing]:before{content:\"\\e660\"}[data-kentico-variant-listing-host] .icon-w-persona-based-recommendations[data-kentico-variant-listing]:before{content:\"\\e604\"}[data-kentico-variant-listing-host] .icon-w-personal-category-list[data-kentico-variant-listing]:before{content:\"\\e6f8\"}[data-kentico-variant-listing-host] .icon-w-products[data-kentico-variant-listing]:before{content:\"\\e6ce\"}[data-kentico-variant-listing-host] .icon-w-random-products-for-corporate-site[data-kentico-variant-listing]:before{content:\"\\e6ce\"}[data-kentico-variant-listing-host] .icon-w-recent-users[data-kentico-variant-listing]:before{content:\"\\e605\"}[data-kentico-variant-listing-host] .icon-w-report-daily-sales[data-kentico-variant-listing]:before{content:\"\\e684\"}[data-kentico-variant-listing-host] .icon-w-report-monthly-sales[data-kentico-variant-listing]:before{content:\"\\e684\"}[data-kentico-variant-listing-host] .icon-w-report-number-of-orders-by-status[data-kentico-variant-listing]:before{content:\"\\e684\"}[data-kentico-variant-listing-host] .icon-w-report-sales-by-order-status[data-kentico-variant-listing]:before{content:\"\\e684\"}[data-kentico-variant-listing-host] .icon-w-reporting[data-kentico-variant-listing]:before{content:\"\\e684\"}[data-kentico-variant-listing-host] .icon-w-rich-text[data-kentico-variant-listing]:before{content:\"\\e728\"}[data-kentico-variant-listing-host] .icon-w-scrolling-news-for-corporate-site[data-kentico-variant-listing]:before{content:\"\\e643\"}[data-kentico-variant-listing-host] .icon-w-system[data-kentico-variant-listing]:before{content:\"\\e6ab\"}[data-kentico-variant-listing-host] .icon-w-tasks-assigned-to-me-intranet-portal[data-kentico-variant-listing]:before{content:\"\\e61b\"}[data-kentico-variant-listing-host] .icon-w-tasks-owned-by-me-intranet-portal[data-kentico-variant-listing]:before{content:\"\\e61b\"}[data-kentico-variant-listing-host] .icon-w-text[data-kentico-variant-listing]:before{content:\"\\e72c\"}[data-kentico-variant-listing-host] .icon-w-widget-zone[data-kentico-variant-listing]:before{content:\"\\e6a5\"}[data-kentico-variant-listing-host] .icon-w-workgroup-administrators[data-kentico-variant-listing]:before{content:\"\\e605\"}[data-kentico-variant-listing-host] .icon-w-workgroup-latest-blog-posts[data-kentico-variant-listing]:before{content:\"\\e642\"}[data-kentico-variant-listing-host] .icon-w-workgroup-latest-forum-posts[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-workgroup-latest-news[data-kentico-variant-listing]:before{content:\"\\e643\"}[data-kentico-variant-listing-host] .icon-w-workgroup-members[data-kentico-variant-listing]:before{content:\"\\e602\"}[data-kentico-variant-listing-host] .icon-w-workgroup-messages[data-kentico-variant-listing]:before{content:\"\\e64f\"}[data-kentico-variant-listing-host] .icon-w-workgroup-quick-links[data-kentico-variant-listing]:before{content:\"\\e67f\"}[data-kentico-variant-listing-host] .icon-w-workgroup-recent-pages[data-kentico-variant-listing]:before{content:\"\\e6f8\"}[data-kentico-variant-listing-host] .icon-w-workgroup-upcoming-events[data-kentico-variant-listing]:before{content:\"\\e6b8\"}[data-kentico-variant-listing-host] .icon-w-current-user[data-kentico-variant-listing]:before{content:\"\\e605\"}[data-kentico-variant-listing-host] .icon-w-disabled-module-info[data-kentico-variant-listing]:before{content:\"\\e664\"}[data-kentico-variant-listing-host] .icon-w-edit[data-kentico-variant-listing]:before{content:\"\\e696\"}[data-kentico-variant-listing-host] .icon-w-edit-parameters[data-kentico-variant-listing]:before{content:\"\\e696\"}[data-kentico-variant-listing-host] .icon-w-forum-favorites[data-kentico-variant-listing]:before{content:\"\\e614\"}[data-kentico-variant-listing-host] .icon-w-forum-posts-viewer[data-kentico-variant-listing]:before{content:\"\\e6c1\"}[data-kentico-variant-listing-host] .icon-w-forum-subscription-confirmation[data-kentico-variant-listing]:before{content:\"\\e675\"}[data-kentico-variant-listing-host] .icon-w-header-actions[data-kentico-variant-listing]:before{content:\"\\e6bb\"}[data-kentico-variant-listing-host] .icon-w-horizontal-tabs[data-kentico-variant-listing]:before{content:\"\\e6fb\"}[data-kentico-variant-listing-host] .icon-w-listing[data-kentico-variant-listing]:before{content:\"\\e728\"}[data-kentico-variant-listing-host] .icon-w-edit-bindings[data-kentico-variant-listing]:before{content:\"\\e696\"}[data-kentico-variant-listing-host] .icon-w-media-file-uploader[data-kentico-variant-listing]:before{content:\"\\e632\"}[data-kentico-variant-listing-host] .icon-w-messages-placeholder[data-kentico-variant-listing]:before{content:\"\\e630\"}[data-kentico-variant-listing-host] .icon-w-metafile-list[data-kentico-variant-listing]:before{content:\"\\e6f8\"}[data-kentico-variant-listing-host] .icon-w-new-header-action[data-kentico-variant-listing]:before{content:\"\\e6bb\"}[data-kentico-variant-listing-host] .icon-w-object-edit-panel[data-kentico-variant-listing]:before{content:\"\\e6bb\"}[data-kentico-variant-listing-host] .icon-w-object-tree-menu[data-kentico-variant-listing]:before{content:\"\\e73a\"}[data-kentico-variant-listing-host] .icon-w-page-title[data-kentico-variant-listing]:before{content:\"\\e727\"}[data-kentico-variant-listing-host] .icon-w-preview-edit[data-kentico-variant-listing]:before{content:\"\\e696\"}[data-kentico-variant-listing-host] .icon-w-selector[data-kentico-variant-listing]:before{content:\"\\e6bb\"}[data-kentico-variant-listing-host] .icon-w-select-site[data-kentico-variant-listing]:before{content:\"\\e698\"}[data-kentico-variant-listing-host] .icon-w-theme-file-manager[data-kentico-variant-listing]:before{content:\"\\e68a\"}[data-kentico-variant-listing-host] .icon-w-tree[data-kentico-variant-listing]:before{content:\"\\e73a\"}[data-kentico-variant-listing-host] .icon-w-tree-guide[data-kentico-variant-listing]:before{content:\"\\e73a\"}[data-kentico-variant-listing-host] .icon-w-users-viewer[data-kentico-variant-listing]:before{content:\"\\e605\"}[data-kentico-variant-listing-host] .icon-w-vertical-tabs[data-kentico-variant-listing]:before{content:\"\\e73c\"}[data-kentico-variant-listing-host] .icon-file-default[data-kentico-variant-listing]:before{content:\"\\e69c\"}[data-kentico-variant-listing-host] .icon-file-3gp[data-kentico-variant-listing]:before{content:\"\\e636\"}[data-kentico-variant-listing-host] .icon-file-accdb[data-kentico-variant-listing]:before{content:\"\\e6a0\"}[data-kentico-variant-listing-host] .icon-file-ai[data-kentico-variant-listing]:before{content:\"\\e717\"}[data-kentico-variant-listing-host] .icon-file-ascx[data-kentico-variant-listing]:before{content:\"\\e714\"}[data-kentico-variant-listing-host] .icon-file-aspx[data-kentico-variant-listing]:before{content:\"\\e69f\"}[data-kentico-variant-listing-host] .icon-file-au[data-kentico-variant-listing]:before{content:\"\\e71c\"}[data-kentico-variant-listing-host] .icon-file-avi[data-kentico-variant-listing]:before{content:\"\\e636\"}[data-kentico-variant-listing-host] .icon-file-bat[data-kentico-variant-listing]:before{content:\"\\e71a\"}[data-kentico-variant-listing-host] .icon-file-bmp[data-kentico-variant-listing]:before{content:\"\\e633\"}[data-kentico-variant-listing-host] .icon-file-cs[data-kentico-variant-listing]:before{content:\"\\e718\"}[data-kentico-variant-listing-host] .icon-file-css[data-kentico-variant-listing]:before{content:\"\\e63f\"}[data-kentico-variant-listing-host] .icon-file-csv[data-kentico-variant-listing]:before{content:\"\\e612\"}[data-kentico-variant-listing-host] .icon-file-dbm[data-kentico-variant-listing]:before{content:\"\\e6a0\"}[data-kentico-variant-listing-host] .icon-file-doc[data-kentico-variant-listing]:before{content:\"\\e625\"}[data-kentico-variant-listing-host] .icon-file-eps[data-kentico-variant-listing]:before{content:\"\\e717\"}[data-kentico-variant-listing-host] .icon-file-flv[data-kentico-variant-listing]:before{content:\"\\e636\"}[data-kentico-variant-listing-host] .icon-file-gif[data-kentico-variant-listing]:before{content:\"\\e633\"}[data-kentico-variant-listing-host] .icon-file-html[data-kentico-variant-listing]:before{content:\"\\e6e7\"}[data-kentico-variant-listing-host] .icon-file-jpeg[data-kentico-variant-listing]:before{content:\"\\e633\"}[data-kentico-variant-listing-host] .icon-file-js[data-kentico-variant-listing]:before{content:\"\\e6cb\"}[data-kentico-variant-listing-host] .icon-file-mdb[data-kentico-variant-listing]:before{content:\"\\e6a0\"}[data-kentico-variant-listing-host] .icon-file-mid[data-kentico-variant-listing]:before{content:\"\\e71c\"}[data-kentico-variant-listing-host] .icon-file-mov[data-kentico-variant-listing]:before{content:\"\\e636\"}[data-kentico-variant-listing-host] .icon-file-mp3[data-kentico-variant-listing]:before{content:\"\\e71c\"}[data-kentico-variant-listing-host] .icon-file-mp4[data-kentico-variant-listing]:before{content:\"\\e636\"}[data-kentico-variant-listing-host] .icon-file-mpeg[data-kentico-variant-listing]:before{content:\"\\e71c\"}[data-kentico-variant-listing-host] .icon-file-mpg[data-kentico-variant-listing]:before{content:\"\\e636\"}[data-kentico-variant-listing-host] .icon-file-mpg4[data-kentico-variant-listing]:before{content:\"\\e636\"}[data-kentico-variant-listing-host] .icon-file-oga[data-kentico-variant-listing]:before{content:\"\\e71c\"}[data-kentico-variant-listing-host] .icon-file-ogg[data-kentico-variant-listing]:before{content:\"\\e71c\"}[data-kentico-variant-listing-host] .icon-file-ogv[data-kentico-variant-listing]:before{content:\"\\e636\"}[data-kentico-variant-listing-host] .icon-file-pdf[data-kentico-variant-listing]:before{content:\"\\e6a3\"}[data-kentico-variant-listing-host] .icon-file-png[data-kentico-variant-listing]:before{content:\"\\e633\"}[data-kentico-variant-listing-host] .icon-file-pps[data-kentico-variant-listing]:before{content:\"\\e71d\"}[data-kentico-variant-listing-host] .icon-file-ppt[data-kentico-variant-listing]:before{content:\"\\e71d\"}[data-kentico-variant-listing-host] .icon-file-ps[data-kentico-variant-listing]:before{content:\"\\e717\"}[data-kentico-variant-listing-host] .icon-file-psd[data-kentico-variant-listing]:before{content:\"\\e633\"}[data-kentico-variant-listing-host] .icon-file-rtf[data-kentico-variant-listing]:before{content:\"\\e625\"}[data-kentico-variant-listing-host] .icon-file-sln[data-kentico-variant-listing]:before{content:\"\\e6ff\"}[data-kentico-variant-listing-host] .icon-file-swf[data-kentico-variant-listing]:before{content:\"\\e636\"}[data-kentico-variant-listing-host] .icon-file-tif[data-kentico-variant-listing]:before{content:\"\\e633\"}[data-kentico-variant-listing-host] .icon-file-tiff[data-kentico-variant-listing]:before{content:\"\\e633\"}[data-kentico-variant-listing-host] .icon-file-txt[data-kentico-variant-listing]:before{content:\"\\e625\"}[data-kentico-variant-listing-host] .icon-file-vb[data-kentico-variant-listing]:before{content:\"\\e716\"}[data-kentico-variant-listing-host] .icon-file-wav[data-kentico-variant-listing]:before{content:\"\\e71c\"}[data-kentico-variant-listing-host] .icon-file-webm[data-kentico-variant-listing]:before{content:\"\\e636\"}[data-kentico-variant-listing-host] .icon-file-wma[data-kentico-variant-listing]:before{content:\"\\e71c\"}[data-kentico-variant-listing-host] .icon-file-wmv[data-kentico-variant-listing]:before{content:\"\\e636\"}[data-kentico-variant-listing-host] .icon-file-xls[data-kentico-variant-listing]:before{content:\"\\e612\"}[data-kentico-variant-listing-host] .icon-file-xml[data-kentico-variant-listing]:before{content:\"\\e6e7\"}[data-kentico-variant-listing-host] .icon-file-xsl[data-kentico-variant-listing]:before{content:\"\\e6e7\"}[data-kentico-variant-listing-host] .icon-file-xslt[data-kentico-variant-listing]:before{content:\"\\e6e7\"}[data-kentico-variant-listing-host] .icon-file-zip[data-kentico-variant-listing]:before{content:\"\\e715\"}[data-kentico-variant-listing-host] .icon-me-abstractobjectcollection[data-kentico-variant-listing]:before{content:\"\\e68b\"}[data-kentico-variant-listing-host] .icon-me-binding[data-kentico-variant-listing]:before{content:\"\\e67f\"}[data-kentico-variant-listing-host] .icon-me-boolean[data-kentico-variant-listing]:before{content:\"\\e74a\"}[data-kentico-variant-listing-host] .icon-me-datetime[data-kentico-variant-listing]:before{content:\"\\e6a8\"}[data-kentico-variant-listing-host] .icon-me-double[data-kentico-variant-listing]:before{content:\"\\e752\"}[data-kentico-variant-listing-host] .icon-me-decimal[data-kentico-variant-listing]:before{content:\"\\e752\"}[data-kentico-variant-listing-host] .icon-me-false[data-kentico-variant-listing]:before{content:\"\\e74e\"}[data-kentico-variant-listing-host] .icon-me-children[data-kentico-variant-listing]:before{content:\"\\e67b\"}[data-kentico-variant-listing-host] .icon-me-icontext[data-kentico-variant-listing]:before{content:\"\\e654\"}[data-kentico-variant-listing-host] .icon-me-ilist[data-kentico-variant-listing]:before{content:\"\\e6f8\"}[data-kentico-variant-listing-host] .icon-me-imacronamespace[data-kentico-variant-listing]:before{content:\"\\e699\"}[data-kentico-variant-listing-host] .icon-me-info[data-kentico-variant-listing]:before{content:\"\\e6a9\"}[data-kentico-variant-listing-host] .icon-me-insertmacro[data-kentico-variant-listing]:before{content:\"\\e740\"}[data-kentico-variant-listing-host] .icon-me-int32[data-kentico-variant-listing]:before{content:\"\\e752\"}[data-kentico-variant-listing-host] .icon-me-method[data-kentico-variant-listing]:before{content:\"\\e6a6\"}[data-kentico-variant-listing-host] .icon-me-null[data-kentico-variant-listing]:before{content:\"\\e751\"}[data-kentico-variant-listing-host] .icon-me-number[data-kentico-variant-listing]:before{content:\"\\e752\"}[data-kentico-variant-listing-host] .icon-me-parent[data-kentico-variant-listing]:before{content:\"\\e74c\"}[data-kentico-variant-listing-host] .icon-me-property[data-kentico-variant-listing]:before{content:\"\\e6a9\"}[data-kentico-variant-listing-host] .icon-me-referring[data-kentico-variant-listing]:before{content:\"\\e67f\"}[data-kentico-variant-listing-host] .icon-me-sitebinding[data-kentico-variant-listing]:before{content:\"\\e67f\"}[data-kentico-variant-listing-host] .icon-me-snippet[data-kentico-variant-listing]:before{content:\"\\e750\"}[data-kentico-variant-listing-host] .icon-me-string[data-kentico-variant-listing]:before{content:\"\\e74f\"}[data-kentico-variant-listing-host] .icon-me-true[data-kentico-variant-listing]:before{content:\"\\e74b\"}[data-kentico-variant-listing-host] .icon-me-value[data-kentico-variant-listing]:before{content:\"\\e749\"}[data-kentico-variant-listing-host] .icon-me-exception[data-kentico-variant-listing]:before{content:\"\\e693\"}[data-kentico-variant-listing-host] .icon-personalisation-variants[data-kentico-variant-listing]:before{content:\"\\e901\"}[data-kentico-variant-listing-host] .icon-personalisation[data-kentico-variant-listing]:before{content:\"\\e900\"}[data-kentico-variant-listing-host] .icon-android[data-kentico-variant-listing]:before{content:\"\\f17b\"}[data-kentico-variant-listing-host] .icon-apple[data-kentico-variant-listing]:before{content:\"\\f179\"}[data-kentico-variant-listing-host] .icon-cancel[data-kentico-variant-listing]:before{content:\"\\e804\"}[data-kentico-variant-listing-host] .icon-chrome[data-kentico-variant-listing]:before{content:\"\\f268\"}[data-kentico-variant-listing-host] .icon-circle-empty[data-kentico-variant-listing]:before{content:\"\\f10c\"}[data-kentico-variant-listing-host] .icon-desktop[data-kentico-variant-listing]:before{content:\"\\f108\"}[data-kentico-variant-listing-host] .icon-down-dir[data-kentico-variant-listing]:before{content:\"\\e805\"}[data-kentico-variant-listing-host] .icon-edge[data-kentico-variant-listing]:before{content:\"\\f282\"}[data-kentico-variant-listing-host] .icon-filter-1[data-kentico-variant-listing]:before{content:\"\\f0b0\"}[data-kentico-variant-listing-host] .icon-firefox[data-kentico-variant-listing]:before{content:\"\\f269\"}[data-kentico-variant-listing-host] .icon-internet-explorer[data-kentico-variant-listing]:before{content:\"\\f26b\"}[data-kentico-variant-listing-host] .icon-linux[data-kentico-variant-listing]:before{content:\"\\f17c\"}[data-kentico-variant-listing-host] .icon-mobile[data-kentico-variant-listing]:before{content:\"\\f10b\"}[data-kentico-variant-listing-host] .icon-opera[data-kentico-variant-listing]:before{content:\"\\f26a\"}[data-kentico-variant-listing-host] .icon-paragraph-center[data-kentico-variant-listing]:before{content:\"\\e90a\"}[data-kentico-variant-listing-host] .icon-safari[data-kentico-variant-listing]:before{content:\"\\f267\"}[data-kentico-variant-listing-host] .icon-windows[data-kentico-variant-listing]:before{content:\"\\f17a\"}[data-kentico-variant-listing-host] .icon-add-module[data-kentico-variant-listing]:before{content:\"\\e90e\"}[data-kentico-variant-listing-host] .icon-convert[data-kentico-variant-listing]:before{content:\"\\e90d\"}[data-kentico-variant-listing-host] .icon-recaptcha[data-kentico-variant-listing]:before{content:\"\\e910\"}[data-kentico-variant-listing-host] .icon-scheme-path-circles-flipped[data-kentico-variant-listing]:before{content:\"\\e90f\"}[data-kentico-variant-listing-host] .icon-crosshair[data-kentico-variant-listing]{position:relative;display:inline-block}[data-kentico-variant-listing-host] .icon-crosshair[data-kentico-variant-listing]:before{content:\"\\e71b\";color:#fff;position:absolute;left:0;display:inline-block}[data-kentico-variant-listing-host] .icon-crosshair[data-kentico-variant-listing]:after{content:\"\\e71f\";position:absolute;left:0;display:inline-block}[data-kentico-variant-listing-host] .ktc-variant-item-list[data-kentico-variant-listing]{margin:0;padding:8px 0 0;background-color:#fff}[data-kentico-variant-listing-host] .ktc-variant-item-list.ktc-is-sorting[data-kentico-variant-listing] .ktc-variant-item.ktc-is-hovered[data-kentico-variant-listing]{background-color:#fff}[data-kentico-variant-listing-host] .ktc-variant-item-list.ktc-is-sorting[data-kentico-variant-listing] .ktc-variant-item.ktc-is-hovered[data-kentico-variant-listing] .ktc-variant-action-icons[data-kentico-variant-listing]{display:none}[data-kentico-variant-listing-host] .ktc-variant-item-list.ktc-is-sorting[data-kentico-variant-listing] .ktc-variant-item.ktc-variant-item--active.ktc-is-hovered[data-kentico-variant-listing]{background-color:#b3dce9}[data-kentico-variant-listing-host] .ktc-variant-item-list.ktc-is-sorting[data-kentico-variant-listing] .ktc-variant-item.sortable-dragging[data-kentico-variant-listing]{opacity:.7}[data-kentico-variant-listing-host] .ktc-variant-item-list[data-kentico-variant-listing] .ktc-variant-item[data-kentico-variant-listing]{display:block;width:284px;height:40px}[data-kentico-variant-listing-host] .ktc-variant-item-list[data-kentico-variant-listing] .ktc-variant-item.ktc-is-hovered[data-kentico-variant-listing]{background-color:#d0e8ed}[data-kentico-variant-listing-host] .ktc-variant-item-list[data-kentico-variant-listing] .ktc-variant-item.ktc-is-hovered[data-kentico-variant-listing], [data-kentico-variant-listing-host] .ktc-variant-item-list[data-kentico-variant-listing] .ktc-variant-item.ktc-is-hovered[data-kentico-variant-listing] *[data-kentico-variant-listing]{cursor:pointer}[data-kentico-variant-listing-host] .ktc-variant-item-list[data-kentico-variant-listing] .ktc-variant-item.ktc-is-hovered[data-kentico-variant-listing] .ktc-variant-action-icons[data-kentico-variant-listing]{display:inline-block}[data-kentico-variant-listing-host] .ktc-variant-item-list[data-kentico-variant-listing] .ktc-variant-item.ktc-variant-item--active[data-kentico-variant-listing]{background-color:#b3dce9}[data-kentico-variant-listing-host] .ktc-variant-item-list[data-kentico-variant-listing] .ktc-variant-item.ktc-variant-item--active[data-kentico-variant-listing], [data-kentico-variant-listing-host] .ktc-variant-item-list[data-kentico-variant-listing] .ktc-variant-item.ktc-variant-item--active[data-kentico-variant-listing] *[data-kentico-variant-listing]{cursor:default}[data-kentico-variant-listing-host] .ktc-variant-item-list[data-kentico-variant-listing] .ktc-variant-item.ktc-variant-item--active.ktc-is-hovered[data-kentico-variant-listing]{background-color:#d0e8ed}[data-kentico-variant-listing-host] .ktc-variant-item-list[data-kentico-variant-listing] .ktc-variant-item.ktc-variant-item--editable[data-kentico-variant-listing]{width:284px}[data-kentico-variant-listing-host] .ktc-variant-item-list[data-kentico-variant-listing] .ktc-variant-item.ktc-variant-item--editable[data-kentico-variant-listing] .ktc-variant-item-label[data-kentico-variant-listing]{width:264px}[data-kentico-variant-listing-host] .ktc-variant-item-list[data-kentico-variant-listing] .ktc-variant-item.ktc-variant-item--editable.ktc-is-hovered[data-kentico-variant-listing] .ktc-variant-item-label[data-kentico-variant-listing]{width:216px}[data-kentico-variant-listing-host] .ktc-variant-item-list[data-kentico-variant-listing] .ktc-variant-item[data-kentico-variant-listing] .ktc-drag-icon[data-kentico-variant-listing]{width:16px;display:inline-block;padding:11px 0 9px 4px}[data-kentico-variant-listing-host] .ktc-variant-item-list[data-kentico-variant-listing] .ktc-variant-item[data-kentico-variant-listing] .ktc-drag-icon[data-kentico-variant-listing], [data-kentico-variant-listing-host] .ktc-variant-item-list[data-kentico-variant-listing] .ktc-variant-item[data-kentico-variant-listing] .ktc-drag-icon[data-kentico-variant-listing] i[data-kentico-variant-listing]{cursor:move;cursor:-webkit-grab;cursor:grab}[data-kentico-variant-listing-host] .ktc-variant-item-list[data-kentico-variant-listing] .ktc-variant-item[data-kentico-variant-listing] .ktc-variant-item-label[data-kentico-variant-listing]{display:inline-block;vertical-align:top;width:284px;height:40px;line-height:40px;font-size:14px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding:0 8px;-webkit-box-sizing:border-box;box-sizing:border-box}[data-kentico-variant-listing-host] .ktc-variant-item-list[data-kentico-variant-listing] .ktc-variant-item[data-kentico-variant-listing] .ktc-variant-action-icons[data-kentico-variant-listing]{display:none;padding:11px 0 9px}[data-kentico-variant-listing-host] .ktc-variant-item-list[data-kentico-variant-listing] .ktc-variant-item[data-kentico-variant-listing] .ktc-variant-action-icons[data-kentico-variant-listing] .ktc-variant-action-icon[data-kentico-variant-listing]{-webkit-box-sizing:border-box;box-sizing:border-box;margin-right:8px}[data-kentico-variant-listing-host] .ktc-variant-item-list[data-kentico-variant-listing] .ktc-variant-item[data-kentico-variant-listing] .ktc-variant-action-icons[data-kentico-variant-listing] .ktc-variant-action-icon[data-kentico-variant-listing] i[data-kentico-variant-listing]{cursor:pointer;color:#696663;vertical-align:top}[data-kentico-variant-listing-host] .ktc-variant-item-list[data-kentico-variant-listing] .ktc-variant-item[data-kentico-variant-listing] .ktc-variant-action-icons[data-kentico-variant-listing] .ktc-variant-action-icon[data-kentico-variant-listing] i[data-kentico-variant-listing]:hover{color:#262524}[data-kentico-variant-listing-host] .ktc-variant-item-list[data-kentico-variant-listing] .sortable-placeholder[data-kentico-variant-listing]{display:block;width:284px;height:40px;background-color:#d0e8ed}"},enumerable:!0,configurable:!0}),e}();e.KenticoAddComponent=r,e.KenticoPopUpListing=i,e.KenticoVariantListing=V,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
lib.rs
|
use bevy::{
prelude::*,
asset::{Assets, HandleUntyped},
pbr::{NotShadowCaster, NotShadowReceiver},
reflect::TypeUuid,
render::{
render_resource::Shader,
mesh::{/*Indices,*/Mesh, VertexAttributeValues},
render_phase::AddRenderCommand, render_resource::PrimitiveTopology
}
};
mod render_dim;
// This module exists to "isolate" the `#[cfg]` attributes to this part of the
// code. Otherwise, we would pollute the code with a lot of feature
// gates-specific code.
#[cfg(feature = "3d")]
mod dim {
use bevy::{asset::Handle, render::mesh::Mesh};
pub(crate) use bevy::core_pipeline::Opaque3d as Phase;
pub(crate) use crate::render_dim::r3d::{queue, DebugLinePipeline, DrawDebugLines};
pub(crate) type MeshHandle = Handle<Mesh>;
pub(crate) fn from_handle(from: &MeshHandle) -> &Handle<Mesh> { from }
pub(crate) fn into_handle(from: Handle<Mesh>) -> MeshHandle { from }
pub(crate) const SHADER_FILE: &str = include_str!("debuglines.wgsl");
pub(crate) const DIMMENSION: &str = "3d";
}
#[cfg(not(feature = "3d"))]
mod dim {
use bevy::{asset::Handle, render::mesh::Mesh, sprite::Mesh2dHandle};
pub(crate) use bevy::core_pipeline::Transparent2d as Phase;
pub(crate) use crate::render_dim::r2d::{queue, DebugLinePipeline, DrawDebugLines};
pub(crate) type MeshHandle = Mesh2dHandle;
pub(crate) fn from_handle(from: &MeshHandle) -> &Handle<Mesh> { &from.0 }
pub(crate) fn
|
(from: Handle<Mesh>) -> MeshHandle { Mesh2dHandle(from) }
pub(crate) const SHADER_FILE: &str = include_str!("debuglines2d.wgsl");
pub(crate) const DIMMENSION: &str = "2d";
}
// See debuglines.wgsl for explanation on 2 shaders.
//pub(crate) const SHADER_FILE: &str = include_str!("debuglines.wgsl");
pub(crate) const DEBUG_LINES_SHADER_HANDLE: HandleUntyped =
HandleUntyped::weak_from_u64(Shader::TYPE_UUID, 17477439189930443325);
pub(crate) struct DebugLinesConfig {
depth_test: bool,
}
/// Bevy plugin, for initializing stuff.
///
/// # Usage
///
/// ```
/// use bevy::prelude::*;
/// use bevy_prototype_debug_lines::*;
///
/// App::new()
/// .add_plugins(DefaultPlugins)
/// .add_plugin(DebugLinesPlugin::default())
/// .run();
/// ```
///
/// Alternatively, you can initialize the plugin with depth testing, so that
/// debug lines cut through geometry. To do this, use [`DebugLinesPlugin::with_depth_test(true)`].
/// ```
/// use bevy::prelude::*;
/// use bevy_prototype_debug_lines::*;
///
/// App::new()
/// .add_plugins(DefaultPlugins)
/// .add_plugin(DebugLinesPlugin::with_depth_test(true))
/// .run();
/// ```
#[derive(Debug, Default, Clone)]
pub struct DebugLinesPlugin {
depth_test: bool,
}
impl DebugLinesPlugin {
/// Controls whether debug lines should be drawn with depth testing enabled
/// or disabled.
///
/// # Arguments
///
/// * `val` - True if lines should intersect with other geometry, or false
/// if lines should always draw on top be drawn on top (the default).
pub fn with_depth_test(val: bool) -> Self {
Self {
depth_test: val,
}
}
}
impl Plugin for DebugLinesPlugin {
fn build(&self, app: &mut App) {
use bevy::render::{render_resource::SpecializedPipelines, RenderApp, RenderStage};
let mut shaders = app.world.get_resource_mut::<Assets<Shader>>().unwrap();
shaders.set_untracked(
DEBUG_LINES_SHADER_HANDLE,
Shader::from_wgsl(dim::SHADER_FILE),
);
app.init_resource::<DebugLines>();
app.add_startup_system(setup)
.add_system_to_stage(CoreStage::PostUpdate, update.label("draw_lines"));
app.sub_app_mut(RenderApp)
.add_render_command::<dim::Phase, dim::DrawDebugLines>()
.insert_resource(DebugLinesConfig { depth_test: self.depth_test})
.init_resource::<dim::DebugLinePipeline>()
.init_resource::<SpecializedPipelines<dim::DebugLinePipeline>>()
.add_system_to_stage(RenderStage::Extract, extract)
.add_system_to_stage(RenderStage::Queue, dim::queue);
info!("Loaded {} debug lines plugin.", dim::DIMMENSION);
}
}
// Number of meshes to separate line buffers into.
// We don't really do culling currently but this is a gateway to that.
const MESH_COUNT: usize = 4;
// Maximum number of points for each individual mesh.
const MAX_POINTS_PER_MESH: usize = 2_usize.pow(16);
const _MAX_LINES_PER_MESH: usize = MAX_POINTS_PER_MESH / 2;
/// Maximum number of points.
pub const MAX_POINTS: usize = MAX_POINTS_PER_MESH * MESH_COUNT;
/// Maximum number of unique lines to draw at once.
pub const MAX_LINES: usize = MAX_POINTS / 2;
fn setup(mut cmds: Commands, mut meshes: ResMut<Assets<Mesh>>) {
// Spawn a bunch of meshes to use for lines.
for i in 0..MESH_COUNT {
// Create a new mesh with the number of vertices we need.
let mut mesh = Mesh::new(PrimitiveTopology::LineList);
mesh.set_attribute(
Mesh::ATTRIBUTE_POSITION,
VertexAttributeValues::Float32x3(Vec::with_capacity(MAX_POINTS_PER_MESH)),
);
mesh.set_attribute(
Mesh::ATTRIBUTE_COLOR,
VertexAttributeValues::Float32x4(Vec::with_capacity(MAX_POINTS_PER_MESH)),
);
// https://github.com/Toqozz/bevy_debug_lines/issues/16
// mesh.set_indices(Some(Indices::U16(Vec::with_capacity(MAX_POINTS_PER_MESH))));
let transform = Transform::from_xyz(0., 0., 9999.);
cmds.spawn_bundle((
dim::into_handle(meshes.add(mesh)),
NotShadowCaster,
NotShadowReceiver,
GlobalTransform::from(transform),
transform,
Visibility::default(),
ComputedVisibility::default(),
DebugLinesMesh(i),
));
}
}
fn update(
debug_line_meshes: Query<(&dim::MeshHandle, &DebugLinesMesh)>,
time: Res<Time>,
mut meshes: ResMut<Assets<Mesh>>,
mut lines: ResMut<DebugLines>,
) {
// For each debug line mesh, fill its buffers with the relevant positions/colors chunks.
for (mesh_handle, debug_lines_idx) in debug_line_meshes.iter() {
let mesh = meshes.get_mut(dim::from_handle(mesh_handle)).unwrap();
use VertexAttributeValues::{Float32x3, Float32x4};
if let Some(Float32x3(vbuffer)) = mesh.attribute_mut(Mesh::ATTRIBUTE_POSITION) {
vbuffer.clear();
if let Some(new_content) = lines.positions.chunks(MAX_POINTS_PER_MESH).nth(debug_lines_idx.0) {
vbuffer.extend(new_content);
}
}
if let Some(Float32x4(cbuffer)) = mesh.attribute_mut(Mesh::ATTRIBUTE_COLOR) {
cbuffer.clear();
if let Some(new_content) = lines.colors.chunks(MAX_POINTS_PER_MESH).nth(debug_lines_idx.0) {
cbuffer.extend(new_content);
}
}
/* https://github.com/Toqozz/bevy_debug_lines/issues/16
if let Some(Indices::U16(indices)) = mesh.indices_mut() {
indices.clear();
if let Some(new_content) = lines.durations.chunks(_MAX_LINES_PER_MESH).nth(debug_lines_idx.0) {
indices.extend(
new_content.iter().enumerate().map(|(i, _)| i as u16).flat_map(|i| [i * 2, i*2 + 1])
);
}
}
*/
}
// Processes stuff like getting rid of expired lines and stuff.
lines.update(time.delta_seconds());
}
/// Move the DebugLinesMesh marker Component to the render context.
fn extract(mut commands: Commands, query: Query<Entity, With<DebugLinesMesh>>) {
for entity in query.iter() {
commands.get_or_spawn(entity).insert(RenderDebugLinesMesh);
}
}
#[derive(Component)]
struct DebugLinesMesh(usize);
#[derive(Component)]
struct RenderDebugLinesMesh;
/// Bevy resource providing facilities to draw lines.
///
/// # Usage
/// ```
/// use bevy::prelude::*;
/// use bevy_prototype_debug_lines::*;
///
/// // Draws 3 horizontal lines, which disappear after 1 frame.
/// fn some_system(mut lines: ResMut<DebugLines>) {
/// lines.line(Vec3::new(-1.0, 1.0, 0.0), Vec3::new(1.0, 1.0, 0.0), 0.0);
/// lines.line_colored(
/// Vec3::new(-1.0, 0.0, 0.0),
/// Vec3::new(1.0, 0.0, 0.0),
/// 0.0,
/// Color::WHITE
/// );
/// lines.line_gradient(
/// Vec3::new(-1.0, -1.0, 0.0),
/// Vec3::new(1.0, -1.0, 0.0),
/// 0.0,
/// Color::WHITE, Color::PINK
/// );
/// }
/// ```
#[derive(Default)]
pub struct DebugLines {
pub positions: Vec<[f32; 3]>,
pub colors: Vec<[f32; 4]>,
pub durations: Vec<f32>,
}
impl DebugLines {
/// Draw a line in world space, or update an existing line
///
/// # Arguments
///
/// * `start` - The start of the line in world space
/// * `end` - The end of the line in world space
/// * `duration` - Duration (in seconds) that the line should show for -- a value of
/// zero will show the line for 1 frame.
pub fn line(&mut self, start: Vec3, end: Vec3, duration: f32) {
self.line_colored(start, end, duration, Color::WHITE);
}
/// Draw a line in world space with a specified color, or update an existing line
///
/// # Arguments
///
/// * `start` - The start of the line in world space
/// * `end` - The end of the line in world space
/// * `duration` - Duration (in seconds) that the line should show for -- a value of
/// zero will show the line for 1 frame.
/// * `color` - Line color
pub fn line_colored(&mut self, start: Vec3, end: Vec3, duration: f32, color: Color) {
self.line_gradient(start, end, duration, color, color);
}
/// Draw a line in world space with a specified gradient color, or update an existing line
///
/// # Arguments
///
/// * `start` - The start of the line in world space
/// * `end` - The end of the line in world space
/// * `duration` - Duration (in seconds) that the line should show for -- a value of
/// zero will show the line for 1 frame.
/// * `start_color` - Line color
/// * `end_color` - Line color
pub fn line_gradient(
&mut self,
start: Vec3,
end: Vec3,
duration: f32,
start_color: Color,
end_color: Color,
) {
if self.positions.len() >= MAX_POINTS {
warn!("Tried to add a new line when existing number of lines was already at maximum, ignoring.");
return;
}
self.positions.push(start.into());
self.positions.push(end.into());
self.colors.push(start_color.into());
self.colors.push(end_color.into());
self.durations.push(duration);
}
// Returns the indices of the start and end positions of the nth line.
// The indices can also be used to access color data.
fn nth(&self, idx: usize) -> (usize, usize) {
let i = idx * 2;
(i, i+1)
}
// Prepare [`ImmediateLinesStorage`] and [`RetainedLinesStorage`] for next
// frame.
// This clears the immediate mod buffers and tells the retained mode
// buffers to recompute expired lines list.
fn update(&mut self, dt: f32) {
// TODO: an actual line counter wouldn't hurt.
let mut i = 0;
let mut len = self.durations.len();
while i != len {
self.durations[i] -= dt;
// <= instead of < is fine here because this is always called AFTER sending the
// data to the mesh, so we're guaranteed at least a frame here.
if self.durations[i] <= 0.0 {
let (cur_s, cur_e) = self.nth(i);
let (last_s, last_e) = self.nth(len-1);
self.positions.swap(cur_s, last_s);
self.positions.swap(cur_e, last_e);
self.colors.swap(cur_s, last_s);
self.colors.swap(cur_e, last_e);
self.durations.swap(i, len-1);
len -= 1;
} else {
i += 1;
}
}
self.positions.truncate(len * 2);
self.colors.truncate(len * 2);
self.durations.truncate(len);
}
}
|
into_handle
|
build_db_node_mode.py
|
#!../bin/python3
# -*- coding:utf-8 -*-
"""
Copyright 2021 Jerome DE LUCCHI
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
import os
import sys
import json
from env import _SERVER_DIR
sys.path.insert(0, _SERVER_DIR)
from api import db
__DATAMODEL_DIR = os.path.join(os.path.abspath('..'), 'datamodel')
__DATAMODEL_NODE_MODE_FILE = os.path.join(__DATAMODEL_DIR, 'node_mode.template.mapping')
__ES_ADDR = db.ES_PROTOCOL + """://""" + str(db.ES_HOSTNAME) + """:""" + str(db.ES_PORT)
__CREATE_INDEX_TEMPLATE = """curl -s -XPUT -H \"Content-Type: Application/Json\" """ + __ES_ADDR + """/_template/blast_node_mode -d@""" + __DATAMODEL_NODE_MODE_FILE
__NODE_MODES = [
{"name": "maintenance"},
{"name": "pause"},
{"name": "running"}
]
def defineIndexTemplate():
try:
if json.load(os.popen(__CREATE_INDEX_TEMPLATE))["acknowledged"]:
return True
except KeyError:
return False
|
try:
for mode in __NODE_MODES:
__ES_PROVISION_DEFAULT = """curl -s -XPOST -H \"Content-Type: Application/Json\" """ + __ES_ADDR + """/blast_node_mode/_doc -d \'""" + json.dumps(mode) + """\'"""
if not json.load(os.popen(__ES_PROVISION_DEFAULT))["result"] == "created":
return False
return True
except KeyError:
return False
def main():
if defineIndexTemplate():
if provisionDefault():
sys.exit(0)
if __name__ == "__main__":
main()
|
def provisionDefault():
|
foreach.rs
|
mod support;
use csmlinterpreter::data::ast::Flow;
use csmlinterpreter::error_format::ErrorInfo;
use csmlinterpreter::parser::parse_flow;
use support::tools::read_file;
fn format_message(filepath: String) -> Result<Flow, ErrorInfo> {
let text = read_file(filepath).unwrap();
parse_flow(&text)
}
#[test]
fn foreach_0() {
let result = match format_message("CSML/basic_test/syntax/foreach/foreach_0.csml".to_owned()) {
Ok(_) => true,
Err(_) => false,
};
assert!(result);
}
#[test]
fn foreach_1() {
let result = match format_message("CSML/basic_test/syntax/foreach/foreach_1.csml".to_owned()) {
Ok(_) => true,
Err(_) => false,
};
assert!(result);
}
#[test]
fn foreach_2() {
let result = match format_message("CSML/basic_test/syntax/foreach/foreach_2.csml".to_owned()) {
Ok(_) => true,
Err(_) => false,
};
assert!(result);
}
#[test]
fn foreach_3() {
let result = match format_message("CSML/basic_test/syntax/foreach/foreach_3.csml".to_owned()) {
Ok(_) => true,
Err(_) => false,
};
assert!(result);
}
#[test]
fn foreach_4() {
let result = match format_message("CSML/basic_test/syntax/foreach/foreach_4.csml".to_owned()) {
Ok(_) => true,
Err(_) => false,
};
assert!(result);
}
#[test]
fn foreach_5() {
let result = match format_message("CSML/basic_test/syntax/foreach/foreach_5.csml".to_owned()) {
Ok(_) => true,
Err(_) => false,
};
assert!(result);
}
////////////////////////////////////////////////////////////////////////////////
/// FOREACH INVALID SYNTAX
////////////////////////////////////////////////////////////////////////////////
#[test]
fn foreach_6() {
let result = match format_message("CSML/basic_test/syntax/foreach/foreach_6.csml".to_owned()) {
Ok(_) => false,
Err(_) => true,
};
assert!(result);
}
#[test]
fn foreach_7()
|
#[test]
fn foreach_8() {
let result = match format_message("CSML/basic_test/syntax/foreach/foreach_8.csml".to_owned()) {
Ok(_) => false,
Err(_) => true,
};
assert!(result);
}
#[test]
fn foreach_9() {
let result = match format_message("CSML/basic_test/syntax/foreach/foreach_9.csml".to_owned()) {
Ok(_) => false,
Err(_) => true,
};
assert!(result);
}
#[test]
fn foreach_10() {
let result = match format_message("CSML/basic_test/syntax/foreach/foreach_10.csml".to_owned()) {
Ok(_) => false,
Err(_) => true,
};
assert!(result);
}
#[test]
fn foreach_11() {
let result = match format_message("CSML/basic_test/syntax/foreach/foreach_11.csml".to_owned()) {
Ok(_) => false,
Err(_) => true,
};
assert!(result);
}
#[test]
fn foreach_12() {
let result = match format_message("CSML/basic_test/syntax/foreach/foreach_12.csml".to_owned()) {
Ok(_) => false,
Err(_) => true,
};
assert!(result);
}
|
{
let result = match format_message("CSML/basic_test/syntax/foreach/foreach_7.csml".to_owned()) {
Ok(_) => false,
Err(_) => true,
};
assert!(result);
}
|
join.rs
|
use crate::check_msg;
use crate::VoiceManager;
use serenity::prelude::*;
use serenity::model::prelude::*;
use serenity::framework::standard::{
CommandResult,
macros::command,
};
#[command]
async fn join(ctx: &Context, msg: &Message) -> CommandResult
|
{
let guild = match msg.guild(&ctx.cache).await {
Some(guild) => guild,
None => {
check_msg(msg.channel_id.say(&ctx.http, "DMs not supported").await);
return Ok(());
}
};
let guild_id = guild.id;
let channel_id = guild
.voice_states.get(&msg.author.id)
.and_then(|voice_state| voice_state.channel_id);
let connect_to = match channel_id {
Some(channel) => channel,
None => {
check_msg(msg.reply(ctx, "Join a voice channel so I know which to join >.>").await);
return Ok(());
}
};
let manager_lock = ctx.data.read().await.get::<VoiceManager>().cloned().expect("Expected VoiceManager in TypeMap.");
let mut manager = manager_lock.lock().await;
if manager.join(guild_id, connect_to).is_some() {
check_msg(msg.channel_id.say(&ctx.http, &format!("Joined {}", connect_to.mention())).await);
} else {
check_msg(msg.channel_id.say(&ctx.http, "Error joining the channel").await);
}
Ok(())
}
|
|
lib.rs
|
#![allow(clippy::module_inception)]
#![allow(clippy::upper_case_acronyms)]
#![allow(clippy::large_enum_variant)]
#![allow(clippy::wrong_self_convention)]
#![allow(clippy::should_implement_trait)]
#![allow(clippy::blacklisted_name)]
#![allow(clippy::vec_init_then_push)]
#![allow(clippy::type_complexity)]
#![allow(rustdoc::bare_urls)]
#![warn(missing_docs)]
//! <p>The Amazon API Gateway Management API allows you to directly manage runtime aspects of your deployed APIs. To use it, you must explicitly set the SDK's endpoint to point to the endpoint of your deployed API. The endpoint will be of the form https://{api-id}.execute-api.{region}.amazonaws.com/{stage}, or will be the endpoint corresponding to your API's custom domain and base path, if applicable.</p>
//!
//! # Crate Organization
//!
//! The entry point for most customers will be [`Client`]. [`Client`] exposes one method for each API offered
//! by the service.
//!
//! Some APIs require complex or nested arguments. These exist in [`model`](crate::model).
//!
//! Lastly, errors that can be returned by the service are contained within [`error`]. [`Error`] defines a meta
//! error encompassing all possible errors that can be returned by the service.
//!
//! The other modules within this crate are not required for normal usage.
//!
//! # Examples
//! Examples can be found [here](https://github.com/awslabs/aws-sdk-rust/tree/main/examples/apigatewaymanagement).
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use error_meta::Error;
#[doc(inline)]
pub use config::Config;
mod aws_endpoint;
/// Client and fluent builders for calling the service.
pub mod client;
/// Configuration for the service.
pub mod config;
/// Errors that can occur when calling the service.
pub mod error;
mod error_meta;
/// Input structures for operations.
pub mod input;
mod json_deser;
mod json_errors;
pub mod middleware;
/// Data structures used by operation inputs/outputs.
pub mod model;
mod no_credentials;
/// All operations that this crate can perform.
pub mod operation;
mod operation_deser;
mod operation_ser;
/// Output structures for operations.
pub mod output;
/// Crate version number.
pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
/// Re-exported types from supporting crates.
pub mod types {
pub use aws_smithy_http::result::SdkError;
pub use aws_smithy_types::Blob;
pub use aws_smithy_types::DateTime;
}
static API_METADATA: aws_http::user_agent::ApiMetadata =
aws_http::user_agent::ApiMetadata::new("apigatewaymanagementapi", PKG_VERSION);
pub use aws_smithy_http::endpoint::Endpoint;
pub use aws_smithy_types::retry::RetryConfig;
pub use aws_types::app_name::AppName;
pub use aws_types::region::Region;
|
pub use aws_types::Credentials;
#[doc(inline)]
pub use client::Client;
|
|
Token.tsx
|
import { useEffect } from "react";
import { useState } from "react";
import { useSelector } from "react-redux";
import Web3 from "web3";
import ERC20Vault from '../abis/ERC20Vault.json';
import BaseVault from '../abis/BaseVault.json';
import EthVault from '../abis/EthVault.json';
import IERC20 from '../abis/IERC20.json';
import Registry from '../abis/Registry.json';
import { selectWallet } from "../slices/walletSlice";
import { getSelectedAddress } from "../utils/metaMask";
import { getTokenContractAddress } from "../utils/supportedChains";
import DatePicker from 'react-datepicker';
import "react-datepicker/dist/react-datepicker.css";
import { Button, Input, Table } from "semantic-ui-react";
interface IVaults {
[key: string] : Array<{
address: string;
balance: string;
releaseDate: Date;
}>
};
export default function Token() {
const wallet = useSelector(selectWallet);
const [loading, setLoading] = useState(true);
const [createMode, setCreateMode] = useState(false);
const [selectedDate, setSelectedDate] = useState(new Date());
const [selectedToken, setSelectedToken] = useState("ETH");
const [fundMode, setFundMode] = useState({} as {[key:string]: boolean});
const [selectedAmount, setSelectedAmount] = useState("0");
const [showStuff, setShowStuff] = useState(false);
function setFundModeForVault(address: string, isFundMode: boolean) {
setFundMode({
[address]: isFundMode
});
}
const [creatingVault, setCreatingVault] = useState(false);
const [funding, setFunding] = useState({} as {[key:string]: boolean});
const [releasing, setReleasing] = useState({} as {[key:string]: boolean});
function setFundingForVault(address: string, isFunding: boolean) {
setFunding({
...funding,
[address]: isFunding
});
}
function setReleasingForVault(address: string, isReleasing: boolean) {
setReleasing({
...releasing,
[address]: isReleasing
});
}
const [vaults, setVaults] = useState({} as IVaults);
const now = new Date();
const registryAddress = "0x64e3A6F2443d135176F2c82FA9303DA6B4606412";
useEffect(() => {
(async () => {
if(Web3.givenProvider && (await Web3.givenProvider.request({ method: 'eth_accounts' })).length > 0){
setShowStuff(true);
await getVaults();
}
setLoading(false);
})();
}, []);
async function parseVaults(rawShit: Array<string>) {
const vaults: IVaults = {};
const vaultCount = rawShit.length;
for (let i = 0; i < vaultCount; i++) {
const vault = rawShit[i];
const vaultAddress = vault[0];
const tokenSymbol = vault[1];
let balance: string;
const releaseDate = new Date(await getReleaseTimestamp(vaultAddress) * 1000);
if(tokenSymbol === "ETH"){
balance = await getEthBalance(vaultAddress);
}else{
balance = await getBalanceOf(vaultAddress);
}
const vaultObject = {
address: vaultAddress,
balance,
releaseDate
};
if (vaults[tokenSymbol]) {
vaults[tokenSymbol].push(vaultObject);
}else{
vaults[tokenSymbol] = [vaultObject];
}
}
return vaults;
}
async function getVaults() {
const web3 = new Web3(Web3.givenProvider);
const registry = new web3.eth.Contract(Registry.abi as any, registryAddress);
const res = await registry.methods.getVaults().call({
from: await getSelectedAddress()
});
setVaults(await parseVaults(res));
}
async function
|
(address: string) {
const web3 = new Web3(Web3.givenProvider);
const contract = new web3.eth.Contract(BaseVault.abi as any, address);
return await contract.methods.releaseTimestampInSeconds().call();
}
async function getBalanceOf(address: string) {
const web3 = new Web3(Web3.givenProvider);
const link = getTokenContract(web3);
return web3.utils.fromWei(await link.methods.balanceOf(address).call());
}
async function getEthBalance(address: string) {
const web3 = new Web3(Web3.givenProvider);
return web3.utils.fromWei(await web3.eth.getBalance(address));
}
async function createVault(token: string) {
setCreatingVault(true);
const web3 = new Web3(Web3.givenProvider);
if(token === "ETH"){
const contract = new web3.eth.Contract(EthVault.abi as any);
contract.deploy({
data: EthVault.bytecode,
arguments: [registryAddress, Math.round(selectedDate.getTime() / 1000)]
})
.send({
from: await getSelectedAddress()
})
.then(async () => await getVaults())
.finally(() => resetVaultFlags());
}
if(token === "LINK") {
const contract = new web3.eth.Contract(ERC20Vault.abi as any);
contract.deploy({
data: ERC20Vault.bytecode,
arguments: [ getTokenContractAddress(token, wallet.chainId as string), "LINK", registryAddress, Math.round(selectedDate.getTime() / 1000)]
})
.send({
from: await getSelectedAddress()
})
.then(async () => await getVaults())
.finally(() => resetVaultFlags());
}
}
function resetVaultFlags() {
setCreatingVault(false); setCreateMode(false)
}
async function fund(vaultAddress: string, amount: string) {
setFundingForVault(vaultAddress, true);
const web3 = new Web3(Web3.givenProvider);
const link = getTokenContract(web3);
link.methods.transfer(vaultAddress, web3.utils.toWei(amount.toString()))
.send({
from: await getSelectedAddress()
})
.then(async () => await getVaults())
.finally(() => resetFundFlags(vaultAddress));
}
async function fundEth(vaultAddress: string, amount: string) {
setFundingForVault(vaultAddress, true);
const web3 = new Web3(Web3.givenProvider);
const ethVault = new web3.eth.Contract(EthVault.abi as any, vaultAddress);
ethVault.methods.fund()
.send({
from: await getSelectedAddress(),
value: web3.utils.toWei(amount.toString())
})
.then(async () => await getVaults())
.finally(() => resetFundFlags(vaultAddress));
}
function resetFundFlags(address: string) {
setFundMode({});
setSelectedAmount("0");
setFundingForVault(address, false);
}
async function release(address: string) {
setReleasingForVault(address, true);
const web3 = new Web3(Web3.givenProvider);
const contract = new web3.eth.Contract(BaseVault.abi as any, address);
contract.methods.release()
.send({
from: await getSelectedAddress()
})
.then(async () => await getVaults())
.finally(() => setReleasingForVault(address, false));
}
function getTokenContract(web3: Web3) {
// LINK token contract on Rinkeby: 0x01BE23585060835E02B77ef475b0Cc51aA1e0709
return new web3.eth.Contract(IERC20.abi as any, "0x01BE23585060835E02B77ef475b0Cc51aA1e0709");
}
function formatDate(date: Date){
return date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
}
function renderFundButton(token: string, vaultAddress: string) {
return fundMode[vaultAddress] ? <>
<Input type="number" value={selectedAmount} onChange={e=>setSelectedAmount(e.target.value)}/>
<Button onClick={() => token === "ETH" ? fundEth(vaultAddress, selectedAmount) : fund(vaultAddress, selectedAmount)}>Go</Button>
<Button onClick={() => setFundModeForVault(vaultAddress, false)}>Cancel</Button>
</> : <Button onClick={()=>setFundModeForVault(vaultAddress, true)}>Fund</Button>
}
return <>
<div>
{
showStuff && <>
{
!createMode ? <div style={{ display: 'flex', justifyContent: 'flex-end' }}>
<Button disabled={creatingVault} onClick={() => setCreateMode(true)}>Create Vault</Button>
</div>
: <div style={{ textAlign: 'right'}}>
{
creatingVault ? <p>Creating {selectedToken} Vault. It could take up to 1 minute. Please wait...</p> : <>
<p>Choose the Release date. Please note that you can only do this ONCE. After that, you fund won't be available until the Release date and you won't be able to change it!</p>
<select onChange={e => setSelectedToken(e.target.value)} defaultValue={selectedToken}>
<option value="ETH">ETH</option>
<option value="LINK">LINK</option>
</select>
<DatePicker minDate={now} selected={selectedDate} onChange={(value: any) => setSelectedDate(value)}/> <Button onClick={e => createVault(selectedToken)}>Go</Button> <Button onClick={() => setCreateMode(false)}>Cancel</Button>
</>
}
</div>
}
</>
}
</div>
<Table>
<thead>
<tr>
<th>Token</th>
<th>Vault</th>
<th>Balance</th>
<th>Release Date</th>
<th>Action</th>
</tr>
</thead>
{
loading ? <tbody>
<tr>
<td colSpan={5}>Loading your precious Vaults...</td>
</tr>
</tbody> :
<tbody>
{
Object.keys(vaults).length > 0 ?
Object.keys(vaults).map(token =>
vaults[token].map(vault => {
return <tr key={vault.address}>
<td>{token}</td>
<td>{vault.address}</td>
<td>{vault.balance} {token}</td>
<td>{formatDate(vault.releaseDate)}</td>
<td>
{
funding[vault.address] ? <span>Funding. It could take up to 1 minute...</span> :
releasing[vault.address] ? <span>Releasing. It could take up to 1 minute...</span> : <>
{renderFundButton(token, vault.address)} <Button disabled={now < vault.releaseDate} onClick={() => release(vault.address)}>Release</Button>
</>
}
</td>
</tr>
})) : <tr>
<td colSpan={5} style={{textAlign: 'center'}}>Looks like you don't have any Vault yet.</td>
</tr>
}
</tbody>
}
</Table>
</>
}
|
getReleaseTimestamp
|
app.component.spec.ts
|
/* tslint:disable:no-unused-variable */
import { TestBed, async} from '@angular/core/testing';
import { AppComponent } from './app.component';
import { TranslateModule } from '@ngx-translate/core';
import { CoreModule } from './core/core.module';
import { LayoutModule } from './layout/layout.module';
import { SharedModule } from './shared/shared.module';
import { RoutesModule } from './routes/routes.module';
import { APP_BASE_HREF } from '@angular/common';
describe('App: Ng2angle', () => {
beforeEach(() => {
jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;
TestBed.configureTestingModule({
declarations: [
AppComponent
],
imports: [
TranslateModule.forRoot(),
CoreModule,
LayoutModule,
SharedModule,
RoutesModule
],
providers: [
{ provide: APP_BASE_HREF, useValue: '/' }
]
});
});
it('should create the app', async(() => {
let fixture = TestBed.createComponent(AppComponent);
let app = fixture.debugElement.componentInstance;
|
expect(app).toBeTruthy();
}));
});
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.