diff --git a/go.mod b/go.mod index 2884a712..a6e8089c 100644 --- a/go.mod +++ b/go.mod @@ -3,82 +3,96 @@ module github.com/realio-tech/multi-staking-module go 1.22.2 require ( + cosmossdk.io/core v0.11.1 cosmossdk.io/errors v1.0.1 + cosmossdk.io/log v1.4.1 cosmossdk.io/math v1.3.0 cosmossdk.io/simapp v0.0.0-20230608160436-666c345ad23d - cosmossdk.io/tools/rosetta v0.2.1 - github.com/cometbft/cometbft v0.37.5 - github.com/cometbft/cometbft-db v0.12.0 + cosmossdk.io/store v1.1.1 + cosmossdk.io/tools/confix v0.1.1 + cosmossdk.io/x/evidence v0.1.1 + cosmossdk.io/x/feegrant v0.1.1 + cosmossdk.io/x/tx v0.13.5 + cosmossdk.io/x/upgrade v0.1.4 + github.com/cometbft/cometbft v0.38.12 + github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.5 - github.com/cosmos/cosmos-sdk v0.47.11 - github.com/cosmos/gogoproto v1.4.10 + github.com/cosmos/cosmos-sdk v0.50.10 + github.com/cosmos/gogoproto v1.7.0 + github.com/cosmos/rosetta v0.50.10 github.com/golang/protobuf v1.5.4 - github.com/gorilla/mux v1.8.0 + github.com/gorilla/mux v1.8.1 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/rakyll/statik v0.1.7 + github.com/rs/zerolog v1.33.0 github.com/spf13/cast v1.6.0 - github.com/spf13/cobra v1.8.0 + github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 - google.golang.org/grpc v1.62.1 - google.golang.org/protobuf v1.33.0 + google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 + google.golang.org/grpc v1.64.1 + google.golang.org/protobuf v1.34.2 sigs.k8s.io/yaml v1.4.0 ) require ( - cloud.google.com/go v0.112.0 // indirect - cloud.google.com/go/compute v1.23.3 // indirect - cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v1.1.5 // indirect - cloud.google.com/go/storage v1.36.0 // indirect - cosmossdk.io/api v0.3.1 // indirect - cosmossdk.io/core v0.5.1 // indirect - cosmossdk.io/depinject v1.0.0-alpha.4 // indirect - cosmossdk.io/log v1.3.1 // indirect + cloud.google.com/go v0.112.1 // indirect + cloud.google.com/go/compute/metadata v0.3.0 // indirect + cloud.google.com/go/iam v1.1.6 // indirect + cloud.google.com/go/storage v1.38.0 // indirect + cosmossdk.io/api v0.7.5 // indirect + cosmossdk.io/collections v0.4.0 // indirect + cosmossdk.io/depinject v1.0.0 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect - github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect - github.com/DataDog/zstd v1.5.0 // indirect - github.com/armon/go-metrics v0.4.1 // indirect - github.com/aws/aws-sdk-go v1.44.203 // indirect + github.com/DataDog/datadog-go v3.2.0+incompatible // indirect + github.com/DataDog/zstd v1.5.5 // indirect + github.com/PuerkitoBio/purell v1.1.1 // indirect + github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect + github.com/aws/aws-sdk-go v1.44.224 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect + github.com/bits-and-blooms/bitset v1.8.0 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect - github.com/cockroachdb/errors v1.11.1 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v1.1.0 // indirect + github.com/cockroachdb/pebble v1.1.1 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect - github.com/confio/ics23/go v0.9.0 // indirect + github.com/cometbft/cometbft-db v0.12.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v0.20.1 // indirect - github.com/cosmos/ledger-cosmos-go v0.12.4 // indirect + github.com/cosmos/iavl v1.2.0 // indirect + github.com/cosmos/ics23/go v0.11.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect - github.com/creachadair/taskgroup v0.3.2 // indirect + github.com/creachadair/atomicfile v0.3.1 // indirect + github.com/creachadair/tomledit v0.0.24 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v4 v4.2.0 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.6.0 // indirect + github.com/emicklei/dot v1.6.1 // indirect + github.com/fatih/color v1.15.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/getsentry/sentry-go v0.23.0 // indirect + github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect - github.com/go-logfmt/logfmt v0.5.1 // indirect - github.com/go-logr/logr v1.3.0 // indirect + github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect @@ -94,93 +108,98 @@ require ( github.com/google/s2a-go v0.1.7 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect - github.com/googleapis/gax-go/v2 v2.12.0 // indirect - github.com/gorilla/handlers v1.5.1 // indirect - github.com/gorilla/websocket v1.5.0 // indirect - github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect + github.com/googleapis/gax-go/v2 v2.12.3 // indirect + github.com/gorilla/handlers v1.5.2 // indirect + github.com/gorilla/websocket v1.5.3 // indirect + github.com/goware/urlx v0.3.2 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect - github.com/gtank/merlin v0.1.1 // indirect - github.com/gtank/ristretto255 v0.1.2 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter v1.7.1 // indirect + github.com/hashicorp/go-getter v1.7.4 // indirect + github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-metrics v0.5.3 // indirect + github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect + github.com/hashicorp/go-uuid v1.0.2 // indirect github.com/hashicorp/go-version v1.6.0 // indirect - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect + github.com/iancoleman/strcase v0.3.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.0 // indirect + github.com/klauspost/compress v1.17.9 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect - github.com/pelletier/go-toml/v2 v2.1.0 // indirect - github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect + github.com/oklog/run v1.1.0 // indirect + github.com/pelletier/go-toml/v2 v2.2.2 // indirect + github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.14.0 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.42.0 // indirect - github.com/prometheus/procfs v0.9.0 // indirect + github.com/prometheus/client_golang v1.20.1 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect - github.com/rs/cors v1.8.2 // indirect - github.com/rs/zerolog v1.32.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect + github.com/rs/cors v1.11.1 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.18.2 // indirect + github.com/spf13/viper v1.19.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tidwall/btree v1.6.0 // indirect + github.com/tidwall/btree v1.7.0 // indirect + github.com/ugorji/go/codec v1.2.11 // indirect github.com/ulikunitz/xz v0.5.11 // indirect github.com/zondax/hid v0.9.2 // indirect github.com/zondax/ledger-go v0.14.3 // indirect go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect - go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect - go.uber.org/atomic v1.10.0 // indirect - go.uber.org/multierr v1.9.0 // indirect - golang.org/x/crypto v0.21.0 // indirect - golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect - golang.org/x/net v0.23.0 // indirect - golang.org/x/oauth2 v0.16.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect - golang.org/x/text v0.14.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect + go.opentelemetry.io/otel v1.24.0 // indirect + go.opentelemetry.io/otel/metric v1.24.0 // indirect + go.opentelemetry.io/otel/trace v1.24.0 // indirect + go.uber.org/multierr v1.10.0 // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/oauth2 v0.21.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/term v0.23.0 // indirect + golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.5.0 // indirect - google.golang.org/api v0.155.0 // indirect - google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect + google.golang.org/api v0.171.0 // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + gotest.tools/v3 v3.5.1 // indirect nhooyr.io/websocket v1.8.6 // indirect pgregory.net/rapid v1.1.0 // indirect ) @@ -188,8 +207,9 @@ require ( replace ( // use cosmos fork of keyring github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 + github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // stick with compatible version or x/exp in v0.47.x line - golang.org/x/exp => golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb + // golang.org/x/exp => golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb // stick with compatible version of rapid in v0.47.x line pgregory.net/rapid => pgregory.net/rapid v0.5.5 ) diff --git a/go.sum b/go.sum index 06b55192..283ec240 100644 --- a/go.sum +++ b/go.sum @@ -32,8 +32,8 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9 cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.112.0 h1:tpFCD7hpHFlQ8yPwT3x+QeXqc2T6+n6T+hmABHfDUSM= -cloud.google.com/go v0.112.0/go.mod h1:3jEEVwZ/MHU4djK5t5RHuKOA/GbLddgTdVubX1qnPD4= +cloud.google.com/go v0.112.1 h1:uJSeirPke5UNZHIb4SxfZklVSiWWVqW4oXlETwZziwM= +cloud.google.com/go v0.112.1/go.mod h1:+Vbu+Y1UU+I1rjmzeMOb/8RfkKJK2Gyxi1X6jJCZLo4= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= @@ -71,10 +71,8 @@ cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk= -cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= -cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= -cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= @@ -112,8 +110,8 @@ cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y97 cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v1.1.5 h1:1jTsCu4bcsNsE4iiqNT5SHwrDRCfRmIaaaVFhRveTJI= -cloud.google.com/go/iam v1.1.5/go.mod h1:rB6P/Ic3mykPbFio+vo7403drjlgvoWfYpJhMXEbzv8= +cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= +cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= @@ -174,8 +172,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.36.0 h1:P0mOkAcaJxhCTvAkMhxMfrTKiNcub4YmmPBtlhAyTr8= -cloud.google.com/go/storage v1.36.0/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8= +cloud.google.com/go/storage v1.38.0 h1:Az68ZRGlnNTpIBbLjSMIV2BDcwwXYlRlQzis0llkpJg= +cloud.google.com/go/storage v1.38.0/go.mod h1:tlUADB0mAb9BgYls9lq+8MGkfzOXuLrnHXlpHmvFJoY= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= @@ -188,22 +186,35 @@ cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuW cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= -cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= -cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= -cosmossdk.io/core v0.5.1 h1:vQVtFrIYOQJDV3f7rw4pjjVqc1id4+mE0L9hHP66pyI= -cosmossdk.io/core v0.5.1/go.mod h1:KZtwHCLjcFuo0nmDc24Xy6CRNEL9Vl/MeimQ2aC7NLE= -cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= -cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= +cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= +cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= +cosmossdk.io/core v0.11.1 h1:h9WfBey7NAiFfIcUhDVNS503I2P2HdZLebJlUIs8LPA= +cosmossdk.io/core v0.11.1/go.mod h1:OJzxcdC+RPrgGF8NJZR2uoQr56tc7gfBKhiKeDO7hH0= +cosmossdk.io/depinject v1.0.0 h1:dQaTu6+O6askNXO06+jyeUAnF2/ssKwrrszP9t5q050= +cosmossdk.io/depinject v1.0.0/go.mod h1:zxK/h3HgHoA/eJVtiSsoaRaRA2D5U4cJ5thIG4ssbB8= cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= -cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= -cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= +cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= +cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/simapp v0.0.0-20230608160436-666c345ad23d h1:E/8y0oG3u9hBR8l4F9MtC0LdZIamPCUwUoLlrHrX86I= cosmossdk.io/simapp v0.0.0-20230608160436-666c345ad23d/go.mod h1:xbjky3L3DJEylaho6gXplkrMvJ5sFgv+qNX+Nn47bzY= -cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= -cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= +cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= +cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= +cosmossdk.io/tools/confix v0.1.1 h1:aexyRv9+y15veH3Qw16lxQwo+ki7r2I+g0yNTEFEQM8= +cosmossdk.io/tools/confix v0.1.1/go.mod h1:nQVvP1tHsGXS83PonPVWJtSbddIqyjEw99L4M3rPJyQ= +cosmossdk.io/x/evidence v0.1.1 h1:Ks+BLTa3uftFpElLTDp9L76t2b58htjVbSZ86aoK/E4= +cosmossdk.io/x/evidence v0.1.1/go.mod h1:OoDsWlbtuyqS70LY51aX8FBTvguQqvFrt78qL7UzeNc= +cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8= +cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ= +cosmossdk.io/x/tx v0.13.5 h1:FdnU+MdmFWn1pTsbfU0OCf2u6mJ8cqc1H4OMG418MLw= +cosmossdk.io/x/tx v0.13.5/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= +cosmossdk.io/x/upgrade v0.1.4 h1:/BWJim24QHoXde8Bc64/2BSEB6W4eTydq0X/2f8+g38= +cosmossdk.io/x/upgrade v0.1.4/go.mod h1:9v0Aj+fs97O+Ztw+tG3/tp5JSlrmT7IcFhAebQHmOPo= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -214,21 +225,26 @@ github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= -github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.5.0 h1:+K/VEwIAaPcHiMtQvpLD4lqW7f0Gk3xdYZmI1hD+CXo= github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= +github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= +github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= @@ -255,15 +271,13 @@ github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= -github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= -github.com/aws/aws-sdk-go v1.44.203 h1:pcsP805b9acL3wUqa4JR2vg1k2wnItkDYNvfmcy6F+U= -github.com/aws/aws-sdk-go v1.44.203/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.224 h1:09CiaaF35nRmxrzWZ2uRq5v6Ghg/d2RiPjZnSgtt+RQ= +github.com/aws/aws-sdk-go v1.44.224/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= @@ -274,6 +288,7 @@ github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7 github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -283,6 +298,8 @@ github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= +github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= @@ -291,10 +308,10 @@ github.com/btcsuite/btcd v0.21.0-beta.0.20201114000516-e9c7a5ac6401/go.mod h1:Sv github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= -github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= -github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ= -github.com/btcsuite/btcd/btcutil v1.1.2/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= +github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= +github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= +github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= @@ -310,8 +327,8 @@ github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= -github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= +github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= +github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= @@ -324,8 +341,8 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= @@ -350,19 +367,19 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa h1:jQCWAUqqlij9Pgj2i/PB79y4KOPYVyFYdROxgaCwdTQ= -github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa/go.mod h1:x/1Gn8zydmfq8dk6e9PdstVsDgu9RuyIIJqAaF//0IM= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= -github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= -github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v1.1.0 h1:pcFh8CdCIt2kmEpK0OIatq67Ln9uGDYY3d5XnE0LJG4= -github.com/cockroachdb/pebble v1.1.0/go.mod h1:sEHm5NOXxyiAoKWhoFxT8xMgd/f3RA6qUqQ1BXKrh2E= +github.com/cockroachdb/pebble v1.1.1 h1:XnKU22oiCLy2Xn8vp1re67cXg4SAasg/WDt1NtcRFaw= +github.com/cockroachdb/pebble v1.1.1/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= @@ -371,12 +388,10 @@ github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= -github.com/cometbft/cometbft v0.37.5 h1:/U/TlgMh4NdnXNo+YU9T2NMCWyhXNDF34Mx582jlvq0= -github.com/cometbft/cometbft v0.37.5/go.mod h1:QC+mU0lBhKn8r9qvmnq53Dmf3DWBt4VtkcKw2C81wxY= +github.com/cometbft/cometbft v0.38.12 h1:OWsLZN2KcSSFe8bet9xCn07VwhBnavPea3VyPnNq1bg= +github.com/cometbft/cometbft v0.38.12/go.mod h1:GPHp3/pehPqgX1930HmK1BpBLZPxB75v/dZg8Viwy+o= github.com/cometbft/cometbft-db v0.12.0 h1:v77/z0VyfSU7k682IzZeZPFZrQAKiQwkqGN0QzAjMi0= github.com/cometbft/cometbft-db v0.12.0/go.mod h1:aX2NbCrjNVd2ZajYxt1BsiFf/Z+TQ2MN0VxdicheYuw= -github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= -github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= github.com/consensys/bavard v0.1.8-0.20210915155054-088da2f7f54a/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q= @@ -391,31 +406,38 @@ github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= +github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= +github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= -github.com/cosmos/cosmos-sdk v0.47.11 h1:0Qx7eORw0RJqPv+mvDuU8NQ1LV3nJJKJnPoYblWHolc= -github.com/cosmos/cosmos-sdk v0.47.11/go.mod h1:ADjORYzUQqQv/FxDi0H0K5gW/rAk1CiDR3ZKsExfJV0= -github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= +github.com/cosmos/cosmos-sdk v0.50.10 h1:zXfeu/z653tWZARr/jESzAEiCUYjgJwwG4ytnYWMoDM= +github.com/cosmos/cosmos-sdk v0.50.10/go.mod h1:6Eesrx3ZE7vxBZWpK++30H+Uc7Q4ahQWCL7JKU/LEdU= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= -github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= -github.com/cosmos/iavl v0.20.1 h1:rM1kqeG3/HBT85vsZdoSNsehciqUQPWrR4BYmqE2+zg= -github.com/cosmos/iavl v0.20.1/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/cosmos/iavl v1.2.0 h1:kVxTmjTh4k0Dh1VNL046v6BXqKziqMDzxo93oh3kOfM= +github.com/cosmos/iavl v1.2.0/go.mod h1:HidWWLVAtODJqFD6Hbne2Y0q3SdxByJepHUOeoH4LiI= +github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= +github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw= -github.com/cosmos/ledger-cosmos-go v0.12.4/go.mod h1:fjfVWRf++Xkygt9wzCsjEBdjcf7wiiY35fv3ctT+k4M= +github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= +github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= +github.com/cosmos/rosetta v0.50.10 h1:JML9H+TYnpiUn1TucVmV5XVH9YF/Nd/GJqesaIpXq0c= +github.com/cosmos/rosetta v0.50.10/go.mod h1:x7LfYPXzDkS3/8idE+ASifOokJacOiJGdrlj6/r8Bz0= github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creachadair/taskgroup v0.3.2 h1:zlfutDS+5XG40AOxcHDSThxKzns8Tnr9jnr6VqkYlkM= -github.com/creachadair/taskgroup v0.3.2/go.mod h1:wieWwecHVzsidg2CsUnFinW1faVN4+kq+TDlRJQ0Wbk= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creachadair/atomicfile v0.3.1 h1:yQORkHjSYySh/tv5th1dkKcn02NEW5JleB84sjt+W4Q= +github.com/creachadair/atomicfile v0.3.1/go.mod h1:mwfrkRxFKwpNAflYZzytbSwxvbK6fdGRRlp0KEQc0qU= +github.com/creachadair/tomledit v0.0.24 h1:5Xjr25R2esu1rKCbQEmjZYlrhFkDspoAbAKb6QKQDhQ= +github.com/creachadair/tomledit v0.0.24/go.mod h1:9qHbShRWQzSCcn617cMzg4eab1vbLCOjOshAWSzWr8U= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= @@ -428,11 +450,12 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= -github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= +github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M= github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= @@ -472,6 +495,8 @@ github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1 github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/emicklei/dot v1.6.1 h1:ujpDlBkkwgWUY+qPId5IwapRW/xEoligRSYjioR6DFI= +github.com/emicklei/dot v1.6.1/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -483,12 +508,11 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= -github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= github.com/ethereum/go-ethereum v1.10.17/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd6X2wyEV2SvGhk0= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= +github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= @@ -501,14 +525,13 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= -github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE= -github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= @@ -520,21 +543,25 @@ github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1T github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= +github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= -github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= @@ -554,7 +581,6 @@ github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5Nq github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= @@ -673,7 +699,6 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= @@ -701,38 +726,37 @@ github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99 github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= -github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= +github.com/googleapis/gax-go/v2 v2.12.3 h1:5/zPPDvw8Q1SuXjrqrZslrqT7dL/uJT2CQii/cLCKqA= +github.com/googleapis/gax-go/v2 v2.12.3/go.mod h1:AKloxT6GtNbaLm8QTNSidHUVsHYcBHwWRvkNFJUQcS4= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= -github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= +github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= +github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/goware/urlx v0.3.2 h1:gdoo4kBHlkqZNaf6XlQ12LGtQOmpKJrR04Rc3RnpJEo= +github.com/goware/urlx v0.3.2/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLcgjw= github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= -github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= -github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -741,13 +765,19 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-getter v1.7.1 h1:SWiSWN/42qdpR0MdhaOc/bLR48PLuP1ZQtYLRlM69uY= -github.com/hashicorp/go-getter v1.7.1/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-getter v1.7.4 h1:3yQjWuxICvSpYwqSayAdKRFcvBl1y/vogCxczWSmix0= +github.com/hashicorp/go-getter v1.7.4/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= +github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= +github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= +github.com/hashicorp/go-plugin v1.5.2/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= @@ -755,22 +785,28 @@ github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoD github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= +github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= +github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= @@ -783,6 +819,8 @@ github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXM github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/huin/goupnp v1.0.3-0.20220313090229-ca81a64b4204/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= @@ -806,8 +844,8 @@ github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+ github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= -github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= +github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= +github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= @@ -844,8 +882,8 @@ github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= -github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= @@ -860,6 +898,7 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= @@ -870,8 +909,6 @@ github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ic github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= @@ -891,6 +928,7 @@ github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= @@ -910,12 +948,8 @@ github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -945,6 +979,8 @@ github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3P github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -963,27 +999,26 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= +github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= -github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= +github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= +github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= @@ -1009,14 +1044,14 @@ github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144T github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= -github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= +github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 h1:hDSdbBuw3Lefr6R18ax0tZ2BJeNB3NehB3trOwYBsdU= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= @@ -1039,16 +1074,16 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= -github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= +github.com/prometheus/client_golang v1.20.1 h1:IMJXHOD6eARkQpxo8KkhgEVFlBNm+nkrFUyGlIu7Na8= +github.com/prometheus/client_golang v1.20.1/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -1057,16 +1092,16 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= -github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= -github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= @@ -1079,14 +1114,14 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U= -github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= -github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -1127,16 +1162,16 @@ github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= -github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= -github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= +github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= +github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -1163,13 +1198,12 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= -github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= -github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= -github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= +github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= +github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.14.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= @@ -1182,12 +1216,11 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1 github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/tyler-smith/go-bip39 v1.0.2/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= -github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= -github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= @@ -1229,32 +1262,34 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 h1:SpGay3w+nEwMpfVnbqOLH5gY52/foP8RE8UzTZ1pdSE= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1/go.mod h1:4UoMYEZOC0yN/sPGH76KPkkU7zgiEWYWL9vwmbnTJPE= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 h1:aFJWCqJMNjENlcleuuOkGAPH82y0yULBScfXcIEdS24= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo= -go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= -go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= -go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= -go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= -go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= -go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= -go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= -go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= +go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= +go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= +go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= +go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= +go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw= +go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc= +go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= +go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= -go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= +go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1266,7 +1301,6 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -1276,12 +1310,27 @@ golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWP golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb h1:xIApU0ow1zwMa2uL1VDNeQlNVFTWMQxZUZCMDy0Q4Us= -golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= +golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1294,18 +1343,20 @@ golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPI golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1354,7 +1405,6 @@ golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -1371,8 +1421,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1398,8 +1448,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= -golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= +golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= +golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1414,8 +1464,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1428,6 +1478,7 @@ golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1439,6 +1490,7 @@ golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1472,7 +1524,6 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1496,7 +1547,9 @@ golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1520,14 +1573,14 @@ golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1537,10 +1590,9 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1558,6 +1610,7 @@ golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -1566,9 +1619,12 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1582,6 +1638,7 @@ golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1600,7 +1657,6 @@ golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82u golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= @@ -1610,9 +1666,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= -golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1620,8 +1675,9 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= @@ -1677,8 +1733,8 @@ google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.155.0 h1:vBmGhCYs0djJttDNynWo44zosHlPvHmA0XiN2zP2DtA= -google.golang.org/api v0.155.0/go.mod h1:GI5qK5f40kCpHfPn6+YzGAByIKWv8ujFnmoWm7Igduk= +google.golang.org/api v0.171.0 h1:w174hnBPqut76FzW5Qaupt7zY8Kql6fiVjgys4f58sU= +google.golang.org/api v0.171.0/go.mod h1:Hnq5AHm4OTMt2BUVjael2CWZFD6vksJdWCWiUAmjC9o= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1687,8 +1743,6 @@ google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= -google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1797,12 +1851,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ= -google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro= -google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 h1:Lj5rbfG876hIAYFjqiJnPHfhXbv+nzTWfm04Fg/XSVU= -google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 h1:RFiFrvy37/mpSpdySBDrUdipW/dHwsRwh3J3+A9VgT4= +google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237/go.mod h1:Z5Iiy3jtmioajWHDGFk7CeugTyHtPvMHA4UTmUkyalE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 h1:SbSDUWW1PAO24TNpLdeheoYPd7kllICcLU52x6eD4kQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1844,8 +1898,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA= +google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1862,8 +1916,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1899,7 +1953,6 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= diff --git a/proto/multistaking/v1/multi_staking.proto b/proto/multistaking/v1/multi_staking.proto index 5d1b2a4d..1b3be7b2 100644 --- a/proto/multistaking/v1/multi_staking.proto +++ b/proto/multistaking/v1/multi_staking.proto @@ -14,12 +14,12 @@ message MultiStakingCoin { string denom = 1; string amount = 2 [ (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; string bond_weight = 3 [ (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; } @@ -70,7 +70,7 @@ message MultiStakingCoinInfo { string denom = 1; string bond_weight = 2 [ (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; } @@ -88,12 +88,12 @@ message ValidatorInfo { cosmos.staking.v1beta1.BondStatus status = 4; string tokens = 5 [ (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; string delegator_shares = 6 [ (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; cosmos.staking.v1beta1.Description description = 7 @@ -105,7 +105,7 @@ message ValidatorInfo { [ (gogoproto.nullable) = false ]; string min_self_delegation = 11 [ (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; string bond_denom = 12; diff --git a/proto/multistaking/v1/proposals.proto b/proto/multistaking/v1/proposals.proto index 057e5293..502b0090 100644 --- a/proto/multistaking/v1/proposals.proto +++ b/proto/multistaking/v1/proposals.proto @@ -19,7 +19,7 @@ message AddMultiStakingCoinProposal { string denom = 3; string bond_weight = 4 [ (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec" + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec" ]; } @@ -35,6 +35,6 @@ message UpdateBondWeightProposal { string denom = 3; string updated_bond_weight = 4 [ (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec" + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec" ]; } \ No newline at end of file diff --git a/proto/multistaking/v1/query.proto b/proto/multistaking/v1/query.proto index a1ccf405..a8b91904 100644 --- a/proto/multistaking/v1/query.proto +++ b/proto/multistaking/v1/query.proto @@ -110,7 +110,7 @@ message QueryBondWeightRequest { string denom = 1; } message QueryBondWeightResponse { string weight = 1 [ (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; diff --git a/proto/multistaking/v1/tx.proto b/proto/multistaking/v1/tx.proto index 14bd54e9..db7df779 100644 --- a/proto/multistaking/v1/tx.proto +++ b/proto/multistaking/v1/tx.proto @@ -10,6 +10,8 @@ import "cosmos_proto/cosmos.proto"; option go_package = "github.com/realiotech/multi-staking/x/multi-staking/types"; service Msg { + option (cosmos.msg.v1.service) = true; + rpc UpdateMultiStakingParams(MsgUpdateMultiStakingParams) returns (MsgUpdateMultiStakingParamsResponse); } diff --git a/test/simapp/app.go b/test/simapp/app.go index 986c1392..69ae03fe 100644 --- a/test/simapp/app.go +++ b/test/simapp/app.go @@ -1,12 +1,13 @@ package simapp import ( - "encoding/json" "io" "net/http" "os" "path/filepath" + dbm "github.com/cosmos/cosmos-db" + "github.com/cosmos/gogoproto/proto" "github.com/gorilla/mux" "github.com/rakyll/statik/fs" multistaking "github.com/realio-tech/multi-staking-module/x/multi-staking" @@ -14,29 +15,44 @@ import ( multistakingtypes "github.com/realio-tech/multi-staking-module/x/multi-staking/types" "github.com/spf13/cast" - _ "github.com/cosmos/cosmos-sdk/client/docs/statik" // this is used for serving docs - + "cosmossdk.io/log" simappparams "cosmossdk.io/simapp/params" + storetypes "cosmossdk.io/store/types" + "cosmossdk.io/x/evidence" + evidencekeeper "cosmossdk.io/x/evidence/keeper" + evidencetypes "cosmossdk.io/x/evidence/types" + "cosmossdk.io/x/feegrant" + feegrantkeeper "cosmossdk.io/x/feegrant/keeper" + feegrantmodule "cosmossdk.io/x/feegrant/module" + "cosmossdk.io/x/tx/signing" + "cosmossdk.io/x/upgrade" + upgradekeeper "cosmossdk.io/x/upgrade/keeper" + upgradetypes "cosmossdk.io/x/upgrade/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" "github.com/cosmos/cosmos-sdk/client/grpc/node" - "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/server/api" "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + "github.com/cosmos/cosmos-sdk/std" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + sigtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/auth" "github.com/cosmos/cosmos-sdk/x/auth/ante" + authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" - authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" + "github.com/cosmos/cosmos-sdk/x/auth/tx" + txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/auth/vesting" vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" @@ -46,9 +62,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/bank" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/capability" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" "github.com/cosmos/cosmos-sdk/x/crisis" @@ -57,12 +70,6 @@ import ( distr "github.com/cosmos/cosmos-sdk/x/distribution" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/cosmos/cosmos-sdk/x/evidence" - evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - "github.com/cosmos/cosmos-sdk/x/feegrant" - feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" - feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module" "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" "github.com/cosmos/cosmos-sdk/x/gov" @@ -87,14 +94,9 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/cosmos-sdk/x/upgrade" - upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" - upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - dbm "github.com/cometbft/cometbft-db" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" + tmjson "github.com/cometbft/cometbft/libs/json" tmos "github.com/cometbft/cometbft/libs/os" ) @@ -111,7 +113,6 @@ var ( auth.AppModuleBasic{}, genutil.AppModuleBasic{}, bank.AppModuleBasic{}, - capability.AppModuleBasic{}, staking.AppModuleBasic{}, multistaking.AppModuleBasic{}, mint.AppModuleBasic{}, @@ -119,8 +120,6 @@ var ( gov.NewAppModuleBasic( []govclient.ProposalHandler{ paramsclient.ProposalHandler, - upgradeclient.LegacyProposalHandler, - upgradeclient.LegacyCancelProposalHandler, multistaking.AddMultiStakingProposalHandler, multistaking.UpdateBondWeightProposalHandler, }, @@ -161,18 +160,17 @@ type SimApp struct { legacyAmino *codec.LegacyAmino appCodec codec.Codec interfaceRegistry types.InterfaceRegistry + txConfig client.TxConfig invCheckPeriod uint // keys to access the substores - keys map[string]*storetypes.KVStoreKey - tkeys map[string]*storetypes.TransientStoreKey - memKeys map[string]*storetypes.MemoryStoreKey + keys map[string]*storetypes.KVStoreKey + tkeys map[string]*storetypes.TransientStoreKey // keepers AccountKeeper authkeeper.AccountKeeper BankKeeper bankkeeper.Keeper - CapabilityKeeper *capabilitykeeper.Keeper StakingKeeper *stakingkeeper.Keeper MultiStakingKeeper multistakingkeeper.Keeper SlashingKeeper slashingkeeper.Keeper @@ -180,7 +178,7 @@ type SimApp struct { DistrKeeper distrkeeper.Keeper GovKeeper govkeeper.Keeper GroupKeeper groupkeeper.Keeper - CrisisKeeper crisiskeeper.Keeper + CrisisKeeper *crisiskeeper.Keeper UpgradeKeeper upgradekeeper.Keeper ParamsKeeper paramskeeper.Keeper AuthzKeeper authzkeeper.Keeper @@ -213,25 +211,57 @@ func NewSimApp( homePath string, invCheckPeriod uint, encodingConfig simappparams.EncodingConfig, appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), ) *SimApp { - appCodec := encodingConfig.Codec - legacyAmino := encodingConfig.Amino - interfaceRegistry := encodingConfig.InterfaceRegistry + legacyAmino := codec.NewLegacyAmino() + interfaceRegistry, err := types.NewInterfaceRegistryWithOptions(types.InterfaceRegistryOptions{ + ProtoFiles: proto.HybridResolver, + SigningOptions: signing.Options{ + AddressCodec: address.Bech32Codec{ + Bech32Prefix: sdk.GetConfig().GetBech32AccountAddrPrefix(), + }, + ValidatorAddressCodec: address.Bech32Codec{ + Bech32Prefix: sdk.GetConfig().GetBech32ValidatorAddrPrefix(), + }, + }, + }) + appCodec := codec.NewProtoCodec(interfaceRegistry) + txConfig := tx.NewTxConfig(appCodec, tx.DefaultSignModes) + if err := txConfig.SigningContext().Validate(); err != nil { + panic(err) + } + + encodingConfig = simappparams.EncodingConfig{ + InterfaceRegistry: interfaceRegistry, + Codec: appCodec, + TxConfig: txConfig, + Amino: legacyAmino, + } + + // interfaceRegistry = testutil.CodecOptions{}.NewInterfaceRegistry() + if err != nil { + panic(err) + } + + std.RegisterLegacyAminoCodec(legacyAmino) + std.RegisterInterfaces(interfaceRegistry) bApp := baseapp.NewBaseApp(appName, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions...) + bApp.SetCommitMultiStoreTracer(traceStore) + bApp.SetVersion(version.Version) + bApp.SetInterfaceRegistry(interfaceRegistry) - bApp.SetTxEncoder(encodingConfig.TxConfig.TxEncoder()) - keys := sdk.NewKVStoreKeys( + bApp.SetTxEncoder(txConfig.TxEncoder()) + + keys := storetypes.NewKVStoreKeys( authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, multistakingtypes.StoreKey, minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, govtypes.StoreKey, group.StoreKey, paramstypes.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, - evidencetypes.StoreKey, capabilitytypes.StoreKey, crisistypes.StoreKey, + evidencetypes.StoreKey, crisistypes.StoreKey, authzkeeper.StoreKey, consensusparamtypes.StoreKey, ) - tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) - memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) + tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey) app := &SimApp{ BaseApp: bApp, @@ -241,7 +271,7 @@ func NewSimApp( invCheckPeriod: invCheckPeriod, keys: keys, tkeys: tkeys, - memKeys: memKeys, + txConfig: txConfig, } app.ParamsKeeper = initParamsKeeper( @@ -254,47 +284,58 @@ func NewSimApp( // set the BaseApp's parameter store app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper( appCodec, - keys[consensusparamtypes.StoreKey], + runtime.NewKVStoreService(keys[consensusparamtypes.StoreKey]), authtypes.NewModuleAddress(govtypes.ModuleName).String(), + runtime.EventService{}, ) - bApp.SetParamStore(&app.ConsensusParamsKeeper) - - app.CapabilityKeeper = capabilitykeeper.NewKeeper( - appCodec, - keys[capabilitytypes.StoreKey], - memKeys[capabilitytypes.MemStoreKey], - ) - - // seal capability keeper after scoping modules - app.CapabilityKeeper.Seal() + bApp.SetParamStore(app.ConsensusParamsKeeper.ParamsStore) // SDK module keepers app.AccountKeeper = authkeeper.NewAccountKeeper( appCodec, - keys[authtypes.StoreKey], + runtime.NewKVStoreService(keys[authtypes.StoreKey]), authtypes.ProtoBaseAccount, maccPerms, + address.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), sdk.GetConfig().GetBech32AccountAddrPrefix(), authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) app.BankKeeper = bankkeeper.NewBaseKeeper( appCodec, - keys[banktypes.StoreKey], + runtime.NewKVStoreService(keys[banktypes.StoreKey]), app.AccountKeeper, app.ModuleAccountAddrs(), authtypes.NewModuleAddress(govtypes.ModuleName).String(), + logger, + ) + + enabledSignModes := append(tx.DefaultSignModes, sigtypes.SignMode_SIGN_MODE_TEXTUAL) //nolint + txConfigOpts := tx.ConfigOptions{ + EnabledSignModes: enabledSignModes, + TextualCoinMetadataQueryFn: txmodule.NewBankKeeperCoinMetadataQueryFn(app.BankKeeper), + } + txConfig, err = tx.NewTxConfigWithOptions( + appCodec, + txConfigOpts, ) + if err != nil { + panic(err) + } + app.txConfig = txConfig + app.StakingKeeper = stakingkeeper.NewKeeper( appCodec, - keys[stakingtypes.StoreKey], + runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()), + authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()), ) app.MintKeeper = mintkeeper.NewKeeper( appCodec, - keys[minttypes.StoreKey], + runtime.NewKVStoreService(keys[minttypes.StoreKey]), app.StakingKeeper, app.AccountKeeper, app.BankKeeper, @@ -303,7 +344,7 @@ func NewSimApp( ) app.DistrKeeper = distrkeeper.NewKeeper( appCodec, - keys[distrtypes.StoreKey], + runtime.NewKVStoreService(keys[distrtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, app.StakingKeeper, @@ -314,29 +355,30 @@ func NewSimApp( app.SlashingKeeper = slashingkeeper.NewKeeper( appCodec, legacyAmino, - keys[slashingtypes.StoreKey], + runtime.NewKVStoreService(keys[slashingtypes.StoreKey]), app.StakingKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) - app.CrisisKeeper = *crisiskeeper.NewKeeper( + app.CrisisKeeper = crisiskeeper.NewKeeper( appCodec, - keys[crisistypes.StoreKey], + runtime.NewKVStoreService(keys[crisistypes.StoreKey]), invCheckPeriod, app.BankKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + app.AccountKeeper.AddressCodec(), ) app.FeeGrantKeeper = feegrantkeeper.NewKeeper( appCodec, - keys[feegrant.StoreKey], + runtime.NewKVStoreService(keys[feegrant.StoreKey]), app.AccountKeeper, ) app.UpgradeKeeper = *upgradekeeper.NewKeeper( skipUpgradeHeights, - keys[upgradetypes.StoreKey], + runtime.NewKVStoreService(keys[upgradetypes.StoreKey]), appCodec, homePath, - app.BaseApp, + bApp, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) // register the staking hooks @@ -355,13 +397,17 @@ func NewSimApp( authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) - app.AuthzKeeper = authzkeeper.NewKeeper(keys[authzkeeper.StoreKey], appCodec, app.MsgServiceRouter(), app.AccountKeeper) + app.AuthzKeeper = authzkeeper.NewKeeper( + runtime.NewKVStoreService(keys[authzkeeper.StoreKey]), + appCodec, + bApp.MsgServiceRouter(), + app.AccountKeeper, + ) // register the proposal types govRouter := govv1beta1.NewRouter() govRouter.AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler). AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). - AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(&app.UpgradeKeeper)). AddRoute(multistakingtypes.RouterKey, multistaking.NewMultiStakingProposalHandler(&app.MultiStakingKeeper)) govConfig := govtypes.DefaultConfig() @@ -371,11 +417,14 @@ func NewSimApp( */ govKeeper := govkeeper.NewKeeper( appCodec, - keys[govtypes.StoreKey], + runtime.NewKVStoreService(keys[govtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, + // use the ProviderKeeper as StakingKeeper for gov + // because governance should be based on the consensus-active validators. app.StakingKeeper, - app.MsgServiceRouter(), + app.DistrKeeper, + bApp.MsgServiceRouter(), govConfig, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) @@ -397,9 +446,11 @@ func NewSimApp( // create evidence keeper with router evidenceKeeper := evidencekeeper.NewKeeper( appCodec, - keys[evidencetypes.StoreKey], + runtime.NewKVStoreService(keys[evidencetypes.StoreKey]), app.StakingKeeper, app.SlashingKeeper, + app.AccountKeeper.AddressCodec(), + runtime.ProvideCometInfoService(), ) app.EvidenceKeeper = *evidenceKeeper // If evidence needs to be handled for the app, set routes in router here and seal @@ -415,27 +466,30 @@ func NewSimApp( // must be passed by reference here. app.mm = module.NewManager( // SDK app modules - genutil.NewAppModule( - app.AccountKeeper, app.StakingKeeper, app.BaseApp.DeliverTx, - encodingConfig.TxConfig, - ), - auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)), + genutil.NewAppModule(app.AccountKeeper, app.StakingKeeper, app, txConfig), + auth.NewAppModule(appCodec, app.AccountKeeper, nil, app.GetSubspace(authtypes.ModuleName)), vesting.NewAppModule(app.AccountKeeper, app.BankKeeper), bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)), - capability.NewAppModule(appCodec, *app.CapabilityKeeper, false), feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), groupmodule.NewAppModule(appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)), - slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName)), + slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName), app.interfaceRegistry), distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)), multistaking.NewAppModule(appCodec, app.MultiStakingKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)), - upgrade.NewAppModule(&app.UpgradeKeeper), + upgrade.NewAppModule(&app.UpgradeKeeper, app.AccountKeeper.AddressCodec()), evidence.NewAppModule(app.EvidenceKeeper), params.NewAppModule(app.ParamsKeeper), authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), - crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), // always be last to make sure that it checks for all invariants and not only part of them + crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), // always be last to make sure that it checks for all invariants and not only part of them + + ) + ModuleBasics.RegisterLegacyAminoCodec(legacyAmino) + ModuleBasics.RegisterInterfaces(interfaceRegistry) + + app.mm.SetOrderPreBlockers( + upgradetypes.ModuleName, ) // During begin block slashing happens after distr.BeginBlocker so that @@ -444,7 +498,7 @@ func NewSimApp( // NOTE: staking module is required if HistoricalEntries param > 0 // NOTE: capability module's beginblocker must come before any modules using capabilities app.mm.SetOrderBeginBlockers( - upgradetypes.ModuleName, capabilitytypes.ModuleName, minttypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName, + upgradetypes.ModuleName, minttypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName, multistakingtypes.ModuleName, evidencetypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, govtypes.ModuleName, crisistypes.ModuleName, genutiltypes.ModuleName, authz.ModuleName, feegrant.ModuleName, @@ -453,7 +507,7 @@ func NewSimApp( app.mm.SetOrderEndBlockers( crisistypes.ModuleName, govtypes.ModuleName, multistakingtypes.ModuleName, - capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName, + authtypes.ModuleName, banktypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName, minttypes.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName, feegrant.ModuleName, paramstypes.ModuleName, upgradetypes.ModuleName, vestingtypes.ModuleName, group.ModuleName, ) @@ -464,7 +518,7 @@ func NewSimApp( // so that other modules that want to create or claim capabilities afterwards in InitChain // can do so safely. app.mm.SetOrderInitGenesis( - capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, distrtypes.ModuleName, + authtypes.ModuleName, banktypes.ModuleName, distrtypes.ModuleName, multistakingtypes.ModuleName, slashingtypes.ModuleName, govtypes.ModuleName, minttypes.ModuleName, crisistypes.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName, @@ -472,9 +526,12 @@ func NewSimApp( vestingtypes.ModuleName, group.ModuleName, ) - app.mm.RegisterInvariants(&app.CrisisKeeper) + app.mm.RegisterInvariants(app.CrisisKeeper) app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter()) - app.mm.RegisterServices(app.configurator) + err = app.mm.RegisterServices(app.configurator) + if err != nil { + panic(err) + } // add test gRPC service for testing gRPC queries in isolation testdata.RegisterQueryServer(app.GRPCQueryRouter(), testdata.QueryImpl{}) @@ -486,12 +543,12 @@ func NewSimApp( app.sm = module.NewSimulationManager( auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)), bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)), - capability.NewAppModule(appCodec, *app.CapabilityKeeper, false), + multistaking.NewAppModule(appCodec, app.MultiStakingKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(multistakingtypes.ModuleName)), feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)), distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)), - slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName)), + slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName), app.interfaceRegistry), params.NewAppModule(app.ParamsKeeper), evidence.NewAppModule(app.EvidenceKeeper), authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), @@ -502,7 +559,6 @@ func NewSimApp( // initialize stores app.MountKVStores(keys) app.MountTransientStores(tkeys) - app.MountMemoryStores(memKeys) // initialize BaseApp anteHandler, err := ante.NewAnteHandler( @@ -520,6 +576,7 @@ func NewSimApp( app.SetAnteHandler(anteHandler) app.SetInitChainer(app.InitChainer) + app.SetPreBlocker(app.PreBlocker) app.SetBeginBlocker(app.BeginBlocker) app.SetEndBlocker(app.EndBlocker) @@ -535,24 +592,37 @@ func NewSimApp( // Name returns the name of the App func (app *SimApp) Name() string { return app.BaseApp.Name() } +func (app *SimApp) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error) { + return app.mm.PreBlock(ctx) +} + // BeginBlocker application updates every begin block -func (app *SimApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock { - return app.mm.BeginBlock(ctx, req) +func (app *SimApp) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error) { + return app.mm.BeginBlock(ctx) } // EndBlocker application updates every end block -func (app *SimApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { - return app.mm.EndBlock(ctx, req) +func (app *SimApp) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error) { + return app.mm.EndBlock(ctx) } // InitChainer application update at chain initialization -func (app *SimApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { +func (app *SimApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) { var genesisState GenesisState - if err := json.Unmarshal(req.AppStateBytes, &genesisState); err != nil { + if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil { panic(err) } - app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) - return app.mm.InitGenesis(ctx, app.appCodec, genesisState) + + if err := app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()); err != nil { + panic(err) + } + + response, err := app.mm.InitGenesis(ctx, app.appCodec, genesisState) + if err != nil { + panic(err) + } + + return response, nil } // LoadHeight loads a particular height @@ -565,9 +635,9 @@ func (app *SimApp) LoadHeight(height int64) error { func (app *SimApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { clientCtx := apiSvr.ClientCtx // Register new tx routes from grpc-gateway. - authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + tx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register new tendermint queries routes from grpc-gateway. - tmservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + cmtservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register legacy and grpc-gateway routes for all modules. ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) @@ -580,12 +650,12 @@ func (app *SimApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APICon // RegisterTxService implements the Application.RegisterTxService method. func (app *SimApp) RegisterTxService(clientCtx client.Context) { - authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry) + tx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry) } // RegisterTendermintService implements the Application.RegisterTendermintService method. func (app *SimApp) RegisterTendermintService(clientCtx client.Context) { - tmservice.RegisterTendermintService( + cmtservice.RegisterTendermintService( clientCtx, app.BaseApp.GRPCQueryRouter(), app.interfaceRegistry, @@ -595,8 +665,13 @@ func (app *SimApp) RegisterTendermintService(clientCtx client.Context) { // RegisterNodeService registers the node gRPC service on the provided // application gRPC query router. -func (app *SimApp) RegisterNodeService(clientCtx client.Context) { - node.RegisterNodeService(clientCtx, app.GRPCQueryRouter()) +func (app *SimApp) RegisterNodeService(clientCtx client.Context, cfg config.Config) { + node.RegisterNodeService(clientCtx, app.GRPCQueryRouter(), cfg) +} + +// TxConfig returns SimApp's TxConfig +func (app *SimApp) TxConfig() client.TxConfig { + return app.txConfig } // RegisterSwaggerAPI registers swagger route with API Server diff --git a/test/simapp/app_getter.go b/test/simapp/app_getter.go index 58fa5669..a96998af 100644 --- a/test/simapp/app_getter.go +++ b/test/simapp/app_getter.go @@ -1,11 +1,10 @@ package simapp import ( - _ "github.com/cosmos/cosmos-sdk/client/docs/statik" // this is used for serving docs + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" "github.com/cosmos/cosmos-sdk/types/module" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" diff --git a/test/simapp/config.go b/test/simapp/config.go index 98df982b..48cc053f 100644 --- a/test/simapp/config.go +++ b/test/simapp/config.go @@ -22,6 +22,7 @@ var ( FlagCommitValue bool FlagOnOperationValue bool // TODO: Remove in favor of binary search for invariant violation FlagAllInvariantsValue bool + FlagDBBackendValue string FlagEnabledValue bool FlagVerboseValue bool @@ -46,6 +47,7 @@ func GetSimulatorFlags() { flag.BoolVar(&FlagCommitValue, "Commit", false, "have the simulation commit") flag.BoolVar(&FlagOnOperationValue, "SimulateEveryOperation", false, "run slow invariants every operation") flag.BoolVar(&FlagAllInvariantsValue, "PrintAllInvariants", false, "print all invariants if a broken invariant is found") + flag.StringVar(&FlagDBBackendValue, "DBBackend", "goleveldb", "custom db backend type") // simulation flags flag.BoolVar(&FlagEnabledValue, "Enabled", false, "enable the simulation") @@ -71,5 +73,6 @@ func NewConfigFromFlags() simulation.Config { Commit: FlagCommitValue, OnOperation: FlagOnOperationValue, AllInvariants: FlagAllInvariantsValue, + DBBackend: FlagDBBackendValue, } } diff --git a/test/simapp/export.go b/test/simapp/export.go index f11be700..ced09eb9 100644 --- a/test/simapp/export.go +++ b/test/simapp/export.go @@ -4,6 +4,8 @@ import ( "encoding/json" "log" + storetypes "cosmossdk.io/store/types" + servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" @@ -17,9 +19,10 @@ import ( // file. func (app *SimApp) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, + modulesToExport []string, ) (servertypes.ExportedApp, error) { // as if they could withdraw from the start of the next block - ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) + ctx := app.BaseApp.NewContextLegacy(true, tmproto.Header{Height: app.LastBlockHeight()}) // We export at last height + 1, because that's the height at which // Tendermint will start InitChain. @@ -29,7 +32,10 @@ func (app *SimApp) ExportAppStateAndValidators( app.prepForZeroHeightGenesis(ctx, jailAllowedAddrs) } - genState := app.mm.ExportGenesis(ctx, app.appCodec) + genState, err := app.mm.ExportGenesisForModules(ctx, app.appCodec, modulesToExport) + if err != nil { + return servertypes.ExportedApp{}, err + } appState, err := json.MarshalIndent(genState, "", " ") if err != nil { return servertypes.ExportedApp{}, err @@ -71,13 +77,26 @@ func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [] /* Handle fee distribution state. */ // withdraw all validator commission - app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { - _, _ = app.DistrKeeper.WithdrawValidatorCommission(ctx, val.GetOperator()) + err := app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + valAddr, err := app.StakingKeeper.ValidatorAddressCodec().StringToBytes(val.GetOperator()) + if err != nil { + app.Logger().Error(err.Error(), "ValOperatorAddress", val.GetOperator()) + } + _, err = app.DistrKeeper.WithdrawValidatorCommission(ctx, valAddr) + if err != nil { + app.Logger().Error(err.Error(), "ValOperatorAddress", val.GetOperator()) + } return false }) + if err != nil { + panic(err) + } // withdraw all delegator rewards - dels := app.StakingKeeper.GetAllDelegations(ctx) + dels, err := app.StakingKeeper.GetAllDelegations(ctx) + if err != nil { + panic(err) + } for _, delegation := range dels { valAddr, err := sdk.ValAddressFromBech32(delegation.ValidatorAddress) if err != nil { @@ -88,7 +107,11 @@ func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [] if err != nil { panic(err) } - _, _ = app.DistrKeeper.WithdrawDelegationRewards(ctx, delAddr, valAddr) + + _, err = app.DistrKeeper.WithdrawDelegationRewards(ctx, delAddr, valAddr) + if err != nil { + panic(err) + } } // clear validator slash events @@ -102,16 +125,33 @@ func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [] ctx = ctx.WithBlockHeight(0) // reinitialize all validators - app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { - // donate any unwithdrawn outstanding reward fraction tokens to the community pool - scraps := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, val.GetOperator()) - feePool := app.DistrKeeper.GetFeePool(ctx) + err = app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + // donate any unwithdrawn outstanding reward fraction tokens to the community pool. + valAddr, err := app.StakingKeeper.ValidatorAddressCodec().StringToBytes(val.GetOperator()) + if err != nil { + panic(err) + } + scraps, err := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, valAddr) + if err != nil { + panic(err) + } + feePool, err := app.DistrKeeper.FeePool.Get(ctx) + if err != nil { + panic(err) + } feePool.CommunityPool = feePool.CommunityPool.Add(scraps...) - app.DistrKeeper.SetFeePool(ctx, feePool) - - err := app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator()) - return err != nil + err = app.DistrKeeper.FeePool.Set(ctx, feePool) + if err != nil { + panic(err) + } + if err := app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, valAddr); err != nil { + panic(err) + } + return false }) + if err != nil { + panic(err) + } // reinitialize all delegations for _, del := range dels { @@ -139,61 +179,77 @@ func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [] /* Handle staking state. */ // iterate through redelegations, reset creation height - app.StakingKeeper.IterateRedelegations(ctx, func(_ int64, red stakingtypes.Redelegation) (stop bool) { + err = app.StakingKeeper.IterateRedelegations(ctx, func(_ int64, red stakingtypes.Redelegation) (stop bool) { for i := range red.Entries { red.Entries[i].CreationHeight = 0 } - app.StakingKeeper.SetRedelegation(ctx, red) - return false + err = app.StakingKeeper.SetRedelegation(ctx, red) + return err != nil }) + if err != nil { + panic(err) + } // iterate through unbonding delegations, reset creation height - app.StakingKeeper.IterateUnbondingDelegations(ctx, func(_ int64, ubd stakingtypes.UnbondingDelegation) (stop bool) { + err = app.StakingKeeper.IterateUnbondingDelegations(ctx, func(_ int64, ubd stakingtypes.UnbondingDelegation) (stop bool) { for i := range ubd.Entries { ubd.Entries[i].CreationHeight = 0 } - app.StakingKeeper.SetUnbondingDelegation(ctx, ubd) - return false + err = app.StakingKeeper.SetUnbondingDelegation(ctx, ubd) + return err != nil }) + if err != nil { + panic(err) + } // Iterate through validators by power descending, reset bond heights, and // update bond intra-tx counters. - store := ctx.KVStore(app.keys[stakingtypes.StoreKey]) - iter := sdk.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey) - counter := int16(0) + store := ctx.KVStore(app.GetKey(stakingtypes.StoreKey)) + iter := storetypes.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey) - for ; iter.Valid(); iter.Next() { - addr := sdk.ValAddress(stakingtypes.AddressFromValidatorsKey(iter.Key())) - validator, found := app.StakingKeeper.GetValidator(ctx, addr) - if !found { - panic("expected validator, not found") - } + counter := int16(0) - validator.UnbondingHeight = 0 - if applyAllowedAddrs && !allowedAddrsMap[addr.String()] { - validator.Jailed = true + func() { + defer iter.Close() + for ; iter.Valid(); iter.Next() { + addr := sdk.ValAddress(stakingtypes.AddressFromValidatorsKey(iter.Key())) + validator, err := app.StakingKeeper.GetValidator(ctx, addr) + if err != nil { + panic("expected validator, not found") + } + + validator.UnbondingHeight = 0 + if applyAllowedAddrs && !allowedAddrsMap[addr.String()] { + validator.Jailed = true + } + + if err = app.StakingKeeper.SetValidator(ctx, validator); err != nil { + panic(err) + } + + counter++ } + }() - app.StakingKeeper.SetValidator(ctx, validator) - counter++ - } - - iter.Close() - - _, err := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + _, err = app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) if err != nil { - log.Fatal(err) + panic(err) } /* Handle slashing state. */ // reset start height on signing infos - app.SlashingKeeper.IterateValidatorSigningInfos( + err = app.SlashingKeeper.IterateValidatorSigningInfos( ctx, func(addr sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) { info.StartHeight = 0 - app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info) + if err = app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info); err != nil { + panic(err) + } return false }, ) + if err != nil { + panic(err) + } } diff --git a/test/simapp/sim_bench_test.go b/test/simapp/sim_bench_test.go index 63bb36c2..0cbc46f5 100644 --- a/test/simapp/sim_bench_test.go +++ b/test/simapp/sim_bench_test.go @@ -5,6 +5,7 @@ import ( "os" "testing" + "github.com/cosmos/cosmos-sdk/baseapp" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" @@ -28,7 +29,7 @@ func BenchmarkFullAppSimulation(b *testing.B) { } }() - app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), EmptyAppOptions{}, interBlockCacheOpt()) + app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), EmptyAppOptions{}, interBlockCacheOpt(), baseapp.SetChainID(config.ChainID)) // run randomized simulation _, simParams, simErr := simulation.SimulateFromSeed( @@ -74,7 +75,7 @@ func BenchmarkInvariants(b *testing.B) { } }() - app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), EmptyAppOptions{}, interBlockCacheOpt()) + app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), EmptyAppOptions{}, interBlockCacheOpt(), baseapp.SetChainID(config.ChainID)) // run randomized simulation _, simParams, simErr := simulation.SimulateFromSeed( @@ -102,7 +103,7 @@ func BenchmarkInvariants(b *testing.B) { PrintStats(db) } - ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight() + 1}) + ctx := app.NewContextLegacy(true, tmproto.Header{Height: app.LastBlockHeight() + 1}) // 3. Benchmark each invariant separately // diff --git a/test/simapp/sim_test.go b/test/simapp/sim_test.go index 70144a14..630d696e 100644 --- a/test/simapp/sim_test.go +++ b/test/simapp/sim_test.go @@ -5,21 +5,26 @@ import ( "fmt" "math/rand" "os" + "runtime/debug" + "strings" "testing" + dbm "github.com/cosmos/cosmos-db" + "github.com/rs/zerolog" "github.com/stretchr/testify/require" + "cosmossdk.io/log" + "cosmossdk.io/store" + storetypes "cosmossdk.io/store/types" + evidencetypes "cosmossdk.io/x/evidence/types" + "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/store" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" @@ -27,10 +32,8 @@ import ( slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - dbm "github.com/cometbft/cometbft-db" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" ) // Get flags every time the simulator is run @@ -68,7 +71,7 @@ func TestFullAppSimulation(t *testing.T) { require.NoError(t, os.RemoveAll(dir)) }() - app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), EmptyAppOptions{}, fauxMerkleModeOpt) + app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), EmptyAppOptions{}, interBlockCacheOpt(), baseapp.SetChainID(config.ChainID)) require.Equal(t, "SimApp", app.Name()) // run randomized simulation @@ -106,7 +109,7 @@ func TestAppImportExport(t *testing.T) { require.NoError(t, os.RemoveAll(dir)) }() - app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), EmptyAppOptions{}, fauxMerkleModeOpt) + app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), EmptyAppOptions{}, interBlockCacheOpt(), baseapp.SetChainID(config.ChainID)) require.Equal(t, "SimApp", app.Name()) // Run randomized simulation @@ -133,7 +136,7 @@ func TestAppImportExport(t *testing.T) { fmt.Printf("exporting genesis...\n") - exported, err := app.ExportAppStateAndValidators(false, []string{}) + exported, err := app.ExportAppStateAndValidators(false, []string{}, []string{}) require.NoError(t, err) fmt.Printf("importing genesis...\n") @@ -149,17 +152,26 @@ func TestAppImportExport(t *testing.T) { require.NoError(t, os.RemoveAll(newDir)) }() - newApp := NewSimApp(log.NewNopLogger(), newDB, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), EmptyAppOptions{}, fauxMerkleModeOpt) + newApp := NewSimApp(log.NewNopLogger(), newDB, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), EmptyAppOptions{}, interBlockCacheOpt(), baseapp.SetChainID(config.ChainID)) require.Equal(t, "SimApp", newApp.Name()) var genesisState GenesisState err = json.Unmarshal(exported.AppState, &genesisState) require.NoError(t, err) - ctxA := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) - ctxB := newApp.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) - newApp.mm.InitGenesis(ctxB, app.AppCodec(), genesisState) - newApp.StoreConsensusParams(ctxB, exported.ConsensusParams) + ctxA := app.NewContextLegacy(true, cmtproto.Header{Height: app.LastBlockHeight()}) + ctxB := newApp.NewContextLegacy(true, cmtproto.Header{Height: app.LastBlockHeight()}) + _, err = newApp.mm.InitGenesis(ctxB, app.AppCodec(), genesisState) + if err != nil { + if strings.Contains(err.Error(), "validator set is empty after InitGenesis") { + logger.Info("Skipping simulation as all validators have been unbonded") + logger.Info("err", err, "stacktrace", string(debug.Stack())) + return + } + } + require.NoError(t, err) + err = newApp.StoreConsensusParams(ctxB, exported.ConsensusParams) + require.NoError(t, err) fmt.Printf("comparing stores...\n") @@ -179,7 +191,6 @@ func TestAppImportExport(t *testing.T) { {app.keys[paramtypes.StoreKey], newApp.keys[paramtypes.StoreKey], [][]byte{}}, {app.keys[govtypes.StoreKey], newApp.keys[govtypes.StoreKey], [][]byte{}}, {app.keys[evidencetypes.StoreKey], newApp.keys[evidencetypes.StoreKey], [][]byte{}}, - {app.keys[capabilitytypes.StoreKey], newApp.keys[capabilitytypes.StoreKey], [][]byte{}}, {app.keys[authzkeeper.StoreKey], newApp.keys[authzkeeper.StoreKey], [][]byte{}}, } @@ -187,7 +198,7 @@ func TestAppImportExport(t *testing.T) { storeA := ctxA.KVStore(skp.A) storeB := ctxB.KVStore(skp.B) - failedKVAs, failedKVBs := sdk.DiffKVStores(storeA, storeB, skp.Prefixes) + failedKVAs, failedKVBs := simtestutil.DiffKVStores(storeA, storeB, skp.Prefixes) require.Equal(t, len(failedKVAs), len(failedKVBs), "unequal sets of key-values to compare") fmt.Printf("compared %d different key/value pairs between %s and %s\n", len(failedKVAs), skp.A, skp.B) @@ -207,7 +218,7 @@ func TestAppSimulationAfterImport(t *testing.T) { require.NoError(t, os.RemoveAll(dir)) }() - app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), EmptyAppOptions{}, fauxMerkleModeOpt) + app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), EmptyAppOptions{}, interBlockCacheOpt(), baseapp.SetChainID(config.ChainID)) require.Equal(t, "SimApp", app.Name()) // Run randomized simulation @@ -239,7 +250,7 @@ func TestAppSimulationAfterImport(t *testing.T) { fmt.Printf("exporting genesis...\n") - exported, err := app.ExportAppStateAndValidators(true, []string{}) + exported, err := app.ExportAppStateAndValidators(true, []string{}, []string{}) require.NoError(t, err) fmt.Printf("importing genesis...\n") @@ -255,12 +266,13 @@ func TestAppSimulationAfterImport(t *testing.T) { require.NoError(t, os.RemoveAll(newDir)) }() - newApp := NewSimApp(log.NewNopLogger(), newDB, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), EmptyAppOptions{}, fauxMerkleModeOpt) + newApp := NewSimApp(log.NewNopLogger(), newDB, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), EmptyAppOptions{}, fauxMerkleModeOpt, baseapp.SetChainID(config.ChainID)) require.Equal(t, "SimApp", newApp.Name()) - newApp.InitChain(abci.RequestInitChain{ + _, err = newApp.InitChain(&abci.RequestInitChain{ AppStateBytes: exported.AppState, }) + require.NoError(t, err) _, _, err = simulation.SimulateFromSeed( t, @@ -299,14 +311,15 @@ func TestAppStateDeterminism(t *testing.T) { for j := 0; j < numTimesToRunPerSeed; j++ { var logger log.Logger + var ts zerolog.TestingLog if FlagVerboseValue { - logger = log.TestingLogger() + logger = log.NewTestLogger(ts) } else { logger = log.NewNopLogger() } db := dbm.NewMemDB() - app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), EmptyAppOptions{}, interBlockCacheOpt()) + app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), EmptyAppOptions{}, interBlockCacheOpt(), baseapp.SetChainID(config.ChainID)) fmt.Printf( "running non-determinism simulation; seed %d: %d/%d, attempt: %d/%d\n", diff --git a/test/simapp/simd/cmd/genaccounts.go b/test/simapp/simd/cmd/genaccounts.go index 97275a41..145b4967 100644 --- a/test/simapp/simd/cmd/genaccounts.go +++ b/test/simapp/simd/cmd/genaccounts.go @@ -92,7 +92,10 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa baseAccount := authtypes.NewBaseAccount(addr, nil, 0, 0) if !vestingAmt.IsZero() { - baseVestingAccount := authvesting.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd) + baseVestingAccount, err := authvesting.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd) + if err != nil { + return err + } if (balances.Coins.IsZero() && !baseVestingAccount.OriginalVesting.IsZero()) || baseVestingAccount.OriginalVesting.IsAnyGT(balances.Coins) { diff --git a/test/simapp/simd/cmd/root.go b/test/simapp/simd/cmd/root.go index 026c6139..9d878644 100644 --- a/test/simapp/simd/cmd/root.go +++ b/test/simapp/simd/cmd/root.go @@ -6,12 +6,19 @@ import ( "os" "path/filepath" + dbm "github.com/cosmos/cosmos-db" + rosettaCmd "github.com/cosmos/rosetta/cmd" "github.com/realio-tech/multi-staking-module/test/simapp" "github.com/spf13/cast" "github.com/spf13/cobra" + "cosmossdk.io/log" "cosmossdk.io/simapp/params" - rosettaCmd "cosmossdk.io/tools/rosetta/cmd" + "cosmossdk.io/store" + "cosmossdk.io/store/snapshots" + snapshottypes "cosmossdk.io/store/snapshots/types" + storetypes "cosmossdk.io/store/types" + confixcmd "cosmossdk.io/tools/confix/cmd" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" @@ -20,12 +27,10 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/keys" "github.com/cosmos/cosmos-sdk/client/rpc" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/server" serverconfig "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" - "github.com/cosmos/cosmos-sdk/snapshots" - snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" - "github.com/cosmos/cosmos-sdk/store" sdk "github.com/cosmos/cosmos-sdk/types" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -34,10 +39,8 @@ import ( genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - dbm "github.com/cometbft/cometbft-db" tmcfg "github.com/cometbft/cometbft/config" tmcli "github.com/cometbft/cometbft/libs/cli" - "github.com/cometbft/cometbft/libs/log" ) // NewRootCmd creates a new root command for simd. It is called once in the @@ -162,15 +165,15 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { rootCmd.AddCommand( genutilcli.InitCmd(simapp.ModuleBasics, simapp.DefaultNodeHome), - genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, simapp.DefaultNodeHome, genutiltypes.DefaultMessageValidator), - genutilcli.MigrateGenesisCmd(), - genutilcli.GenTxCmd(simapp.ModuleBasics, encodingConfig.TxConfig, banktypes.GenesisBalancesIterator{}, simapp.DefaultNodeHome), + genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, simapp.DefaultNodeHome, genutiltypes.DefaultMessageValidator, addresscodec.NewBech32Codec("cosmos")), + genutilcli.MigrateGenesisCmd(genutilcli.MigrationMap), + genutilcli.GenTxCmd(simapp.ModuleBasics, encodingConfig.TxConfig, banktypes.GenesisBalancesIterator{}, simapp.DefaultNodeHome, addresscodec.NewBech32Codec("cosmos")), genutilcli.ValidateGenesisCmd(simapp.ModuleBasics), AddGenesisAccountCmd(simapp.DefaultNodeHome), tmcli.NewCompletionCmd(rootCmd, true), testnetCmd(simapp.ModuleBasics, banktypes.GenesisBalancesIterator{}), debug.Cmd(), - config.Cmd(), + confixcmd.ConfigCommand(), ) a := appCreator{encodingConfig} @@ -178,10 +181,10 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { // add keybase, auxiliary RPC, query, and tx child commands rootCmd.AddCommand( - rpc.StatusCommand(), + server.StatusCommand(), queryCommand(), txCommand(), - keys.Commands(simapp.DefaultNodeHome), + keys.Commands(), ) // add rosetta @@ -203,11 +206,12 @@ func queryCommand() *cobra.Command { } cmd.AddCommand( - authcmd.GetAccountCmd(), + rpc.WaitTxCmd(), rpc.ValidatorCommand(), - rpc.BlockCommand(), + server.QueryBlockCmd(), authcmd.QueryTxsByEventsCmd(), authcmd.QueryTxCmd(), + server.QueryBlockResultsCmd(), ) simapp.ModuleBasics.AddQueryCommands(cmd) @@ -248,7 +252,7 @@ type appCreator struct { // newApp is an appCreator func (a appCreator) newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts servertypes.AppOptions) servertypes.Application { - var cache sdk.MultiStorePersistentCache + var cache storetypes.MultiStorePersistentCache if cast.ToBool(appOpts.Get(server.FlagInterBlockCache)) { cache = store.NewCommitKVStoreCacheManager() @@ -278,6 +282,7 @@ func (a appCreator) newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, a if err != nil { panic(err) } + snapshotStore, err := snapshots.NewStore(snapshotDB, snapshotDir) if err != nil { panic(err) @@ -334,5 +339,5 @@ func (a appCreator) appExport( simApp = simapp.NewSimApp(logger, db, traceStore, true, map[int64]bool{}, homePath, uint(1), a.encCfg, appOpts) } - return simApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs) + return simApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport) } diff --git a/test/simapp/simd/cmd/testnet.go b/test/simapp/simd/cmd/testnet.go index 586b7393..da04b2c4 100644 --- a/test/simapp/simd/cmd/testnet.go +++ b/test/simapp/simd/cmd/testnet.go @@ -12,12 +12,15 @@ import ( "github.com/spf13/cobra" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/server" srvconfig "github.com/cosmos/cosmos-sdk/server/config" "github.com/cosmos/cosmos-sdk/testutil" @@ -78,7 +81,7 @@ Example: return InitTestnet( clientCtx, cmd, config, mbm, genBalIterator, outputDir, chainID, minGasPrices, - nodeDirPrefix, nodeDaemonHome, startingIPAddress, keyringBackend, algo, numValidators, + nodeDirPrefix, nodeDaemonHome, startingIPAddress, keyringBackend, algo, numValidators, clientCtx.TxConfig.SigningContext().ValidatorAddressCodec(), ) }, } @@ -114,6 +117,7 @@ func InitTestnet( keyringBackend, algoStr string, numValidators int, + valAddrCodec runtime.ValidatorAddressCodec, ) error { if chainID == "" { chainID = "chain-" + tmrand.NewRand().Str(6) @@ -209,12 +213,12 @@ func InitTestnet( valTokens := sdk.TokensFromConsensusPower(100, sdk.DefaultPowerReduction) createValMsg, err := stakingtypes.NewMsgCreateValidator( - sdk.ValAddress(addr), + sdk.ValAddress(addr).String(), valPubKeys[i], sdk.NewCoin(sdk.DefaultBondDenom, valTokens), stakingtypes.NewDescription(nodeDirName, "", "", "", ""), - stakingtypes.NewCommissionRates(sdk.OneDec(), sdk.OneDec(), sdk.OneDec()), - sdk.OneInt(), + stakingtypes.NewCommissionRates(math.LegacyOneDec(), math.LegacyOneDec(), math.LegacyOneDec()), + math.OneInt(), ) if err != nil { return err @@ -234,7 +238,7 @@ func InitTestnet( WithKeybase(kb). WithTxConfig(clientCtx.TxConfig) - if err := tx.Sign(txFactory, nodeDirName, txBuilder, true); err != nil { + if err := tx.Sign(cmd.Context(), txFactory, nodeDirName, txBuilder, true); err != nil { return err } @@ -256,7 +260,7 @@ func InitTestnet( err := collectGenFiles( clientCtx, nodeConfig, chainID, nodeIDs, valPubKeys, numValidators, - outputDir, nodeDirPrefix, nodeDaemonHome, genBalIterator, + outputDir, nodeDirPrefix, nodeDaemonHome, genBalIterator, valAddrCodec, ) if err != nil { return err @@ -315,7 +319,7 @@ func initGenFiles( func collectGenFiles( clientCtx client.Context, nodeConfig *tmconfig.Config, chainID string, nodeIDs []string, valPubKeys []cryptotypes.PubKey, numValidators int, - outputDir, nodeDirPrefix, nodeDaemonHome string, genBalIterator banktypes.GenesisBalancesIterator, + outputDir, nodeDirPrefix, nodeDaemonHome string, genBalIterator banktypes.GenesisBalancesIterator, valAddrCodec runtime.ValidatorAddressCodec, ) error { var appState json.RawMessage genTime := tmtime.Now() @@ -331,13 +335,14 @@ func collectGenFiles( nodeID, valPubKey := nodeIDs[i], valPubKeys[i] initCfg := genutiltypes.NewInitConfig(chainID, gentxsDir, nodeID, valPubKey) - genDoc, err := types.GenesisDocFromFile(nodeConfig.GenesisFile()) + appGenesis, err := genutiltypes.AppGenesisFromFile(nodeConfig.GenesisFile()) if err != nil { return err } // TODO: is default value enough here - nodeAppState, err := genutil.GenAppStateFromConfig(clientCtx.Codec, clientCtx.TxConfig, nodeConfig, initCfg, *genDoc, genBalIterator, genutiltypes.DefaultMessageValidator) + nodeAppState, err := genutil.GenAppStateFromConfig(clientCtx.Codec, clientCtx.TxConfig, nodeConfig, initCfg, appGenesis, genBalIterator, genutiltypes.DefaultMessageValidator, + valAddrCodec) if err != nil { return err } diff --git a/test/simapp/simd/main.go b/test/simapp/simd/main.go index f31516eb..7decb972 100644 --- a/test/simapp/simd/main.go +++ b/test/simapp/simd/main.go @@ -1,12 +1,12 @@ package main import ( + "fmt" "os" "github.com/realio-tech/multi-staking-module/test/simapp" "github.com/realio-tech/multi-staking-module/test/simapp/simd/cmd" - "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" ) @@ -14,12 +14,7 @@ func main() { rootCmd, _ := cmd.NewRootCmd() if err := svrcmd.Execute(rootCmd, "simd", simapp.DefaultNodeHome); err != nil { - switch e := err.(type) { - case server.ErrorCode: - os.Exit(e.Code) - - default: - os.Exit(1) - } + fmt.Fprintln(rootCmd.OutOrStderr(), err) //nolint + os.Exit(1) } } diff --git a/test/simapp/state.go b/test/simapp/state.go index 726b99d7..e9be11df 100644 --- a/test/simapp/state.go +++ b/test/simapp/state.go @@ -8,6 +8,8 @@ import ( "os" "time" + multistakingtypes "github.com/realio-tech/multi-staking-module/x/multi-staking/types" + "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/codec" @@ -78,18 +80,21 @@ func AppStateFn(cdc codec.JSONCodec, simManager *module.SimulationManager) simty panic(err) } - stakingStateBz, ok := rawState[stakingtypes.ModuleName] + multiStakingStateBz, ok := rawState[multistakingtypes.ModuleName] if !ok { panic("staking genesis state is missing") } - stakingState := new(stakingtypes.GenesisState) - err = cdc.UnmarshalJSON(stakingStateBz, stakingState) + multiStakingState := new(multistakingtypes.GenesisState) + err = cdc.UnmarshalJSON(multiStakingStateBz, multiStakingState) if err != nil { panic(err) } + + stakingState := multiStakingState.StakingGenesisState + // compute not bonded balance - notBondedTokens := sdk.ZeroInt() + notBondedTokens := math.ZeroInt() for _, val := range stakingState.Validators { if val.Status != stakingtypes.Unbonded { continue @@ -115,7 +120,7 @@ func AppStateFn(cdc codec.JSONCodec, simManager *module.SimulationManager) simty }) // change appState back - rawState[stakingtypes.ModuleName] = cdc.MustMarshalJSON(stakingState) + rawState[multistakingtypes.ModuleName] = cdc.MustMarshalJSON(multiStakingState) rawState[banktypes.ModuleName] = cdc.MustMarshalJSON(bankState) // replace appstate @@ -140,11 +145,11 @@ func AppStateRandomizedFn( // number of bonded accounts var initialStake, numInitiallyBonded int64 appParams.GetOrGenerate( - cdc, sims.StakePerAccount, &initialStake, r, + sims.StakePerAccount, &initialStake, r, func(r *rand.Rand) { initialStake = r.Int63n(1e12) }, ) appParams.GetOrGenerate( - cdc, sims.InitiallyBondedValidators, &numInitiallyBonded, r, + sims.InitiallyBondedValidators, &numInitiallyBonded, r, func(r *rand.Rand) { numInitiallyBonded = int64(r.Intn(300)) }, ) @@ -170,6 +175,7 @@ func AppStateRandomizedFn( InitialStake: math.NewInt(initialStake), NumBonded: numInitiallyBonded, GenTimestamp: genesisTimestamp, + BondDenom: sdk.DefaultBondDenom, } simManager.GenerateGenesisStates(simState) @@ -220,7 +226,7 @@ func AppStateFromGenesisFileFn(r io.Reader, cdc codec.JSONCodec, genesisFile str privKey := secp256k1.GenPrivKeyFromSecret(privkeySeed) - a, ok := acc.GetCachedValue().(authtypes.AccountI) + a, ok := acc.GetCachedValue().(sdk.AccountI) if !ok { panic("expected account") } diff --git a/test/simapp/test_helpers.go b/test/simapp/test_helpers.go index b9de0963..01088854 100644 --- a/test/simapp/test_helpers.go +++ b/test/simapp/test_helpers.go @@ -4,8 +4,12 @@ import ( "encoding/json" "time" + dbm "github.com/cosmos/cosmos-db" multistakingtypes "github.com/realio-tech/multi-staking-module/x/multi-staking/types" + "cosmossdk.io/log" + "cosmossdk.io/math" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" @@ -15,9 +19,7 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - dbm "github.com/cometbft/cometbft-db" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" tmtypes "github.com/cometbft/cometbft/types" ) @@ -43,18 +45,18 @@ var ( } MultiStakingCoinA = multistakingtypes.MultiStakingCoin{ Denom: "ario", - Amount: sdk.NewIntFromUint64(100000000), - BondWeight: sdk.MustNewDecFromStr("1.23"), + Amount: math.NewIntFromUint64(100000000), + BondWeight: math.LegacyMustNewDecFromStr("1.23"), } MultiStakingCoinB = multistakingtypes.MultiStakingCoin{ Denom: "arst", - Amount: sdk.NewIntFromUint64(100000000), - BondWeight: sdk.MustNewDecFromStr("0.12"), + Amount: math.NewIntFromUint64(100000000), + BondWeight: math.LegacyMustNewDecFromStr("0.12"), } ) // Setup initializes a new SimApp. A Nop logger is set in SimApp. -func Setup(isCheckTx bool) *SimApp { +func Setup() *SimApp { valSet := GenValSet() app := SetupWithGenesisValSet(valSet) @@ -72,22 +74,21 @@ func SetupWithGenesisValSet(valSet *tmtypes.ValidatorSet) *SimApp { stateBytes, _ := json.MarshalIndent(genesisState, "", " ") // init chain will set the validator set and initialize the genesis accounts - app.InitChain( - abci.RequestInitChain{ + _, err := app.InitChain( + &abci.RequestInitChain{ Validators: []abci.ValidatorUpdate{}, ConsensusParams: DefaultConsensusParams, AppStateBytes: stateBytes, }, ) + if err != nil { + panic(err) + } - // commit genesis changes - app.Commit() - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{ - Height: app.LastBlockHeight() + 1, - AppHash: app.LastCommitID().Hash, - ValidatorsHash: valSet.Hash(), - NextValidatorsHash: valSet.Hash(), - }}) + _, err = app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: app.LastBlockHeight() + 1}) + if err != nil { + panic(err) + } return app } @@ -147,7 +148,7 @@ func genesisStateWithValSet(app *SimApp, genesisState GenesisState, valSet *tmty locks = append(locks, lockRecord) lockCoins = lockCoins.Add(valMsCoin.ToCoin()) - pk, _ := cryptocodec.FromTmPubKeyInterface(val.PubKey) + pk, _ := cryptocodec.FromCmtPubKeyInterface(val.PubKey) pkAny, _ := codectypes.NewAnyWithValue(pk) validator := stakingtypes.Validator{ OperatorAddress: sdk.ValAddress(val.Address).String(), @@ -155,15 +156,15 @@ func genesisStateWithValSet(app *SimApp, genesisState GenesisState, valSet *tmty Jailed: false, Status: stakingtypes.Bonded, Tokens: valMsCoin.BondValue(), - DelegatorShares: sdk.OneDec(), + DelegatorShares: math.LegacyOneDec(), Description: stakingtypes.Description{}, UnbondingHeight: int64(0), UnbondingTime: time.Unix(0, 0).UTC(), - Commission: stakingtypes.NewCommission(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()), - MinSelfDelegation: sdk.ZeroInt(), + Commission: stakingtypes.NewCommission(math.LegacyZeroDec(), math.LegacyZeroDec(), math.LegacyZeroDec()), + MinSelfDelegation: math.ZeroInt(), } validators = append(validators, validator) - delegations = append(delegations, stakingtypes.NewDelegation(genAcc.GetAddress(), val.Address.Bytes(), sdk.OneDec())) + delegations = append(delegations, stakingtypes.NewDelegation(genAcc.GetAddress().String(), sdk.ValAddress(val.Address).String(), math.LegacyOneDec())) bondCoins = bondCoins.Add(sdk.NewCoin(sdk.DefaultBondDenom, valMsCoin.BondValue())) } diff --git a/test/simapp/types.go b/test/simapp/types.go index 09c381c4..c3bcf17a 100644 --- a/test/simapp/types.go +++ b/test/simapp/types.go @@ -20,20 +20,20 @@ type App interface { LegacyAmino() *codec.LegacyAmino // Application updates every begin block. - BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock + BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error) // Application updates every end block. - EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock + EndBlocker(ctx sdk.Context) (sdk.EndBlock, error) // Application update at chain (i.e app) initialization. - InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain + InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) // Loads the app at a given height. LoadHeight(height int64) error // Exports the state of the application for a genesis file. ExportAppStateAndValidators( - forZeroHeight bool, jailAllowedAddrs []string, + forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string, ) (types.ExportedApp, error) // All the registered module account addreses. diff --git a/test/simapp/utils.go b/test/simapp/utils.go index 27d0c218..f7e88385 100644 --- a/test/simapp/utils.go +++ b/test/simapp/utils.go @@ -5,30 +5,30 @@ import ( "fmt" "os" + dbm "github.com/cosmos/cosmos-db" + "github.com/rs/zerolog" + + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" "github.com/cosmos/cosmos-sdk/types/module" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - - dbm "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" ) // SetupSimulation creates the config, db (levelDB), temporary directory and logger for // the simulation tests. If `FlagEnabledValue` is false it skips the current test. // Returns error on an invalid db intantiation or temp dir creation. func SetupSimulation(dirPrefix, dbName string) (simtypes.Config, dbm.DB, string, log.Logger, bool, error) { - if !FlagEnabledValue { - return simtypes.Config{}, nil, "", nil, true, nil - } - config := NewConfigFromFlags() config.ChainID = "test-chain" + config.Commit = true var logger log.Logger + var t zerolog.TestingLog if FlagVerboseValue { - logger = log.TestingLogger() + logger = log.NewTestLogger(t) } else { logger = log.NewNopLogger() } @@ -51,6 +51,7 @@ func SetupSimulation(dirPrefix, dbName string) (simtypes.Config, dbm.DB, string, func SimulationOperations(app App, cdc codec.JSONCodec, config simtypes.Config) []simtypes.WeightedOperation { simState := module.SimulationState{ AppParams: make(simtypes.AppParams), + TxConfig: moduletestutil.MakeTestTxConfig(), Cdc: cdc, } @@ -78,7 +79,7 @@ func CheckExportSimulation( ) error { if config.ExportStatePath != "" { fmt.Println("exporting app state...") - exported, err := app.ExportAppStateAndValidators(false, nil) + exported, err := app.ExportAppStateAndValidators(false, nil, nil) if err != nil { return err } @@ -111,7 +112,7 @@ func PrintStats(db dbm.DB) { // GetSimulationLog unmarshals the KVPair's Value to the corresponding type based on the // each's module store key and the prefix bytes of the KVPair's key. -func GetSimulationLog(storeName string, sdr sdk.StoreDecoderRegistry, kvAs, kvBs []kv.Pair) (log string) { +func GetSimulationLog(storeName string, sdr simtypes.StoreDecoderRegistry, kvAs, kvBs []kv.Pair) (log string) { for i := 0; i < len(kvAs); i++ { if len(kvAs[i].Value) == 0 && len(kvBs[i].Value) == 0 { // skip if the value doesn't have any bytes diff --git a/test/simapp/utils_test.go b/test/simapp/utils_test.go index 0240c482..29fad26f 100644 --- a/test/simapp/utils_test.go +++ b/test/simapp/utils_test.go @@ -8,9 +8,9 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/std" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -26,7 +26,7 @@ func makeCodec(bm module.BasicManager) *codec.LegacyAmino { func TestGetSimulationLog(t *testing.T) { cdc := makeCodec(ModuleBasics) - decoders := make(sdk.StoreDecoderRegistry) + decoders := make(simtypes.StoreDecoderRegistry) decoders[authtypes.StoreKey] = func(kvAs, kvBs kv.Pair) string { return "10" } tests := []struct { diff --git a/x/multi-staking/client/cli/proposal.go b/x/multi-staking/client/cli/proposal.go index 80e4f2aa..532d84cd 100644 --- a/x/multi-staking/client/cli/proposal.go +++ b/x/multi-staking/client/cli/proposal.go @@ -4,6 +4,8 @@ import ( "github.com/realio-tech/multi-staking-module/x/multi-staking/types" "github.com/spf13/cobra" + sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" @@ -21,7 +23,7 @@ func NewCmdSubmitAddMultiStakingCoinProposal() *cobra.Command { return err } - bondWeight, err := sdk.NewDecFromStr(args[3]) + bondWeight, err := sdkmath.LegacyNewDecFromStr(args[3]) if err != nil { return err } @@ -58,7 +60,7 @@ func NewCmdUpdateBondWeightProposal() *cobra.Command { return err } - bondWeight, err := sdk.NewDecFromStr(args[3]) + bondWeight, err := sdkmath.LegacyNewDecFromStr(args[3]) if err != nil { return err } diff --git a/x/multi-staking/client/cli/tx.go b/x/multi-staking/client/cli/tx.go index 19bf59c4..519978ae 100644 --- a/x/multi-staking/client/cli/tx.go +++ b/x/multi-staking/client/cli/tx.go @@ -4,12 +4,14 @@ import ( "github.com/realio-tech/multi-staking-module/x/multi-staking/types" "github.com/spf13/cobra" + "cosmossdk.io/core/address" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/x/staking/client/cli" ) // NewTxCmd returns a root CLI command handler for all x/exp transaction commands. -func NewTxCmd() *cobra.Command { +func NewTxCmd(valAddrCodec, ac address.Codec) *cobra.Command { txCmd := &cobra.Command{ Use: types.ModuleName, Short: "multi-staking transaction subcommands", @@ -19,12 +21,12 @@ func NewTxCmd() *cobra.Command { } txCmd.AddCommand( - cli.NewCreateValidatorCmd(), - cli.NewEditValidatorCmd(), - cli.NewDelegateCmd(), - cli.NewRedelegateCmd(), - cli.NewUnbondCmd(), - cli.NewCancelUnbondingDelegation(), + cli.NewCreateValidatorCmd(valAddrCodec), + cli.NewEditValidatorCmd(valAddrCodec), + cli.NewDelegateCmd(valAddrCodec, ac), + cli.NewRedelegateCmd(valAddrCodec, ac), + cli.NewUnbondCmd(valAddrCodec, ac), + cli.NewCancelUnbondingDelegation(valAddrCodec, ac), ) return txCmd diff --git a/x/multi-staking/keeper/abci.go b/x/multi-staking/keeper/abci.go index 15879d19..31aed1b5 100644 --- a/x/multi-staking/keeper/abci.go +++ b/x/multi-staking/keeper/abci.go @@ -1,6 +1,7 @@ package keeper import ( + "context" "fmt" "github.com/realio-tech/multi-staking-module/x/multi-staking/types" @@ -15,8 +16,9 @@ func (k Keeper) BeginBlocker(ctx sdk.Context) { } // need a way to better name this func -func GetUnbondingHeightsAndUnbondedAmounts(ctx sdk.Context, unbondingDelegation stakingtypes.UnbondingDelegation) map[int64]math.Int { - ctxTime := ctx.BlockHeader().Time +func GetUnbondingHeightsAndUnbondedAmounts(ctx context.Context, unbondingDelegation stakingtypes.UnbondingDelegation) map[int64]math.Int { + sdkCtx := sdk.UnwrapSDKContext(ctx) + ctxTime := sdkCtx.BlockHeader().Time unbondingHeightsAndUnbondedAmounts := map[int64]math.Int{} // loop through all the entries and complete unbonding mature entries @@ -35,7 +37,7 @@ func GetUnbondingHeightsAndUnbondedAmounts(ctx sdk.Context, unbondingDelegation return unbondingHeightsAndUnbondedAmounts } -func (k Keeper) EndBlocker(ctx sdk.Context, matureUnbondingDelegations []stakingtypes.UnbondingDelegation) { +func (k Keeper) EndBlocker(ctx context.Context, matureUnbondingDelegations []stakingtypes.UnbondingDelegation) { for _, unbond := range matureUnbondingDelegations { multiStakerAddr, valAcc, err := types.AccAddrAndValAddrFromStrings(unbond.DelegatorAddress, unbond.ValidatorAddress) if err != nil { @@ -53,15 +55,16 @@ func (k Keeper) EndBlocker(ctx sdk.Context, matureUnbondingDelegations []staking } func (k Keeper) BurnUnbondedCoinAndUnlockedMultiStakingCoin( - ctx sdk.Context, + ctx context.Context, multiStakerAddr sdk.AccAddress, valAddr sdk.ValAddress, unbondingHeight int64, unbondAmount math.Int, ) (unlockedCoin sdk.Coin, err error) { // get unlock record + sdkCtx := sdk.UnwrapSDKContext(ctx) unlockID := types.MultiStakingUnlockID(multiStakerAddr.String(), valAddr.String()) - unlockEntry, found := k.GetUnlockEntryAtCreationHeight(ctx, unlockID, unbondingHeight) + unlockEntry, found := k.GetUnlockEntryAtCreationHeight(sdkCtx, unlockID, unbondingHeight) if !found { return sdk.Coin{}, fmt.Errorf("unlock entry not found") } @@ -75,25 +78,29 @@ func (k Keeper) BurnUnbondedCoinAndUnlockedMultiStakingCoin( return sdk.Coin{}, fmt.Errorf("unlock amount greater than lock amount") } + bondDenom, err := k.stakingKeeper.BondDenom(sdkCtx) + if err != nil { + panic(err) + } // burn bonded coin - burnCoin := sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), unbondAmount) - err = k.BurnCoin(ctx, multiStakerAddr, burnCoin) + burnCoin := sdk.NewCoin(bondDenom, unbondAmount) + err = k.BurnCoin(sdkCtx, multiStakerAddr, burnCoin) if err != nil { return sdk.Coin{}, err } // burn remaining coin in unlock remaningCoin := unlockEntry.UnlockingCoin.ToCoin().Sub(unlockedCoin) - err = k.bankKeeper.BurnCoins(ctx, types.ModuleName, sdk.NewCoins(remaningCoin)) + err = k.bankKeeper.BurnCoins(sdkCtx, types.ModuleName, sdk.NewCoins(remaningCoin)) if err != nil { return sdk.Coin{}, err } - err = k.UnescrowCoinTo(ctx, multiStakerAddr, unlockedCoin) + err = k.UnescrowCoinTo(sdkCtx, multiStakerAddr, unlockedCoin) if err != nil { return sdk.Coin{}, err } - err = k.DeleteUnlockEntryAtCreationHeight(ctx, unlockID, unbondingHeight) + err = k.DeleteUnlockEntryAtCreationHeight(sdkCtx, unlockID, unbondingHeight) if err != nil { return sdk.Coin{}, err } diff --git a/x/multi-staking/keeper/abci_test.go b/x/multi-staking/keeper/abci_test.go index 0f9ea989..c2f324ec 100644 --- a/x/multi-staking/keeper/abci_test.go +++ b/x/multi-staking/keeper/abci_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "cosmossdk.io/math" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -21,23 +21,23 @@ func (suite *KeeperTestSuite) TestMsUnlockEndBlocker() { testCases := []struct { name string - lockAmount math.Int - slashFactor sdk.Dec + lockAmount sdkmath.Int + slashFactor sdkmath.LegacyDec }{ { name: "no slashing", - lockAmount: math.NewInt(3788), - slashFactor: sdk.ZeroDec(), + lockAmount: sdkmath.NewInt(3788), + slashFactor: sdkmath.LegacyZeroDec(), }, { name: "slash half of lock coin", - lockAmount: math.NewInt(123), - slashFactor: sdk.MustNewDecFromStr("0.5"), + lockAmount: sdkmath.NewInt(123), + slashFactor: sdkmath.LegacyMustNewDecFromStr("0.5"), }, { name: "slash all of lock coin", - lockAmount: math.NewInt(19090), - slashFactor: sdk.ZeroDec(), + lockAmount: sdkmath.NewInt(19090), + slashFactor: sdkmath.LegacyZeroDec(), }, } @@ -47,10 +47,13 @@ func (suite *KeeperTestSuite) TestMsUnlockEndBlocker() { // height 1 suite.SetupTest() - vals := suite.app.StakingKeeper.GetAllValidators(suite.ctx) + vals, err := suite.app.StakingKeeper.GetAllValidators(suite.ctx) + suite.NoError(err) val := vals[0] - msDenom := suite.msKeeper.GetValidatorMultiStakingCoin(suite.ctx, val.GetOperator()) + valAddr, err := sdk.ValAddressFromBech32(val.GetOperator()) + suite.NoError(err) + msDenom := suite.msKeeper.GetValidatorMultiStakingCoin(suite.ctx, valAddr) msCoin := sdk.NewCoin(msDenom, tc.lockAmount) @@ -61,15 +64,17 @@ func (suite *KeeperTestSuite) TestMsUnlockEndBlocker() { ValidatorAddress: val.OperatorAddress, Amount: msCoin, } - _, err := suite.msgServer.Delegate(suite.ctx, delegateMsg) + _, err = suite.msgServer.Delegate(suite.ctx, delegateMsg) suite.NoError(err) // height 2 suite.NextBlock(time.Second) if !tc.slashFactor.IsZero() { - val, found := suite.app.StakingKeeper.GetValidator(suite.ctx, val.GetOperator()) - require.True(suite.T(), found) + valAddr, _ := sdk.ValAddressFromBech32(val.GetOperator()) + val, err := suite.app.StakingKeeper.GetValidator(suite.ctx, valAddr) + suite.NoError(err) + require.NotNil(suite.T(), val) slashedPow := suite.app.StakingKeeper.TokensToConsensusPower(suite.ctx, val.Tokens) @@ -79,7 +84,8 @@ func (suite *KeeperTestSuite) TestMsUnlockEndBlocker() { // height 3 suite.NextBlock(time.Second) - suite.app.SlashingKeeper.Slash(suite.ctx, valConsAddr, tc.slashFactor, slashedPow, 2) + err = suite.app.SlashingKeeper.Slash(suite.ctx, valConsAddr, tc.slashFactor, slashedPow, 2) + require.NoError(suite.T(), err) } else { // height 3 suite.NextBlock(time.Second) @@ -100,7 +106,7 @@ func (suite *KeeperTestSuite) TestMsUnlockEndBlocker() { unlockAmount := suite.app.BankKeeper.GetBalance(suite.ctx, msStaker, msDenom).Amount - expectedUnlockAmount := sdk.NewDecFromInt(tc.lockAmount).Mul(sdk.OneDec().Sub(tc.slashFactor)).TruncateInt() + expectedUnlockAmount := sdkmath.LegacyNewDecFromInt(tc.lockAmount).Mul(sdkmath.LegacyOneDec().Sub(tc.slashFactor)).TruncateInt() suite.True(SoftEqualInt(unlockAmount, expectedUnlockAmount) || DiffLTEThanOne(unlockAmount, expectedUnlockAmount)) }) diff --git a/x/multi-staking/keeper/genesis.go b/x/multi-staking/keeper/genesis.go index 6438c56b..26ad2876 100644 --- a/x/multi-staking/keeper/genesis.go +++ b/x/multi-staking/keeper/genesis.go @@ -3,6 +3,8 @@ package keeper import ( "github.com/realio-tech/multi-staking-module/x/multi-staking/types" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" abci "github.com/cometbft/cometbft/abci/types" @@ -48,7 +50,7 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { }) var multiStakingCoinInfos []types.MultiStakingCoinInfo - k.BondWeightIterator(ctx, func(denom string, bondWeight sdk.Dec) bool { + k.BondWeightIterator(ctx, func(denom string, bondWeight math.LegacyDec) bool { multiStakingCoinInfos = append(multiStakingCoinInfos, types.MultiStakingCoinInfo{ Denom: denom, BondWeight: bondWeight, diff --git a/x/multi-staking/keeper/genesis_test.go b/x/multi-staking/keeper/genesis_test.go index efd0c8c7..dd00e49c 100644 --- a/x/multi-staking/keeper/genesis_test.go +++ b/x/multi-staking/keeper/genesis_test.go @@ -1,15 +1,16 @@ package keeper_test import ( + dbm "github.com/cosmos/cosmos-db" "github.com/realio-tech/multi-staking-module/test/simapp" - dbm "github.com/cometbft/cometbft-db" + "cosmossdk.io/log" + abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" ) func (suite *KeeperTestSuite) TestImportExportGenesis() { - appState, err := suite.app.ExportAppStateAndValidators(false, []string{}) + appState, err := suite.app.ExportAppStateAndValidators(false, []string{}, []string{}) suite.NoError(err) encConfig := simapp.MakeTestEncodingConfig() @@ -26,18 +27,27 @@ func (suite *KeeperTestSuite) TestImportExportGenesis() { simapp.EmptyAppOptions{}, ) - _ = emptyApp.InitChain( - abci.RequestInitChain{ + _, err = emptyApp.InitChain( + &abci.RequestInitChain{ Validators: []abci.ValidatorUpdate{}, - ConsensusParams: simapp.DefaultConsensusParams, + ConsensusParams: &appState.ConsensusParams, AppStateBytes: appState.AppState, }, ) + suite.NoError(err) - emptyApp.Commit() + _, err = emptyApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: emptyApp.LastBlockHeight() + 1}) + suite.NoError(err) - newAppState, err := emptyApp.ExportAppStateAndValidators(false, []string{}) + newAppState, err := emptyApp.ExportAppStateAndValidators(false, []string{}, []string{}) + suite.NoError(err) + + _, err = suite.app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: suite.app.LastBlockHeight() + 1}) + suite.NoError(err) + _, err = suite.app.Commit() + suite.NoError(err) + appState2, err := suite.app.ExportAppStateAndValidators(false, []string{}, []string{}) suite.NoError(err) - suite.Equal(appState.AppState, newAppState.AppState) + suite.Equal(appState2.AppState, newAppState.AppState) } diff --git a/x/multi-staking/keeper/grpc_query.go b/x/multi-staking/keeper/grpc_query.go index c48233c8..82b8195c 100644 --- a/x/multi-staking/keeper/grpc_query.go +++ b/x/multi-staking/keeper/grpc_query.go @@ -7,7 +7,9 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/math" + "cosmossdk.io/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" @@ -33,19 +35,19 @@ func NewQueryServerImpl(keeper Keeper) types.QueryServer { var _ types.QueryServer = queryServer{} // BondWeights implements types.QueryServer. -func (k queryServer) MultiStakingCoinInfos(c context.Context, req *types.QueryMultiStakingCoinInfosRequest) (*types.QueryMultiStakingCoinInfosResponse, error) { +func (k queryServer) MultiStakingCoinInfos(ctx context.Context, req *types.QueryMultiStakingCoinInfosRequest) (*types.QueryMultiStakingCoinInfosResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } - ctx := sdk.UnwrapSDKContext(c) + sdkCtx := sdk.UnwrapSDKContext(ctx) var infos []*types.MultiStakingCoinInfo - store := ctx.KVStore(k.storeKey) + store := sdkCtx.KVStore(k.storeKey) coinInfoStore := prefix.NewStore(store, types.BondWeightKey) pageRes, err := query.Paginate(coinInfoStore, req.Pagination, func(key []byte, value []byte) error { - bondCoinWeight := &sdk.Dec{} + bondCoinWeight := &math.LegacyDec{} err := bondCoinWeight.Unmarshal(value) if err != nil { return err @@ -66,14 +68,14 @@ func (k queryServer) MultiStakingCoinInfos(c context.Context, req *types.QueryMu } // BondWeight implements types.QueryServer. -func (k queryServer) BondWeight(c context.Context, req *types.QueryBondWeightRequest) (*types.QueryBondWeightResponse, error) { +func (k queryServer) BondWeight(ctx context.Context, req *types.QueryBondWeightRequest) (*types.QueryBondWeightResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } - ctx := sdk.UnwrapSDKContext(c) + sdkCtx := sdk.UnwrapSDKContext(ctx) - weight, found := k.Keeper.GetBondWeight(ctx, req.Denom) + weight, found := k.Keeper.GetBondWeight(sdkCtx, req.Denom) return &types.QueryBondWeightResponse{ Weight: weight, @@ -82,15 +84,15 @@ func (k queryServer) BondWeight(c context.Context, req *types.QueryBondWeightReq } // MultiStakingLock implements types.QueryServer. -func (k queryServer) MultiStakingLock(c context.Context, req *types.QueryMultiStakingLockRequest) (*types.QueryMultiStakingLockResponse, error) { +func (k queryServer) MultiStakingLock(ctx context.Context, req *types.QueryMultiStakingLockRequest) (*types.QueryMultiStakingLockResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } - ctx := sdk.UnwrapSDKContext(c) + sdkCtx := sdk.UnwrapSDKContext(ctx) lockId := types.MultiStakingLockID(req.MultiStakerAddress, req.ValidatorAddress) - lock, found := k.Keeper.GetMultiStakingLock(ctx, lockId) + lock, found := k.Keeper.GetMultiStakingLock(sdkCtx, lockId) return &types.QueryMultiStakingLockResponse{ Lock: &lock, @@ -99,15 +101,15 @@ func (k queryServer) MultiStakingLock(c context.Context, req *types.QueryMultiSt } // MultiStakingLocks implements types.QueryServer. -func (k queryServer) MultiStakingLocks(c context.Context, req *types.QueryMultiStakingLocksRequest) (*types.QueryMultiStakingLocksResponse, error) { +func (k queryServer) MultiStakingLocks(ctx context.Context, req *types.QueryMultiStakingLocksRequest) (*types.QueryMultiStakingLocksResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } - ctx := sdk.UnwrapSDKContext(c) + sdkCtx := sdk.UnwrapSDKContext(ctx) var locks []*types.MultiStakingLock - store := ctx.KVStore(k.storeKey) + store := sdkCtx.KVStore(k.storeKey) lockStore := prefix.NewStore(store, types.MultiStakingLockPrefix) pageRes, err := query.Paginate(lockStore, req.Pagination, func(key []byte, value []byte) error { @@ -127,15 +129,15 @@ func (k queryServer) MultiStakingLocks(c context.Context, req *types.QueryMultiS } // MultiStakingUnlock implements types.QueryServer. -func (k queryServer) MultiStakingUnlock(c context.Context, req *types.QueryMultiStakingUnlockRequest) (*types.QueryMultiStakingUnlockResponse, error) { +func (k queryServer) MultiStakingUnlock(ctx context.Context, req *types.QueryMultiStakingUnlockRequest) (*types.QueryMultiStakingUnlockResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } - ctx := sdk.UnwrapSDKContext(c) + sdkCtx := sdk.UnwrapSDKContext(ctx) unlockId := types.MultiStakingUnlockID(req.MultiStakerAddress, req.ValidatorAddress) - unlock, found := k.Keeper.GetMultiStakingUnlock(ctx, unlockId) + unlock, found := k.Keeper.GetMultiStakingUnlock(sdkCtx, unlockId) return &types.QueryMultiStakingUnlockResponse{ Unlock: &unlock, @@ -144,15 +146,15 @@ func (k queryServer) MultiStakingUnlock(c context.Context, req *types.QueryMulti } // MultiStakingUnlocks implements types.QueryServer. -func (k queryServer) MultiStakingUnlocks(c context.Context, req *types.QueryMultiStakingUnlocksRequest) (*types.QueryMultiStakingUnlocksResponse, error) { +func (k queryServer) MultiStakingUnlocks(ctx context.Context, req *types.QueryMultiStakingUnlocksRequest) (*types.QueryMultiStakingUnlocksResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } - ctx := sdk.UnwrapSDKContext(c) + sdkCtx := sdk.UnwrapSDKContext(ctx) var unlocks []*types.MultiStakingUnlock - store := ctx.KVStore(k.storeKey) + store := sdkCtx.KVStore(k.storeKey) unlockStore := prefix.NewStore(store, types.MultiStakingUnlockPrefix) pageRes, err := query.Paginate(unlockStore, req.Pagination, func(key []byte, value []byte) error { @@ -172,32 +174,32 @@ func (k queryServer) MultiStakingUnlocks(c context.Context, req *types.QueryMult } // ValidatorMultiStakingCoin implements types.QueryServer. -func (k queryServer) ValidatorMultiStakingCoin(c context.Context, req *types.QueryValidatorMultiStakingCoinRequest) (*types.QueryValidatorMultiStakingCoinResponse, error) { +func (k queryServer) ValidatorMultiStakingCoin(ctx context.Context, req *types.QueryValidatorMultiStakingCoinRequest) (*types.QueryValidatorMultiStakingCoinResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } - ctx := sdk.UnwrapSDKContext(c) + sdkCtx := sdk.UnwrapSDKContext(ctx) valAcc, err := sdk.ValAddressFromBech32(req.ValidatorAddr) if err != nil { return nil, status.Error(codes.InvalidArgument, "invalid validator address") } - denom := k.Keeper.GetValidatorMultiStakingCoin(ctx, valAcc) + denom := k.Keeper.GetValidatorMultiStakingCoin(sdkCtx, valAcc) return &types.QueryValidatorMultiStakingCoinResponse{ Denom: denom, }, nil } -func (k queryServer) Validators(c context.Context, req *types.QueryValidatorsRequest) (*types.QueryValidatorsResponse, error) { - ctx := sdk.UnwrapSDKContext(c) +func (k queryServer) Validators(ctx context.Context, req *types.QueryValidatorsRequest) (*types.QueryValidatorsResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) sdkReq := stakingtypes.QueryValidatorsRequest{ Status: req.Status, Pagination: req.Pagination, } - resp, err := k.stakingQuerier.Validators(c, &sdkReq) + resp, err := k.stakingQuerier.Validators(ctx, &sdkReq) if err != nil { return nil, err } @@ -209,7 +211,7 @@ func (k queryServer) Validators(c context.Context, req *types.QueryValidatorsReq return nil, status.Error(codes.InvalidArgument, "invalid validator address") } - denom := k.Keeper.GetValidatorMultiStakingCoin(ctx, valAcc) + denom := k.Keeper.GetValidatorMultiStakingCoin(sdkCtx, valAcc) valInfo := types.ValidatorInfo{ OperatorAddress: val.OperatorAddress, ConsensusPubkey: val.ConsensusPubkey, @@ -230,7 +232,7 @@ func (k queryServer) Validators(c context.Context, req *types.QueryValidatorsReq return &types.QueryValidatorsResponse{Validators: vals, Pagination: resp.Pagination}, nil } -func (k queryServer) Validator(c context.Context, req *types.QueryValidatorRequest) (*types.QueryValidatorResponse, error) { +func (k queryServer) Validator(ctx context.Context, req *types.QueryValidatorRequest) (*types.QueryValidatorResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -244,13 +246,13 @@ func (k queryServer) Validator(c context.Context, req *types.QueryValidatorReque return nil, err } - ctx := sdk.UnwrapSDKContext(c) - validator, found := k.stakingKeeper.GetValidator(ctx, valAddr) - if !found { - return nil, status.Errorf(codes.NotFound, "validator %s not found", req.ValidatorAddr) + sdkCtx := sdk.UnwrapSDKContext(ctx) + validator, err := k.stakingKeeper.GetValidator(sdkCtx, valAddr) + if err != nil { + return nil, status.Errorf(codes.NotFound, "failed to get validator with address %s: %s", req.ValidatorAddr, err.Error()) } - denom := k.Keeper.GetValidatorMultiStakingCoin(ctx, valAddr) + denom := k.Keeper.GetValidatorMultiStakingCoin(sdkCtx, valAddr) valInfo := types.ValidatorInfo{ OperatorAddress: validator.OperatorAddress, ConsensusPubkey: validator.ConsensusPubkey, diff --git a/x/multi-staking/keeper/invariants.go b/x/multi-staking/keeper/invariants.go index 9ea919eb..2212f12a 100644 --- a/x/multi-staking/keeper/invariants.go +++ b/x/multi-staking/keeper/invariants.go @@ -42,7 +42,7 @@ func ModuleAccountInvariants(k Keeper) sdk.Invariant { moduleAccount := authtypes.NewModuleAddress(types.ModuleName) escrowBalances := k.bankKeeper.GetAllBalances(ctx, moduleAccount) - broken := !escrowBalances.IsEqual(totalLockCoinAmount) + broken := !escrowBalances.Equal(totalLockCoinAmount) return sdk.FormatInvariant( types.ModuleName, diff --git a/x/multi-staking/keeper/invartiants_test.go b/x/multi-staking/keeper/invartiants_test.go index b9abfaad..ee85e134 100644 --- a/x/multi-staking/keeper/invartiants_test.go +++ b/x/multi-staking/keeper/invartiants_test.go @@ -7,6 +7,8 @@ import ( "github.com/realio-tech/multi-staking-module/x/multi-staking/keeper" "github.com/realio-tech/multi-staking-module/x/multi-staking/types" + "cosmossdk.io/math" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -19,6 +21,8 @@ func (suite *KeeperTestSuite) TestModuleAccountInvariants() { priv, valAddr := test.GenValAddressWithPrivKey() valPubKey := priv.PubKey() + bondAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(3001)) + testCases := []struct { name string malleate func() @@ -33,9 +37,9 @@ func (suite *KeeperTestSuite) TestModuleAccountInvariants() { name: "Success Edit Validator", malleate: func() { suite.ctx = suite.ctx.WithBlockHeader(tmproto.Header{Time: time.Now()}) - newRate := sdk.MustNewDecFromStr("0.03") - newMinSelfDelegation := sdk.NewInt(300) - editMsg := stakingtypes.NewMsgEditValidator(valAddr, stakingtypes.Description{ + newRate := math.LegacyMustNewDecFromStr("0.03") + newMinSelfDelegation := math.NewInt(300) + editMsg := stakingtypes.NewMsgEditValidator(valAddr.String(), stakingtypes.Description{ Moniker: "test 1", Identity: "test 1", Website: "test 1", @@ -53,8 +57,8 @@ func (suite *KeeperTestSuite) TestModuleAccountInvariants() { { name: "Success Delegate", malleate: func() { - bondAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(1000)) - delMsg := stakingtypes.NewMsgDelegate(delAddr, valAddr, bondAmount) + bondAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(1000)) + delMsg := stakingtypes.NewMsgDelegate(delAddr.String(), valAddr.String(), bondAmount) _, err := suite.msgServer.Delegate(suite.ctx, delMsg) suite.Require().NoError(err) }, @@ -63,8 +67,8 @@ func (suite *KeeperTestSuite) TestModuleAccountInvariants() { { name: "Success Delegate", malleate: func() { - bondAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(1000)) - delMsg := stakingtypes.NewMsgDelegate(delAddr, valAddr, bondAmount) + bondAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(1000)) + delMsg := stakingtypes.NewMsgDelegate(delAddr.String(), valAddr.String(), bondAmount) _, err := suite.msgServer.Delegate(suite.ctx, delMsg) suite.Require().NoError(err) }, @@ -75,7 +79,11 @@ func (suite *KeeperTestSuite) TestModuleAccountInvariants() { malleate: func() { priv, valAddr2 := test.GenValAddressWithPrivKey() valPubKey2 := priv.PubKey() - bondAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(500)) + bondAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(500)) + + valCoins := sdk.NewCoins(sdk.NewCoin(MultiStakingDenomA, math.NewInt(10000)), sdk.NewCoin(MultiStakingDenomB, math.NewInt(10000))) + suite.FundAccount(sdk.AccAddress(valAddr2), valCoins) + createMsg2 := stakingtypes.MsgCreateValidator{ Description: stakingtypes.Description{ Moniker: "test", @@ -85,12 +93,12 @@ func (suite *KeeperTestSuite) TestModuleAccountInvariants() { Details: "test", }, Commission: stakingtypes.CommissionRates{ - Rate: sdk.MustNewDecFromStr("0.05"), - MaxRate: sdk.MustNewDecFromStr("0.1"), - MaxChangeRate: sdk.MustNewDecFromStr("0.1"), + Rate: math.LegacyMustNewDecFromStr("0.05"), + MaxRate: math.LegacyMustNewDecFromStr("0.1"), + MaxChangeRate: math.LegacyMustNewDecFromStr("0.1"), }, - MinSelfDelegation: sdk.NewInt(200), - DelegatorAddress: delAddr.String(), + MinSelfDelegation: math.NewInt(1), + DelegatorAddress: sdk.AccAddress(valAddr2).String(), ValidatorAddress: valAddr2.String(), Pubkey: codectypes.UnsafePackAny(valPubKey2), Value: bondAmount, @@ -99,7 +107,11 @@ func (suite *KeeperTestSuite) TestModuleAccountInvariants() { _, err := suite.msgServer.CreateValidator(suite.ctx, &createMsg2) suite.Require().NoError(err) - multiStakingMsg := stakingtypes.NewMsgBeginRedelegate(delAddr, valAddr, valAddr2, bondAmount) + delMsg := stakingtypes.NewMsgDelegate(delAddr.String(), valAddr.String(), bondAmount) + _, err = suite.msgServer.Delegate(suite.ctx, delMsg) + suite.Require().NoError(err) + + multiStakingMsg := stakingtypes.NewMsgBeginRedelegate(delAddr.String(), valAddr.String(), valAddr2.String(), bondAmount) _, err = suite.msgServer.BeginRedelegate(suite.ctx, multiStakingMsg) suite.Require().NoError(err) }, @@ -108,13 +120,17 @@ func (suite *KeeperTestSuite) TestModuleAccountInvariants() { { name: "Success Undelegate", malleate: func() { - bondAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(250)) - multiStakingMsg := stakingtypes.NewMsgUndelegate(delAddr, valAddr, bondAmount) - _, err := suite.msgServer.Undelegate(suite.ctx, multiStakingMsg) + delMsg := stakingtypes.NewMsgDelegate(delAddr.String(), valAddr.String(), bondAmount) + _, err := suite.msgServer.Delegate(suite.ctx, delMsg) + suite.Require().NoError(err) + + bondAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(250)) + multiStakingMsg := stakingtypes.NewMsgUndelegate(delAddr.String(), valAddr.String(), bondAmount) + _, err = suite.msgServer.Undelegate(suite.ctx, multiStakingMsg) suite.Require().NoError(err) - bondAmount1 := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(500)) - multiStakingMsg1 := stakingtypes.NewMsgUndelegate(delAddr, valAddr, bondAmount1) + bondAmount1 := sdk.NewCoin(MultiStakingDenomA, math.NewInt(500)) + multiStakingMsg1 := stakingtypes.NewMsgUndelegate(delAddr.String(), valAddr.String(), bondAmount1) _, err = suite.msgServer.Undelegate(suite.ctx, multiStakingMsg1) suite.Require().NoError(err) }, @@ -123,7 +139,7 @@ func (suite *KeeperTestSuite) TestModuleAccountInvariants() { { name: "Fail invariant", malleate: func() { - multiStakingLock := types.NewMultiStakingLock(types.MultiStakingLockID(delAddr.String(), valAddr.String()), types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(200), sdk.OneDec())) + multiStakingLock := types.NewMultiStakingLock(types.MultiStakingLockID(delAddr.String(), valAddr.String()), types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(200), math.LegacyOneDec())) suite.app.MultiStakingKeeper.SetMultiStakingLock(suite.ctx, multiStakingLock) }, expPass: false, @@ -132,11 +148,11 @@ func (suite *KeeperTestSuite) TestModuleAccountInvariants() { for _, tc := range testCases { suite.SetupTest() // reset - valCoins := sdk.NewCoins(sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(10000)), sdk.NewCoin(MultiStakingDenomB, sdk.NewInt(10000))) + valCoins := sdk.NewCoins(sdk.NewCoin(MultiStakingDenomA, math.NewInt(10000)), sdk.NewCoin(MultiStakingDenomB, math.NewInt(10000))) suite.FundAccount(delAddr, valCoins) + suite.FundAccount(sdk.AccAddress(valAddr), valCoins) - suite.msKeeper.SetBondWeight(suite.ctx, MultiStakingDenomA, sdk.MustNewDecFromStr("0.3")) - bondAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(3001)) + suite.msKeeper.SetBondWeight(suite.ctx, MultiStakingDenomA, math.LegacyMustNewDecFromStr("0.3")) msg := stakingtypes.MsgCreateValidator{ Description: stakingtypes.Description{ Moniker: "test", @@ -146,12 +162,12 @@ func (suite *KeeperTestSuite) TestModuleAccountInvariants() { Details: "test", }, Commission: stakingtypes.CommissionRates{ - Rate: sdk.MustNewDecFromStr("0.05"), - MaxRate: sdk.MustNewDecFromStr("0.1"), - MaxChangeRate: sdk.MustNewDecFromStr("0.05"), + Rate: math.LegacyMustNewDecFromStr("0.05"), + MaxRate: math.LegacyMustNewDecFromStr("0.1"), + MaxChangeRate: math.LegacyMustNewDecFromStr("0.05"), }, - MinSelfDelegation: sdk.NewInt(1), - DelegatorAddress: delAddr.String(), + MinSelfDelegation: math.NewInt(1), + DelegatorAddress: sdk.AccAddress(valAddr).String(), ValidatorAddress: valAddr.String(), Pubkey: codectypes.UnsafePackAny(valPubKey), Value: bondAmount, diff --git a/x/multi-staking/keeper/keeper.go b/x/multi-staking/keeper/keeper.go index 49e83267..b9024832 100644 --- a/x/multi-staking/keeper/keeper.go +++ b/x/multi-staking/keeper/keeper.go @@ -1,20 +1,21 @@ package keeper import ( + "context" "fmt" "time" "github.com/realio-tech/multi-staking-module/x/multi-staking/types" + sdkerrors "cosmossdk.io/errors" + "cosmossdk.io/log" "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - - "github.com/cometbft/cometbft/libs/log" ) type Keeper struct { @@ -45,13 +46,17 @@ func NewKeeper( } // Logger returns a module-specific logger. -func (k Keeper) Logger(ctx sdk.Context) log.Logger { - return ctx.Logger().With("module", "x/"+types.ModuleName) +func (k Keeper) Logger(ctx context.Context) log.Logger { + sdkCtx := sdk.UnwrapSDKContext(ctx) + return sdkCtx.Logger().With("module", "x/"+types.ModuleName) } -func (k Keeper) DequeueAllMatureUBDQueue(ctx sdk.Context, currTime time.Time) (matureUnbonds []stakingtypes.DVPair) { +func (k Keeper) DequeueAllMatureUBDQueue(ctx context.Context, currTime time.Time) (matureUnbonds []stakingtypes.DVPair, err error) { // gets an iterator for all timeslices from time 0 until the current Blockheader time - unbondingTimesliceIterator := k.stakingKeeper.UBDQueueIterator(ctx, currTime) + unbondingTimesliceIterator, err := k.stakingKeeper.UBDQueueIterator(ctx, currTime) + if err != nil { + return nil, err + } defer unbondingTimesliceIterator.Close() for ; unbondingTimesliceIterator.Valid(); unbondingTimesliceIterator.Next() { @@ -62,36 +67,44 @@ func (k Keeper) DequeueAllMatureUBDQueue(ctx sdk.Context, currTime time.Time) (m matureUnbonds = append(matureUnbonds, timeslice.Pairs...) } - return matureUnbonds + return matureUnbonds, nil } -func (k Keeper) GetMatureUnbondingDelegations(ctx sdk.Context) []stakingtypes.UnbondingDelegation { +func (k Keeper) GetMatureUnbondingDelegations(ctx context.Context) ([]stakingtypes.UnbondingDelegation, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) var matureUnbondingDelegations []stakingtypes.UnbondingDelegation - matureUnbonds := k.DequeueAllMatureUBDQueue(ctx, ctx.BlockHeader().Time) + matureUnbonds, err := k.DequeueAllMatureUBDQueue(ctx, sdkCtx.BlockHeader().Time) + if err != nil { + return nil, err + } for _, dvPair := range matureUnbonds { delAddr, valAddr, err := types.AccAddrAndValAddrFromStrings(dvPair.DelegatorAddress, dvPair.ValidatorAddress) if err != nil { panic(err) } - unbondingDelegation, found := k.stakingKeeper.GetUnbondingDelegation(ctx, delAddr, valAddr) // ?? - if !found { - continue + unbondingDelegation, err := k.stakingKeeper.GetUnbondingDelegation(ctx, delAddr, valAddr) + if err != nil { + if sdkerrors.IsOf(err, stakingtypes.ErrNoUnbondingDelegation) { + continue + } + + return nil, err } matureUnbondingDelegations = append(matureUnbondingDelegations, unbondingDelegation) } - return matureUnbondingDelegations + return matureUnbondingDelegations, nil } func (k Keeper) GetUnbondingEntryAtCreationHeight(ctx sdk.Context, delAcc sdk.AccAddress, valAcc sdk.ValAddress, creationHeight int64) (stakingtypes.UnbondingDelegationEntry, bool) { - ubd, found := k.stakingKeeper.GetUnbondingDelegation(ctx, delAcc, valAcc) - if !found { + ubd, err := k.stakingKeeper.GetUnbondingDelegation(ctx, delAcc, valAcc) + if err != nil { return stakingtypes.UnbondingDelegationEntry{}, false } var unbondingEntryAtHeight stakingtypes.UnbondingDelegationEntry - found = false + found := false for _, entry := range ubd.Entries { if entry.CreationHeight == creationHeight { if !found { @@ -106,7 +119,7 @@ func (k Keeper) GetUnbondingEntryAtCreationHeight(ctx sdk.Context, delAcc sdk.Ac return unbondingEntryAtHeight, found } -func (k Keeper) BurnCoin(ctx sdk.Context, accAddr sdk.AccAddress, coin sdk.Coin) error { +func (k Keeper) BurnCoin(ctx context.Context, accAddr sdk.AccAddress, coin sdk.Coin) error { err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, accAddr, types.ModuleName, sdk.NewCoins(coin)) if err != nil { return err @@ -118,18 +131,19 @@ func (k Keeper) BurnCoin(ctx sdk.Context, accAddr sdk.AccAddress, coin sdk.Coin) return nil } -func (k Keeper) isValMultiStakingCoin(ctx sdk.Context, valAcc sdk.ValAddress, lockedCoin sdk.Coin) bool { - return lockedCoin.Denom == k.GetValidatorMultiStakingCoin(ctx, valAcc) +func (k Keeper) isValMultiStakingCoin(ctx context.Context, valAcc sdk.ValAddress, lockedCoin sdk.Coin) bool { + sdkCtx := sdk.UnwrapSDKContext(ctx) + return lockedCoin.Denom == k.GetValidatorMultiStakingCoin(sdkCtx, valAcc) } -func (k Keeper) AdjustUnbondAmount(ctx sdk.Context, delAcc sdk.AccAddress, valAcc sdk.ValAddress, amount math.Int) (adjustedAmount math.Int, err error) { - delegation, found := k.stakingKeeper.GetDelegation(ctx, delAcc, valAcc) - if !found { - return math.Int{}, fmt.Errorf("delegation not found") +func (k Keeper) AdjustUnbondAmount(ctx context.Context, delAcc sdk.AccAddress, valAcc sdk.ValAddress, amount math.Int) (adjustedAmount math.Int, err error) { + delegation, err := k.stakingKeeper.GetDelegation(ctx, delAcc, valAcc) + if err != nil { + return math.Int{}, fmt.Errorf("failed to get delegation: %s", err.Error()) } - validator, found := k.stakingKeeper.GetValidator(ctx, valAcc) - if !found { - return math.Int{}, fmt.Errorf("validator not found") + validator, err := k.stakingKeeper.GetValidator(ctx, valAcc) + if err != nil { + return math.Int{}, fmt.Errorf("failed to get validator: %s", err.Error()) } shares, err := validator.SharesFromTokens(amount) @@ -149,10 +163,10 @@ func (k Keeper) AdjustUnbondAmount(ctx sdk.Context, delAcc sdk.AccAddress, valAc return validator.TokensFromShares(shares).TruncateInt(), nil } -func (k Keeper) AdjustCancelUnbondingAmount(ctx sdk.Context, delAcc sdk.AccAddress, valAcc sdk.ValAddress, creationHeight int64, amount math.Int) (adjustedAmount math.Int, err error) { - undelegation, found := k.stakingKeeper.GetUnbondingDelegation(ctx, delAcc, valAcc) - if !found { - return math.Int{}, fmt.Errorf("undelegation not found") +func (k Keeper) AdjustCancelUnbondingAmount(ctx context.Context, delAcc sdk.AccAddress, valAcc sdk.ValAddress, creationHeight int64, amount math.Int) (adjustedAmount math.Int, err error) { + undelegation, err := k.stakingKeeper.GetUnbondingDelegation(ctx, delAcc, valAcc) + if err != nil { + return math.Int{}, fmt.Errorf("failed to get undelegation: %s", err.Error()) } totalUnbondingAmount := math.ZeroInt() @@ -165,11 +179,12 @@ func (k Keeper) AdjustCancelUnbondingAmount(ctx sdk.Context, delAcc sdk.AccAddre return math.MinInt(totalUnbondingAmount, amount), nil } -func (k Keeper) BondDenom(ctx sdk.Context) string { - bondDenom := k.GetParams(ctx).MainBondDenom +func (k Keeper) BondDenom(ctx context.Context) string { + sdkCtx := sdk.UnwrapSDKContext(ctx) + bondDenom := k.GetParams(sdkCtx).MainBondDenom return bondDenom } -func (k Keeper) IterateDelegations(ctx sdk.Context, delegator sdk.AccAddress, fn func(index int64, delegation stakingtypes.DelegationI) (stop bool)) { - k.stakingKeeper.IterateDelegations(ctx, delegator, fn) +func (k Keeper) IterateDelegations(ctx context.Context, delegator sdk.AccAddress, fn func(index int64, delegation stakingtypes.DelegationI) (stop bool)) error { + return k.stakingKeeper.IterateDelegations(ctx, delegator, fn) } diff --git a/x/multi-staking/keeper/keeper_test.go b/x/multi-staking/keeper/keeper_test.go index 364b7e68..5297fc15 100644 --- a/x/multi-staking/keeper/keeper_test.go +++ b/x/multi-staking/keeper/keeper_test.go @@ -10,6 +10,7 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + coreheader "cosmossdk.io/core/header" "cosmossdk.io/math" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -33,8 +34,12 @@ type KeeperTestSuite struct { } func (suite *KeeperTestSuite) SetupTest() { - app := simapp.Setup(false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{Height: app.LastBlockHeight() + 1}) + app := simapp.Setup() + ctx := app.NewContextLegacy(false, tmproto.Header{Height: app.LastBlockHeight() + 1}) + + _, err := app.CrisisKeeper.ConstantFee.Get(ctx) + suite.Require().NoError(err) + multiStakingMsgServer := multistakingkeeper.NewMsgServerImpl(app.MultiStakingKeeper) suite.app, suite.ctx, suite.msKeeper, suite.govKeeper, suite.msgServer = app, ctx, &app.MultiStakingKeeper, app.GovKeeper, multiStakingMsgServer @@ -46,7 +51,6 @@ func TestKeeperTestSuite(t *testing.T) { func (suite *KeeperTestSuite) TestAdjustUnbondAmount() { delAddr := test.GenAddress() - valDelAddr := test.GenAddress() valPubKey := test.GenPubKey() valAddr := sdk.ValAddress(valPubKey.Address()) @@ -60,32 +64,32 @@ func (suite *KeeperTestSuite) TestAdjustUnbondAmount() { { name: "success and not change adjust amount", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) (sdk.Coin, error) { - multiStakingAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(1000)) - delMsg := stakingtypes.NewMsgDelegate(delAddr, valAddr, multiStakingAmount) + multiStakingAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(1000)) + delMsg := stakingtypes.NewMsgDelegate(delAddr.String(), valAddr.String(), multiStakingAmount) _, err := msgServer.Delegate(ctx, delMsg) return multiStakingAmount, err }, - adjustAmount: sdk.NewInt(800), - expAmount: sdk.NewInt(800), + adjustAmount: math.NewInt(800), + expAmount: math.NewInt(800), expErr: false, }, { name: "success and reduce adjust amount", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) (sdk.Coin, error) { - multiStakingAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(1000)) - delMsg := stakingtypes.NewMsgDelegate(delAddr, valAddr, multiStakingAmount) + multiStakingAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(1000)) + delMsg := stakingtypes.NewMsgDelegate(delAddr.String(), valAddr.String(), multiStakingAmount) _, err := msgServer.Delegate(ctx, delMsg) return multiStakingAmount, err }, - adjustAmount: sdk.NewInt(2000), - expAmount: sdk.NewInt(1000), + adjustAmount: math.NewInt(2000), + expAmount: math.NewInt(1000), expErr: false, }, { name: "not found delegation", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) (sdk.Coin, error) { - multiStakingAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(1000)) + multiStakingAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(1000)) return multiStakingAmount, nil }, expErr: true, @@ -97,14 +101,14 @@ func (suite *KeeperTestSuite) TestAdjustUnbondAmount() { suite.Run(tc.name, func() { suite.SetupTest() newParam := stakingtypes.DefaultParams() - newParam.MinCommissionRate = sdk.MustNewDecFromStr("0.02") + newParam.MinCommissionRate = math.LegacyMustNewDecFromStr("0.02") err := suite.app.StakingKeeper.SetParams(suite.ctx, newParam) suite.Require().NoError(err) - suite.msKeeper.SetBondWeight(suite.ctx, MultiStakingDenomA, sdk.OneDec()) - bondAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(1000)) - userBalance := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(10000)) + suite.msKeeper.SetBondWeight(suite.ctx, MultiStakingDenomA, math.LegacyOneDec()) + bondAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(1000)) + userBalance := sdk.NewCoin(MultiStakingDenomA, math.NewInt(10000)) suite.FundAccount(delAddr, sdk.NewCoins(userBalance)) - suite.FundAccount(valDelAddr, sdk.NewCoins(userBalance)) + suite.FundAccount(sdk.AccAddress(valAddr), sdk.NewCoins(userBalance)) createMsg := stakingtypes.MsgCreateValidator{ Description: stakingtypes.Description{ @@ -115,12 +119,12 @@ func (suite *KeeperTestSuite) TestAdjustUnbondAmount() { Details: "test", }, Commission: stakingtypes.CommissionRates{ - Rate: sdk.MustNewDecFromStr("0.05"), - MaxRate: sdk.MustNewDecFromStr("0.1"), - MaxChangeRate: sdk.MustNewDecFromStr("0.05"), + Rate: math.LegacyMustNewDecFromStr("0.05"), + MaxRate: math.LegacyMustNewDecFromStr("0.1"), + MaxChangeRate: math.LegacyMustNewDecFromStr("0.05"), }, - MinSelfDelegation: sdk.NewInt(200), - DelegatorAddress: valDelAddr.String(), + MinSelfDelegation: math.NewInt(200), + DelegatorAddress: sdk.AccAddress(valAddr).String(), ValidatorAddress: valAddr.String(), Pubkey: codectypes.UnsafePackAny(valPubKey), Value: bondAmount, @@ -157,56 +161,56 @@ func (suite *KeeperTestSuite) TestAdjustCancelUnbondAmount() { { name: "success and not change adjust amount", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) (sdk.Coin, error) { - multiStakingAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(1000)) - undelMsg := stakingtypes.NewMsgUndelegate(delAddr, valAddr, multiStakingAmount) + multiStakingAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(1000)) + undelMsg := stakingtypes.NewMsgUndelegate(delAddr.String(), valAddr.String(), multiStakingAmount) _, err := msgServer.Undelegate(ctx, undelMsg) return multiStakingAmount, err }, - adjustAmount: sdk.NewInt(800), - expAmount: sdk.NewInt(800), + adjustAmount: math.NewInt(800), + expAmount: math.NewInt(800), expErr: false, }, { name: "success with many unbonding delegations", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) (sdk.Coin, error) { - multiStakingAmount1 := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(400)) - undelMsg1 := stakingtypes.NewMsgUndelegate(delAddr, valAddr, multiStakingAmount1) + multiStakingAmount1 := sdk.NewCoin(MultiStakingDenomA, math.NewInt(400)) + undelMsg1 := stakingtypes.NewMsgUndelegate(delAddr.String(), valAddr.String(), multiStakingAmount1) _, err := msgServer.Undelegate(ctx, undelMsg1) suite.Require().NoError(err) - multiStakingAmount2 := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(500)) - undelMsg2 := stakingtypes.NewMsgUndelegate(delAddr, valAddr, multiStakingAmount2) + multiStakingAmount2 := sdk.NewCoin(MultiStakingDenomA, math.NewInt(500)) + undelMsg2 := stakingtypes.NewMsgUndelegate(delAddr.String(), valAddr.String(), multiStakingAmount2) _, err = msgServer.Undelegate(ctx, undelMsg2) suite.Require().NoError(err) - multiStakingAmount3 := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(600)) - undelMsg3 := stakingtypes.NewMsgUndelegate(delAddr, valAddr, multiStakingAmount3) + multiStakingAmount3 := sdk.NewCoin(MultiStakingDenomA, math.NewInt(600)) + undelMsg3 := stakingtypes.NewMsgUndelegate(delAddr.String(), valAddr.String(), multiStakingAmount3) _, err = msgServer.Undelegate(ctx, undelMsg3) suite.Require().NoError(err) return multiStakingAmount1, nil }, - adjustAmount: sdk.NewInt(1500), - expAmount: sdk.NewInt(1500), + adjustAmount: math.NewInt(1500), + expAmount: math.NewInt(1500), expErr: false, }, { name: "success and reduce adjust amount", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) (sdk.Coin, error) { - multiStakingAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(1000)) - undelMsg := stakingtypes.NewMsgUndelegate(delAddr, valAddr, multiStakingAmount) + multiStakingAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(1000)) + undelMsg := stakingtypes.NewMsgUndelegate(delAddr.String(), valAddr.String(), multiStakingAmount) _, err := msgServer.Undelegate(ctx, undelMsg) return multiStakingAmount, err }, - adjustAmount: sdk.NewInt(2000), - expAmount: sdk.NewInt(1000), + adjustAmount: math.NewInt(2000), + expAmount: math.NewInt(1000), expErr: false, }, { name: "not found delegation", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) (sdk.Coin, error) { - multiStakingAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(1000)) + multiStakingAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(1000)) return multiStakingAmount, nil }, expErr: true, @@ -218,13 +222,14 @@ func (suite *KeeperTestSuite) TestAdjustCancelUnbondAmount() { suite.Run(tc.name, func() { suite.SetupTest() newParam := stakingtypes.DefaultParams() - newParam.MinCommissionRate = sdk.MustNewDecFromStr("0.02") + newParam.MinCommissionRate = math.LegacyMustNewDecFromStr("0.02") err := suite.app.StakingKeeper.SetParams(suite.ctx, newParam) suite.Require().NoError(err) - suite.msKeeper.SetBondWeight(suite.ctx, MultiStakingDenomA, sdk.OneDec()) - bondAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(5000)) - userBalance := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(10000)) + suite.msKeeper.SetBondWeight(suite.ctx, MultiStakingDenomA, math.LegacyOneDec()) + bondAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(5000)) + userBalance := sdk.NewCoin(MultiStakingDenomA, math.NewInt(10000)) suite.FundAccount(delAddr, sdk.NewCoins(userBalance)) + suite.FundAccount(sdk.AccAddress(valAddr), sdk.NewCoins(userBalance)) createMsg := stakingtypes.MsgCreateValidator{ Description: stakingtypes.Description{ @@ -235,21 +240,28 @@ func (suite *KeeperTestSuite) TestAdjustCancelUnbondAmount() { Details: "test", }, Commission: stakingtypes.CommissionRates{ - Rate: sdk.MustNewDecFromStr("0.05"), - MaxRate: sdk.MustNewDecFromStr("0.1"), - MaxChangeRate: sdk.MustNewDecFromStr("0.05"), + Rate: math.LegacyMustNewDecFromStr("0.05"), + MaxRate: math.LegacyMustNewDecFromStr("0.1"), + MaxChangeRate: math.LegacyMustNewDecFromStr("0.05"), }, - MinSelfDelegation: sdk.NewInt(200), - DelegatorAddress: delAddr.String(), + MinSelfDelegation: math.NewInt(200), + DelegatorAddress: sdk.AccAddress(valAddr).String(), ValidatorAddress: valAddr.String(), Pubkey: codectypes.UnsafePackAny(valPubKey), Value: bondAmount, } _, err = suite.msgServer.CreateValidator(suite.ctx, &createMsg) suite.Require().NoError(err) + + delMsg := stakingtypes.NewMsgDelegate(delAddr.String(), valAddr.String(), bondAmount) + _, err = suite.msgServer.Delegate(suite.ctx, delMsg) + suite.Require().NoError(err) + _, err = tc.malleate(suite.ctx, suite.msgServer, *suite.msKeeper) suite.Require().NoError(err) + suite.ctx = suite.ctx.WithBlockHeader(tmproto.Header{Time: time.Now()}).WithBlockHeight(1) + actualAmt, err := suite.msKeeper.AdjustCancelUnbondingAmount(suite.ctx, delAddr, valAddr, suite.ctx.BlockHeight(), tc.adjustAmount) if tc.expErr { @@ -265,17 +277,23 @@ func (suite *KeeperTestSuite) TestAdjustCancelUnbondAmount() { // Todo: add CheckBalance; AddAccountWithCoin; FundAccount func (suite *KeeperTestSuite) NextBlock(jumpTime time.Duration) { app := suite.app - app.EndBlock(abci.RequestEndBlock{Height: suite.ctx.BlockHeight()}) - - app.Commit() - - newBlockTime := suite.ctx.BlockTime().Add(jumpTime) - nextHeight := suite.ctx.BlockHeight() + 1 - newHeader := tmproto.Header{Height: nextHeight, Time: newBlockTime} - - app.BeginBlock(abci.RequestBeginBlock{Header: newHeader}) - - suite.ctx = app.NewContext(false, newHeader) + ctx := suite.ctx + _, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: ctx.BlockHeight(), Time: ctx.BlockTime()}) + suite.Require().NoError(err) + _, err = app.Commit() + suite.Require().NoError(err) + newBlockTime := ctx.BlockTime().Add(jumpTime) + + header := ctx.BlockHeader() + header.Time = newBlockTime + header.Height++ + + newCtx := app.BaseApp.NewUncachedContext(false, header).WithHeaderInfo(coreheader.Info{ + Height: header.Height, + Time: header.Time, + }) + + suite.ctx = newCtx } // Todo: add CheckBalance; AddAccountWithCoin; FundAccount diff --git a/x/multi-staking/keeper/lock.go b/x/multi-staking/keeper/lock.go index 30ceb51e..7cfa866d 100644 --- a/x/multi-staking/keeper/lock.go +++ b/x/multi-staking/keeper/lock.go @@ -1,18 +1,21 @@ package keeper import ( + "context" + "github.com/realio-tech/multi-staking-module/x/multi-staking/types" "cosmossdk.io/errors" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -func (k Keeper) GetOrCreateMultiStakingLock(ctx sdk.Context, lockID types.LockID) types.MultiStakingLock { +func (k Keeper) GetOrCreateMultiStakingLock(ctx context.Context, lockID types.LockID) types.MultiStakingLock { multiStakingLock, found := k.GetMultiStakingLock(ctx, lockID) if !found { - multiStakingLock = types.NewMultiStakingLock(lockID, types.MultiStakingCoin{Amount: sdk.ZeroInt()}) + multiStakingLock = types.NewMultiStakingLock(lockID, types.MultiStakingCoin{Amount: math.ZeroInt()}) } return multiStakingLock } @@ -35,20 +38,21 @@ func (k Keeper) MintCoin(ctx sdk.Context, toAcc sdk.AccAddress, coin sdk.Coin) e } func (k Keeper) LockCoinAndMintBondCoin( - ctx sdk.Context, + ctx context.Context, lockID types.LockID, fromAcc sdk.AccAddress, mintedTo sdk.AccAddress, coin sdk.Coin, ) (mintedBondCoin sdk.Coin, err error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) // escrow coin - err = k.EscrowCoinFrom(ctx, fromAcc, coin) + err = k.EscrowCoinFrom(sdkCtx, fromAcc, coin) if err != nil { return sdk.Coin{}, err } // get multistaking coin's bond weight - bondWeight, isMultiStakingCoin := k.GetBondWeight(ctx, coin.Denom) + bondWeight, isMultiStakingCoin := k.GetBondWeight(sdkCtx, coin.Denom) if !isMultiStakingCoin { return sdk.Coin{}, errors.Wrapf( sdkerrors.ErrInvalidRequest, "invalid coin denomination: got %s", coin.Denom, @@ -57,21 +61,25 @@ func (k Keeper) LockCoinAndMintBondCoin( // update multistaking lock multiStakingCoin := types.NewMultiStakingCoin(coin.Denom, coin.Amount, bondWeight) - lock := k.GetOrCreateMultiStakingLock(ctx, lockID) + lock := k.GetOrCreateMultiStakingLock(sdkCtx, lockID) err = lock.AddCoinToMultiStakingLock(multiStakingCoin) if err != nil { return sdk.Coin{}, err } - k.SetMultiStakingLock(ctx, lock) + k.SetMultiStakingLock(sdkCtx, lock) // Calculate the amount of bond denom to be minted // minted bond amount = multistaking coin * bond coin weight + bondDenom, err := k.stakingKeeper.BondDenom(sdkCtx) + if err != nil { + return sdk.Coin{}, err + } mintedBondAmount := multiStakingCoin.BondValue() - mintedBondCoin = sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), mintedBondAmount) + mintedBondCoin = sdk.NewCoin(bondDenom, mintedBondAmount) // mint bond coin to delegator account - err = k.MintCoin(ctx, mintedTo, mintedBondCoin) + err = k.MintCoin(sdkCtx, mintedTo, mintedBondCoin) if err != nil { return sdk.Coin{}, err } diff --git a/x/multi-staking/keeper/migrations.go b/x/multi-staking/keeper/migrations.go index 8c004c5f..c72466db 100644 --- a/x/multi-staking/keeper/migrations.go +++ b/x/multi-staking/keeper/migrations.go @@ -18,7 +18,10 @@ func NewMigrator(keeper *stakingkeeper.Keeper, legacySubspace exported.Subspace) } } -// Migrate1to2 migrates multi-staking state from consensus version 1 to 2. (sdk46 to sdk47) +// Migrate1to2 migrates multi-staking state from consensus version 1 to 2. (sdk46 to sdk50) func (m Migrator) Migrate1to2(ctx sdk.Context) error { - return m.stkm.Migrate3to4(ctx) + if err := m.stkm.Migrate3to4(ctx); err != nil { + return err + } + return m.stkm.Migrate4to5(ctx) } diff --git a/x/multi-staking/keeper/msg_server.go b/x/multi-staking/keeper/msg_server.go index 8059d16b..e5144ff2 100644 --- a/x/multi-staking/keeper/msg_server.go +++ b/x/multi-staking/keeper/msg_server.go @@ -16,8 +16,10 @@ type msgServer struct { stakingMsgServer stakingtypes.MsgServer } -var _ stakingtypes.MsgServer = msgServer{} -var _ types.MsgServer = msgServer{} +var ( + _ stakingtypes.MsgServer = msgServer{} + _ types.MsgServer = msgServer{} +) func NewMultiStakingMsgServerImpl(keeper Keeper) types.MsgServer { return &msgServer{ @@ -25,15 +27,15 @@ func NewMultiStakingMsgServerImpl(keeper Keeper) types.MsgServer { } } -func (k msgServer) UpdateMultiStakingParams(goCtx context.Context, msg *types.MsgUpdateMultiStakingParams) (*types.MsgUpdateMultiStakingParamsResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) +func (k msgServer) UpdateMultiStakingParams(ctx context.Context, msg *types.MsgUpdateMultiStakingParams) (*types.MsgUpdateMultiStakingParamsResponse, error) { + sdkctx := sdk.UnwrapSDKContext(ctx) if k.keeper.authority != msg.Authority { return nil, fmt.Errorf("invalid authority; expected %s, got %s", k.keeper.authority, msg.Authority) } // store params - if err := k.keeper.SetParams(ctx, msg.Params); err != nil { + if err := k.keeper.SetParams(sdkctx, msg.Params); err != nil { return nil, err } @@ -50,15 +52,15 @@ func NewMsgServerImpl(keeper Keeper) *msgServer { } // UpdateParams updates the staking params -func (k msgServer) UpdateParams(goCtx context.Context, msg *stakingtypes.MsgUpdateParams) (*stakingtypes.MsgUpdateParamsResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) +func (k msgServer) UpdateParams(ctx context.Context, msg *stakingtypes.MsgUpdateParams) (*stakingtypes.MsgUpdateParamsResponse, error) { + sdkctx := sdk.UnwrapSDKContext(ctx) if k.keeper.authority != msg.Authority { return nil, fmt.Errorf("invalid authority; expected %s, got %s", k.keeper.authority, msg.Authority) } // store params - if err := k.keeper.stakingKeeper.SetParams(ctx, msg.Params); err != nil { + if err := k.keeper.stakingKeeper.SetParams(sdkctx, msg.Params); err != nil { return nil, err } @@ -66,17 +68,16 @@ func (k msgServer) UpdateParams(goCtx context.Context, msg *stakingtypes.MsgUpda } // CreateValidator defines a method for creating a new validator -func (k msgServer) CreateValidator(goCtx context.Context, msg *stakingtypes.MsgCreateValidator) (*stakingtypes.MsgCreateValidatorResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - multiStakerAddr, valAcc, err := types.AccAddrAndValAddrFromStrings(msg.DelegatorAddress, msg.ValidatorAddress) +func (k msgServer) CreateValidator(ctx context.Context, msg *stakingtypes.MsgCreateValidator) (*stakingtypes.MsgCreateValidatorResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + multiStakerAddr, valAcc, err := types.ValidatorAccAddrAndValAddrFromStrings(msg.ValidatorAddress) if err != nil { return nil, err } - lockID := types.MultiStakingLockID(msg.DelegatorAddress, msg.ValidatorAddress) + lockID := types.MultiStakingLockID(multiStakerAddr.String(), msg.ValidatorAddress) - mintedBondCoin, err := k.keeper.LockCoinAndMintBondCoin(ctx, lockID, multiStakerAddr, multiStakerAddr, msg.Value) + mintedBondCoin, err := k.keeper.LockCoinAndMintBondCoin(sdkCtx, lockID, multiStakerAddr, multiStakerAddr, msg.Value) if err != nil { return nil, err } @@ -85,20 +86,20 @@ func (k msgServer) CreateValidator(goCtx context.Context, msg *stakingtypes.MsgC Description: msg.Description, Commission: msg.Commission, MinSelfDelegation: msg.MinSelfDelegation, - DelegatorAddress: msg.DelegatorAddress, + DelegatorAddress: multiStakerAddr.String(), ValidatorAddress: msg.ValidatorAddress, Pubkey: msg.Pubkey, Value: mintedBondCoin, // replace lock coin with bond coin } - k.keeper.SetValidatorMultiStakingCoin(ctx, valAcc, msg.Value.Denom) + k.keeper.SetValidatorMultiStakingCoin(sdkCtx, valAcc, msg.Value.Denom) - return k.stakingMsgServer.CreateValidator(sdk.WrapSDKContext(ctx), &sdkMsg) + return k.stakingMsgServer.CreateValidator(sdkCtx, &sdkMsg) } // EditValidator defines a method for editing an existing validator -func (k msgServer) EditValidator(goCtx context.Context, msg *stakingtypes.MsgEditValidator) (*stakingtypes.MsgEditValidatorResponse, error) { - return k.stakingMsgServer.EditValidator(goCtx, msg) +func (k msgServer) EditValidator(ctx context.Context, msg *stakingtypes.MsgEditValidator) (*stakingtypes.MsgEditValidatorResponse, error) { + return k.stakingMsgServer.EditValidator(ctx, msg) } // Delegate defines a method for performing a delegation of coins from a delegator to a validator @@ -127,13 +128,11 @@ func (k msgServer) Delegate(goCtx context.Context, msg *stakingtypes.MsgDelegate Amount: mintedBondCoin, // replace lock coin with bond coin } - return k.stakingMsgServer.Delegate(sdk.WrapSDKContext(ctx), &sdkMsg) + return k.stakingMsgServer.Delegate(ctx, &sdkMsg) } // BeginRedelegate defines a method for performing a redelegation of coins from a delegator and source validator to a destination validator -func (k msgServer) BeginRedelegate(goCtx context.Context, msg *stakingtypes.MsgBeginRedelegate) (*stakingtypes.MsgBeginRedelegateResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - +func (k msgServer) BeginRedelegate(ctx context.Context, msg *stakingtypes.MsgBeginRedelegate) (*stakingtypes.MsgBeginRedelegateResponse, error) { multiStakerAddr := sdk.MustAccAddressFromBech32(msg.DelegatorAddress) srcValAcc, err := sdk.ValAddressFromBech32(msg.ValidatorSrcAddress) @@ -173,7 +172,11 @@ func (k msgServer) BeginRedelegate(goCtx context.Context, msg *stakingtypes.MsgB return nil, err } - bondCoin := sdk.NewCoin(k.keeper.stakingKeeper.BondDenom(ctx), redelegateAmount) + bondDenom, err := k.keeper.stakingKeeper.BondDenom(ctx) + if err != nil { + return nil, err + } + bondCoin := sdk.NewCoin(bondDenom, redelegateAmount) sdkMsg := &stakingtypes.MsgBeginRedelegate{ DelegatorAddress: msg.DelegatorAddress, @@ -182,13 +185,11 @@ func (k msgServer) BeginRedelegate(goCtx context.Context, msg *stakingtypes.MsgB Amount: bondCoin, // replace lockCoin with bondCoin } - return k.stakingMsgServer.BeginRedelegate(sdk.WrapSDKContext(ctx), sdkMsg) + return k.stakingMsgServer.BeginRedelegate(ctx, sdkMsg) } // Undelegate defines a method for performing an undelegation from a delegate and a validator -func (k msgServer) Undelegate(goCtx context.Context, msg *stakingtypes.MsgUndelegate) (*stakingtypes.MsgUndelegateResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - +func (k msgServer) Undelegate(ctx context.Context, msg *stakingtypes.MsgUndelegate) (*stakingtypes.MsgUndelegateResponse, error) { multiStakerAddr, valAcc, err := types.AccAddrAndValAddrFromStrings(msg.DelegatorAddress, msg.ValidatorAddress) if err != nil { return nil, err @@ -217,7 +218,11 @@ func (k msgServer) Undelegate(goCtx context.Context, msg *stakingtypes.MsgUndele return nil, err } - unbondCoin := sdk.NewCoin(k.keeper.stakingKeeper.BondDenom(ctx), unbondAmount) + bondDenom, err := k.keeper.stakingKeeper.BondDenom(ctx) + if err != nil { + return nil, err + } + unbondCoin := sdk.NewCoin(bondDenom, unbondAmount) sdkMsg := &stakingtypes.MsgUndelegate{ DelegatorAddress: msg.DelegatorAddress, @@ -227,14 +232,12 @@ func (k msgServer) Undelegate(goCtx context.Context, msg *stakingtypes.MsgUndele k.keeper.SetMultiStakingUnlockEntry(ctx, types.MultiStakingUnlockID(msg.DelegatorAddress, msg.ValidatorAddress), multiStakingCoin) - return k.stakingMsgServer.Undelegate(sdk.WrapSDKContext(ctx), sdkMsg) + return k.stakingMsgServer.Undelegate(ctx, sdkMsg) } // CancelUnbondingDelegation defines a method for canceling the unbonding delegation // and delegate back to the validator. -func (k msgServer) CancelUnbondingDelegation(goCtx context.Context, msg *stakingtypes.MsgCancelUnbondingDelegation) (*stakingtypes.MsgCancelUnbondingDelegationResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - +func (k msgServer) CancelUnbondingDelegation(ctx context.Context, msg *stakingtypes.MsgCancelUnbondingDelegation) (*stakingtypes.MsgCancelUnbondingDelegationResponse, error) { delAcc, valAcc, err := types.AccAddrAndValAddrFromStrings(msg.DelegatorAddress, msg.ValidatorAddress) if err != nil { return nil, err @@ -255,7 +258,12 @@ func (k msgServer) CancelUnbondingDelegation(goCtx context.Context, msg *staking if err != nil { return nil, err } - cancelUnbondingCoin := sdk.NewCoin(k.keeper.stakingKeeper.BondDenom(ctx), cancelUnbondingAmount) + + bondDenom, err := k.keeper.stakingKeeper.BondDenom(ctx) + if err != nil { + return nil, err + } + cancelUnbondingCoin := sdk.NewCoin(bondDenom, cancelUnbondingAmount) lockID := types.MultiStakingLockID(msg.DelegatorAddress, msg.ValidatorAddress) lock := k.keeper.GetOrCreateMultiStakingLock(ctx, lockID) @@ -272,5 +280,5 @@ func (k msgServer) CancelUnbondingDelegation(goCtx context.Context, msg *staking CreationHeight: msg.CreationHeight, } - return k.stakingMsgServer.CancelUnbondingDelegation(sdk.WrapSDKContext(ctx), sdkMsg) + return k.stakingMsgServer.CancelUnbondingDelegation(ctx, sdkMsg) } diff --git a/x/multi-staking/keeper/msg_server_test.go b/x/multi-staking/keeper/msg_server_test.go index 46f18317..6f607142 100644 --- a/x/multi-staking/keeper/msg_server_test.go +++ b/x/multi-staking/keeper/msg_server_test.go @@ -11,6 +11,7 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" + authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" @@ -22,7 +23,6 @@ var ( ) func (suite *KeeperTestSuite) TestCreateValidator() { - delAddr := test.GenAddress() valPubKey := test.GenPubKey() valAddr := sdk.ValAddress(valPubKey.Address()) @@ -35,8 +35,8 @@ func (suite *KeeperTestSuite) TestCreateValidator() { { name: "3001 token, weight 0.3, expect 900", malleate: func(ctx sdk.Context, msKeeper *multistakingkeeper.Keeper, msgServer stakingtypes.MsgServer) (sdk.Coin, error) { - msKeeper.SetBondWeight(ctx, MultiStakingDenomA, sdk.MustNewDecFromStr("0.3")) - bondAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(3001)) + msKeeper.SetBondWeight(ctx, MultiStakingDenomA, math.LegacyMustNewDecFromStr("0.3")) + bondAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(3001)) msg := stakingtypes.MsgCreateValidator{ Description: stakingtypes.Description{ Moniker: "test", @@ -46,12 +46,12 @@ func (suite *KeeperTestSuite) TestCreateValidator() { Details: "test", }, Commission: stakingtypes.CommissionRates{ - Rate: sdk.MustNewDecFromStr("0.05"), - MaxRate: sdk.MustNewDecFromStr("0.1"), - MaxChangeRate: sdk.MustNewDecFromStr("0.05"), + Rate: math.LegacyMustNewDecFromStr("0.05"), + MaxRate: math.LegacyMustNewDecFromStr("0.1"), + MaxChangeRate: math.LegacyMustNewDecFromStr("0.05"), }, - MinSelfDelegation: sdk.NewInt(1), - DelegatorAddress: delAddr.String(), + MinSelfDelegation: math.NewInt(1), + DelegatorAddress: sdk.AccAddress(valAddr).String(), ValidatorAddress: valAddr.String(), Pubkey: codectypes.UnsafePackAny(valPubKey), Value: bondAmount, @@ -60,14 +60,14 @@ func (suite *KeeperTestSuite) TestCreateValidator() { _, err := msgServer.CreateValidator(ctx, &msg) return bondAmount, err }, - expOut: sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(900)), + expOut: sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(900)), expErr: false, }, { name: "25 token, weight 0.5, expect 12", malleate: func(ctx sdk.Context, msKeeper *multistakingkeeper.Keeper, msgServer stakingtypes.MsgServer) (sdk.Coin, error) { - msKeeper.SetBondWeight(ctx, MultiStakingDenomB, sdk.MustNewDecFromStr("0.5")) - bondAmount := sdk.NewCoin(MultiStakingDenomB, sdk.NewInt(25)) + msKeeper.SetBondWeight(ctx, MultiStakingDenomB, math.LegacyMustNewDecFromStr("0.5")) + bondAmount := sdk.NewCoin(MultiStakingDenomB, math.NewInt(25)) msg := stakingtypes.MsgCreateValidator{ Description: stakingtypes.Description{ @@ -78,12 +78,12 @@ func (suite *KeeperTestSuite) TestCreateValidator() { Details: "test", }, Commission: stakingtypes.CommissionRates{ - Rate: sdk.MustNewDecFromStr("0.05"), - MaxRate: sdk.MustNewDecFromStr("0.1"), - MaxChangeRate: sdk.MustNewDecFromStr("0.05"), + Rate: math.LegacyMustNewDecFromStr("0.05"), + MaxRate: math.LegacyMustNewDecFromStr("0.1"), + MaxChangeRate: math.LegacyMustNewDecFromStr("0.05"), }, - MinSelfDelegation: sdk.NewInt(1), - DelegatorAddress: delAddr.String(), + MinSelfDelegation: math.NewInt(1), + DelegatorAddress: sdk.AccAddress(valAddr).String(), ValidatorAddress: valAddr.String(), Pubkey: codectypes.UnsafePackAny(valPubKey), Value: bondAmount, @@ -92,14 +92,14 @@ func (suite *KeeperTestSuite) TestCreateValidator() { _, err := msgServer.CreateValidator(ctx, &msg) return bondAmount, err }, - expOut: sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(12)), + expOut: sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(12)), expErr: false, }, { name: "invalid bond token", malleate: func(ctx sdk.Context, msKeeper *multistakingkeeper.Keeper, msgServer stakingtypes.MsgServer) (sdk.Coin, error) { msKeeper.RemoveBondWeight(ctx, MultiStakingDenomA) - bondAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(25)) + bondAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(25)) msg := stakingtypes.MsgCreateValidator{ Description: stakingtypes.Description{ @@ -110,12 +110,12 @@ func (suite *KeeperTestSuite) TestCreateValidator() { Details: "test", }, Commission: stakingtypes.CommissionRates{ - Rate: sdk.MustNewDecFromStr("0.05"), - MaxRate: sdk.MustNewDecFromStr("0.1"), - MaxChangeRate: sdk.MustNewDecFromStr("0.05"), + Rate: math.LegacyMustNewDecFromStr("0.05"), + MaxRate: math.LegacyMustNewDecFromStr("0.1"), + MaxChangeRate: math.LegacyMustNewDecFromStr("0.05"), }, - MinSelfDelegation: sdk.NewInt(1), - DelegatorAddress: delAddr.String(), + MinSelfDelegation: math.NewInt(1), + DelegatorAddress: sdk.AccAddress(valAddr).String(), ValidatorAddress: valAddr.String(), Pubkey: codectypes.UnsafePackAny(valPubKey), Value: bondAmount, @@ -123,26 +123,26 @@ func (suite *KeeperTestSuite) TestCreateValidator() { _, err := msgServer.CreateValidator(ctx, &msg) return bondAmount, err }, - expOut: sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(12)), + expOut: sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(12)), expErr: true, }, { name: "invalid validator address", malleate: func(ctx sdk.Context, msKeeper *multistakingkeeper.Keeper, msgServer stakingtypes.MsgServer) (sdk.Coin, error) { - msKeeper.SetBondWeight(ctx, MultiStakingDenomA, sdk.MustNewDecFromStr("0.3")) - bondAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(3001)) + msKeeper.SetBondWeight(ctx, MultiStakingDenomA, math.LegacyMustNewDecFromStr("0.3")) + bondAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(3001)) msg := stakingtypes.MsgCreateValidator{ Description: stakingtypes.Description{ Moniker: "NewValidator", }, Commission: stakingtypes.CommissionRates{ - Rate: sdk.MustNewDecFromStr("0.05"), - MaxRate: sdk.MustNewDecFromStr("0.1"), - MaxChangeRate: sdk.MustNewDecFromStr("0.05"), + Rate: math.LegacyMustNewDecFromStr("0.05"), + MaxRate: math.LegacyMustNewDecFromStr("0.1"), + MaxChangeRate: math.LegacyMustNewDecFromStr("0.05"), }, - MinSelfDelegation: sdk.NewInt(1), - DelegatorAddress: delAddr.String(), + MinSelfDelegation: math.NewInt(1), + DelegatorAddress: sdk.AccAddress(valAddr).String(), ValidatorAddress: sdk.AccAddress([]byte("invalid")).String(), Pubkey: codectypes.UnsafePackAny(valPubKey), Value: bondAmount, @@ -151,7 +151,7 @@ func (suite *KeeperTestSuite) TestCreateValidator() { _, err := msgServer.CreateValidator(ctx, &msg) return bondAmount, err }, - expOut: sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(12)), + expOut: sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(12)), expErr: true, }, } @@ -159,19 +159,19 @@ func (suite *KeeperTestSuite) TestCreateValidator() { for _, tc := range testCases { suite.Run(tc.name, func() { suite.SetupTest() - valCoins := sdk.NewCoins(sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(10000)), sdk.NewCoin(MultiStakingDenomB, sdk.NewInt(10000))) - suite.FundAccount(delAddr, valCoins) + valCoins := sdk.NewCoins(sdk.NewCoin(MultiStakingDenomA, math.NewInt(10000)), sdk.NewCoin(MultiStakingDenomB, math.NewInt(10000))) + suite.FundAccount(sdk.AccAddress(valAddr), valCoins) bondAmount, err := tc.malleate(suite.ctx, suite.msKeeper, suite.msgServer) if tc.expErr { suite.Require().Error(err) } else { suite.Require().NoError(err) - lockId := multistakingtypes.MultiStakingLockID(delAddr.String(), valAddr.String()) + lockId := multistakingtypes.MultiStakingLockID(sdk.AccAddress(valAddr).String(), valAddr.String()) lockRecord, found := suite.msKeeper.GetMultiStakingLock(suite.ctx, lockId) suite.Require().True(found) - actualBond, found := suite.app.StakingKeeper.GetDelegation(suite.ctx, delAddr, valAddr) - suite.Require().True(found) + actualBond, err := suite.app.StakingKeeper.GetDelegation(suite.ctx, sdk.AccAddress(valAddr), valAddr) + suite.Require().NoError(err) suite.Require().Equal(bondAmount.Amount, lockRecord.LockedCoin.Amount) suite.Require().Equal(tc.expOut.Amount, actualBond.Shares.TruncateInt()) } @@ -180,7 +180,6 @@ func (suite *KeeperTestSuite) TestCreateValidator() { } func (suite *KeeperTestSuite) TestEditValidator() { - delAddr := test.GenAddress() valPubKey := test.GenPubKey() valAddr := sdk.ValAddress(valPubKey.Address()) @@ -192,9 +191,9 @@ func (suite *KeeperTestSuite) TestEditValidator() { { name: "success", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer) (stakingtypes.MsgEditValidator, error) { - newRate := sdk.MustNewDecFromStr("0.03") - newMinSelfDelegation := sdk.NewInt(300) - editMsg := stakingtypes.NewMsgEditValidator(valAddr, stakingtypes.Description{ + newRate := math.LegacyMustNewDecFromStr("0.03") + newMinSelfDelegation := math.NewInt(300) + editMsg := stakingtypes.NewMsgEditValidator(valAddr.String(), stakingtypes.Description{ Moniker: "test 1", Identity: "test 1", Website: "test 1", @@ -212,9 +211,9 @@ func (suite *KeeperTestSuite) TestEditValidator() { { name: "not found validator", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer) (stakingtypes.MsgEditValidator, error) { - newRate := sdk.MustNewDecFromStr("0.03") - newMinSelfDelegation := sdk.NewInt(300) - editMsg := stakingtypes.NewMsgEditValidator(test.GenValAddress(), stakingtypes.Description{ + newRate := math.LegacyMustNewDecFromStr("0.03") + newMinSelfDelegation := math.NewInt(300) + editMsg := stakingtypes.NewMsgEditValidator(test.GenValAddress().String(), stakingtypes.Description{ Moniker: "test", Identity: "test", Website: "test", @@ -232,9 +231,9 @@ func (suite *KeeperTestSuite) TestEditValidator() { { name: "negative rate", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer) (stakingtypes.MsgEditValidator, error) { - newRate := sdk.MustNewDecFromStr("-0.01") - newMinSelfDelegation := sdk.NewInt(300) - editMsg := stakingtypes.NewMsgEditValidator(valAddr, stakingtypes.Description{ + newRate := math.LegacyMustNewDecFromStr("-0.01") + newMinSelfDelegation := math.NewInt(300) + editMsg := stakingtypes.NewMsgEditValidator(valAddr.String(), stakingtypes.Description{ Moniker: "test 1", Identity: "test 1", Website: "test 1", @@ -252,9 +251,9 @@ func (suite *KeeperTestSuite) TestEditValidator() { { name: "less than minimum rate", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer) (stakingtypes.MsgEditValidator, error) { - newRate := sdk.MustNewDecFromStr("0.01") - newMinSelfDelegation := sdk.NewInt(300) - editMsg := stakingtypes.NewMsgEditValidator(valAddr, stakingtypes.Description{ + newRate := math.LegacyMustNewDecFromStr("0.01") + newMinSelfDelegation := math.NewInt(300) + editMsg := stakingtypes.NewMsgEditValidator(valAddr.String(), stakingtypes.Description{ Moniker: "test 1", Identity: "test 1", Website: "test 1", @@ -272,9 +271,9 @@ func (suite *KeeperTestSuite) TestEditValidator() { { name: "more than max rate", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer) (stakingtypes.MsgEditValidator, error) { - newRate := sdk.MustNewDecFromStr("0.11") - newMinSelfDelegation := sdk.NewInt(300) - editMsg := stakingtypes.NewMsgEditValidator(valAddr, stakingtypes.Description{ + newRate := math.LegacyMustNewDecFromStr("0.11") + newMinSelfDelegation := math.NewInt(300) + editMsg := stakingtypes.NewMsgEditValidator(valAddr.String(), stakingtypes.Description{ Moniker: "test 1", Identity: "test 1", Website: "test 1", @@ -292,9 +291,9 @@ func (suite *KeeperTestSuite) TestEditValidator() { { name: "min self delegation more than validator tokens", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer) (stakingtypes.MsgEditValidator, error) { - newRate := sdk.MustNewDecFromStr("0.03") - newMinSelfDelegation := sdk.NewInt(10000) - editMsg := stakingtypes.NewMsgEditValidator(valAddr, stakingtypes.Description{ + newRate := math.LegacyMustNewDecFromStr("0.03") + newMinSelfDelegation := math.NewInt(10000) + editMsg := stakingtypes.NewMsgEditValidator(valAddr.String(), stakingtypes.Description{ Moniker: "test 1", Identity: "test 1", Website: "test 1", @@ -312,9 +311,9 @@ func (suite *KeeperTestSuite) TestEditValidator() { { name: "min self delegation more than old min delegation value", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer) (stakingtypes.MsgEditValidator, error) { - newRate := sdk.MustNewDecFromStr("0.03") - newMinSelfDelegation := sdk.NewInt(100) - editMsg := stakingtypes.NewMsgEditValidator(valAddr, stakingtypes.Description{ + newRate := math.LegacyMustNewDecFromStr("0.03") + newMinSelfDelegation := math.NewInt(100) + editMsg := stakingtypes.NewMsgEditValidator(valAddr.String(), stakingtypes.Description{ Moniker: "test 1", Identity: "test 1", Website: "test 1", @@ -336,12 +335,12 @@ func (suite *KeeperTestSuite) TestEditValidator() { suite.Run(tc.name, func() { suite.SetupTest() newParam := stakingtypes.DefaultParams() - newParam.MinCommissionRate = sdk.MustNewDecFromStr("0.02") + newParam.MinCommissionRate = math.LegacyMustNewDecFromStr("0.02") err := suite.app.StakingKeeper.SetParams(suite.ctx, newParam) suite.Require().NoError(err) - suite.msKeeper.SetBondWeight(suite.ctx, MultiStakingDenomA, sdk.OneDec()) - bondAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(1000)) - suite.FundAccount(delAddr, sdk.NewCoins(bondAmount)) + suite.msKeeper.SetBondWeight(suite.ctx, MultiStakingDenomA, math.LegacyOneDec()) + bondAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(1000)) + suite.FundAccount(sdk.AccAddress(valAddr), sdk.NewCoins(bondAmount)) createMsg := stakingtypes.MsgCreateValidator{ Description: stakingtypes.Description{ @@ -352,12 +351,12 @@ func (suite *KeeperTestSuite) TestEditValidator() { Details: "test", }, Commission: stakingtypes.CommissionRates{ - Rate: sdk.MustNewDecFromStr("0.05"), - MaxRate: sdk.MustNewDecFromStr("0.1"), - MaxChangeRate: sdk.MustNewDecFromStr("0.05"), + Rate: math.LegacyMustNewDecFromStr("0.05"), + MaxRate: math.LegacyMustNewDecFromStr("0.1"), + MaxChangeRate: math.LegacyMustNewDecFromStr("0.05"), }, - MinSelfDelegation: sdk.NewInt(200), - DelegatorAddress: delAddr.String(), + MinSelfDelegation: math.NewInt(200), + DelegatorAddress: sdk.AccAddress(valAddr).String(), ValidatorAddress: valAddr.String(), Pubkey: codectypes.UnsafePackAny(valPubKey), Value: bondAmount, @@ -372,9 +371,11 @@ func (suite *KeeperTestSuite) TestEditValidator() { suite.Require().Error(err) } else { suite.Require().NoError(err) - validatorInfo, found := suite.app.StakingKeeper.GetValidator(suite.ctx, sdk.ValAddress(originMsg.ValidatorAddress)) - if found { - suite.Require().Equal(validatorInfo.Description, originMsg.Description) + valCodec := authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()) + msgValAddr, err := valCodec.StringToBytes(originMsg.ValidatorAddress) + suite.Require().NoError(err) + validatorInfo, err := suite.app.StakingKeeper.GetValidator(suite.ctx, msgValAddr) + if err != nil { suite.Require().Equal(validatorInfo.MinSelfDelegation, &originMsg.MinSelfDelegation) suite.Require().Equal(validatorInfo.Commission.CommissionRates.Rate, &originMsg.CommissionRate) } @@ -385,51 +386,50 @@ func (suite *KeeperTestSuite) TestEditValidator() { func (suite *KeeperTestSuite) TestDelegate() { delAddr := test.GenAddress() - valDelAddr := test.GenAddress() valPubKey := test.GenPubKey() valAddr := sdk.ValAddress(valPubKey.Address()) testCases := []struct { name string malleate func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) (sdk.Coin, error) - expRate sdk.Dec + expRate math.LegacyDec expErr bool }{ { name: "success and not change rate", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) (sdk.Coin, error) { - multiStakingAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(1000)) - delMsg := stakingtypes.NewMsgDelegate(delAddr, valAddr, multiStakingAmount) + multiStakingAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(1000)) + delMsg := stakingtypes.NewMsgDelegate(delAddr.String(), valAddr.String(), multiStakingAmount) _, err := msgServer.Delegate(ctx, delMsg) return multiStakingAmount, err }, - expRate: sdk.OneDec(), + expRate: math.LegacyOneDec(), expErr: false, }, { name: "rate change from 1 to 0.75 (1000 * 1 + 3000 * 0.5 = 4000 * 0.625)", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) (sdk.Coin, error) { - multiStakingAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(1000)) - delMsg := stakingtypes.NewMsgDelegate(delAddr, valAddr, multiStakingAmount) + multiStakingAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(1000)) + delMsg := stakingtypes.NewMsgDelegate(delAddr.String(), valAddr.String(), multiStakingAmount) _, err := msgServer.Delegate(ctx, delMsg) if err != nil { return multiStakingAmount, err } - msKeeper.SetBondWeight(ctx, MultiStakingDenomA, sdk.MustNewDecFromStr("0.5")) - multiStakingAmount1 := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(3000)) - delMsg1 := stakingtypes.NewMsgDelegate(delAddr, valAddr, multiStakingAmount1) + msKeeper.SetBondWeight(ctx, MultiStakingDenomA, math.LegacyMustNewDecFromStr("0.5")) + multiStakingAmount1 := sdk.NewCoin(MultiStakingDenomA, math.NewInt(3000)) + delMsg1 := stakingtypes.NewMsgDelegate(delAddr.String(), valAddr.String(), multiStakingAmount1) _, err = msgServer.Delegate(ctx, delMsg1) return multiStakingAmount.Add(multiStakingAmount1), err }, - expRate: sdk.MustNewDecFromStr("0.625"), + expRate: math.LegacyMustNewDecFromStr("0.625"), expErr: false, }, { name: "not found validator", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) (sdk.Coin, error) { - multiStakingAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(1000)) + multiStakingAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(1000)) - delMsg := stakingtypes.NewMsgDelegate(delAddr, test.GenValAddress(), multiStakingAmount) + delMsg := stakingtypes.NewMsgDelegate(delAddr.String(), test.GenValAddress().String(), multiStakingAmount) _, err := msgServer.Delegate(ctx, delMsg) return multiStakingAmount, err }, @@ -438,9 +438,9 @@ func (suite *KeeperTestSuite) TestDelegate() { { name: "not allow token", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) (sdk.Coin, error) { - multiStakingAmount := sdk.NewCoin(MultiStakingDenomB, sdk.NewInt(1000)) + multiStakingAmount := sdk.NewCoin(MultiStakingDenomB, math.NewInt(1000)) - delMsg := stakingtypes.NewMsgDelegate(delAddr, valAddr, multiStakingAmount) + delMsg := stakingtypes.NewMsgDelegate(delAddr.String(), valAddr.String(), multiStakingAmount) _, err := msgServer.Delegate(ctx, delMsg) return multiStakingAmount, err }, @@ -453,14 +453,14 @@ func (suite *KeeperTestSuite) TestDelegate() { suite.Run(tc.name, func() { suite.SetupTest() newParam := stakingtypes.DefaultParams() - newParam.MinCommissionRate = sdk.MustNewDecFromStr("0.02") + newParam.MinCommissionRate = math.LegacyMustNewDecFromStr("0.02") err := suite.app.StakingKeeper.SetParams(suite.ctx, newParam) suite.Require().NoError(err) - suite.msKeeper.SetBondWeight(suite.ctx, MultiStakingDenomA, sdk.OneDec()) - bondAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(1000)) - userBalance := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(10000)) + suite.msKeeper.SetBondWeight(suite.ctx, MultiStakingDenomA, math.LegacyOneDec()) + bondAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(1000)) + userBalance := sdk.NewCoin(MultiStakingDenomA, math.NewInt(10000)) suite.FundAccount(delAddr, sdk.NewCoins(userBalance)) - suite.FundAccount(valDelAddr, sdk.NewCoins(userBalance)) + suite.FundAccount(sdk.AccAddress(valAddr), sdk.NewCoins(userBalance)) createMsg := stakingtypes.MsgCreateValidator{ Description: stakingtypes.Description{ @@ -471,12 +471,12 @@ func (suite *KeeperTestSuite) TestDelegate() { Details: "test", }, Commission: stakingtypes.CommissionRates{ - Rate: sdk.MustNewDecFromStr("0.05"), - MaxRate: sdk.MustNewDecFromStr("0.1"), - MaxChangeRate: sdk.MustNewDecFromStr("0.05"), + Rate: math.LegacyMustNewDecFromStr("0.05"), + MaxRate: math.LegacyMustNewDecFromStr("0.1"), + MaxChangeRate: math.LegacyMustNewDecFromStr("0.05"), }, - MinSelfDelegation: sdk.NewInt(200), - DelegatorAddress: valDelAddr.String(), + MinSelfDelegation: math.NewInt(200), + DelegatorAddress: sdk.AccAddress(valAddr).String(), ValidatorAddress: valAddr.String(), Pubkey: codectypes.UnsafePackAny(valPubKey), Value: bondAmount, @@ -495,10 +495,10 @@ func (suite *KeeperTestSuite) TestDelegate() { suite.Require().True(found) suite.Require().Equal(tc.expRate, lockRecord.GetBondWeight()) - delegation, found := suite.app.StakingKeeper.GetDelegation(suite.ctx, delAddr, valAddr) - suite.Require().True(found) - validator, found := suite.app.StakingKeeper.GetValidator(suite.ctx, valAddr) - suite.Require().True(found) + delegation, err := suite.app.StakingKeeper.GetDelegation(suite.ctx, delAddr, valAddr) + suite.Require().NoError(err) + validator, err := suite.app.StakingKeeper.GetValidator(suite.ctx, valAddr) + suite.Require().NoError(err) multiStakingCoin := multistakingtypes.NewMultiStakingCoin(multiStakingAmount.Denom, multiStakingAmount.Amount, tc.expRate) expShares, err := validator.SharesFromTokens(multiStakingCoin.BondValue()) @@ -511,7 +511,6 @@ func (suite *KeeperTestSuite) TestDelegate() { func (suite *KeeperTestSuite) TestBeginRedelegate() { delAddr := test.GenAddress() - valDelAddr := test.GenAddress() valPubKey1 := test.GenPubKey() valPubKey2 := test.GenPubKey() @@ -521,48 +520,48 @@ func (suite *KeeperTestSuite) TestBeginRedelegate() { testCases := []struct { name string malleate func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) ([]sdk.Coin, error) - expRate []sdk.Dec + expRate []math.LegacyDec expLock []math.Int expErr bool }{ { name: "redelegate from val1 to val2", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) ([]sdk.Coin, error) { - multiStakingAmount1 := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(1000)) - delMsg := stakingtypes.NewMsgDelegate(delAddr, valAddr1, multiStakingAmount1) + multiStakingAmount1 := sdk.NewCoin(MultiStakingDenomA, math.NewInt(1000)) + delMsg := stakingtypes.NewMsgDelegate(delAddr.String(), valAddr1.String(), multiStakingAmount1) _, err := msgServer.Delegate(ctx, delMsg) suite.Require().NoError(err) - multiStakingAmount2 := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(500)) - redelegateMsg := stakingtypes.NewMsgBeginRedelegate(delAddr, valAddr1, valAddr2, multiStakingAmount2) + multiStakingAmount2 := sdk.NewCoin(MultiStakingDenomA, math.NewInt(500)) + redelegateMsg := stakingtypes.NewMsgBeginRedelegate(delAddr.String(), valAddr1.String(), valAddr2.String(), multiStakingAmount2) _, err = msgServer.BeginRedelegate(ctx, redelegateMsg) return []sdk.Coin{multiStakingAmount1.Sub(multiStakingAmount2), multiStakingAmount2}, err }, - expRate: []sdk.Dec{sdk.OneDec(), sdk.OneDec()}, - expLock: []math.Int{sdk.NewInt(500), sdk.NewInt(500)}, + expRate: []math.LegacyDec{math.LegacyOneDec(), math.LegacyOneDec()}, + expLock: []math.Int{math.NewInt(500), math.NewInt(500)}, expErr: false, }, { name: "delegate 2000 more to val1 then change rate and redelegate 600 to val2", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) ([]sdk.Coin, error) { - multiStakingAmount1 := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(1000)) - delMsg1 := stakingtypes.NewMsgDelegate(delAddr, valAddr1, multiStakingAmount1) + multiStakingAmount1 := sdk.NewCoin(MultiStakingDenomA, math.NewInt(1000)) + delMsg1 := stakingtypes.NewMsgDelegate(delAddr.String(), valAddr1.String(), multiStakingAmount1) _, err := msgServer.Delegate(ctx, delMsg1) suite.Require().NoError(err) - multiStakingAmount2 := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(1000)) - delMsg3 := stakingtypes.NewMsgDelegate(delAddr, valAddr2, multiStakingAmount2) + multiStakingAmount2 := sdk.NewCoin(MultiStakingDenomA, math.NewInt(1000)) + delMsg3 := stakingtypes.NewMsgDelegate(delAddr.String(), valAddr2.String(), multiStakingAmount2) _, err = msgServer.Delegate(ctx, delMsg3) suite.Require().NoError(err) - msKeeper.SetBondWeight(ctx, MultiStakingDenomA, sdk.MustNewDecFromStr("0.25")) - multiStakingAmount3 := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(2000)) - delMsg2 := stakingtypes.NewMsgDelegate(delAddr, valAddr1, multiStakingAmount3) + msKeeper.SetBondWeight(ctx, MultiStakingDenomA, math.LegacyMustNewDecFromStr("0.25")) + multiStakingAmount3 := sdk.NewCoin(MultiStakingDenomA, math.NewInt(2000)) + delMsg2 := stakingtypes.NewMsgDelegate(delAddr.String(), valAddr1.String(), multiStakingAmount3) _, err = msgServer.Delegate(ctx, delMsg2) suite.Require().NoError(err) - multiStakingAmount4 := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(600)) - redelMsg := stakingtypes.NewMsgBeginRedelegate(delAddr, valAddr1, valAddr2, multiStakingAmount4) + multiStakingAmount4 := sdk.NewCoin(MultiStakingDenomA, math.NewInt(600)) + redelMsg := stakingtypes.NewMsgBeginRedelegate(delAddr.String(), valAddr1.String(), valAddr2.String(), multiStakingAmount4) if err != nil { return []sdk.Coin{}, err } @@ -570,15 +569,15 @@ func (suite *KeeperTestSuite) TestBeginRedelegate() { _, err = msgServer.BeginRedelegate(ctx, redelMsg) return []sdk.Coin{multiStakingAmount1.Add(multiStakingAmount3).Sub(multiStakingAmount4), multiStakingAmount2.Add(multiStakingAmount4)}, err }, - expRate: []sdk.Dec{sdk.MustNewDecFromStr("0.5"), sdk.MustNewDecFromStr("0.8125")}, - expLock: []math.Int{sdk.NewInt(2400), sdk.NewInt(1600)}, + expRate: []math.LegacyDec{math.LegacyMustNewDecFromStr("0.5"), math.LegacyMustNewDecFromStr("0.8125")}, + expLock: []math.Int{math.NewInt(2400), math.NewInt(1600)}, expErr: false, }, { name: "not found validator", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) ([]sdk.Coin, error) { - bondAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(500)) - multiStakingMsg := stakingtypes.NewMsgBeginRedelegate(delAddr, valAddr1, test.GenValAddress(), bondAmount) + bondAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(500)) + multiStakingMsg := stakingtypes.NewMsgBeginRedelegate(delAddr.String(), valAddr1.String(), test.GenValAddress().String(), bondAmount) _, err := msgServer.BeginRedelegate(ctx, multiStakingMsg) return []sdk.Coin{}, err }, @@ -587,9 +586,9 @@ func (suite *KeeperTestSuite) TestBeginRedelegate() { { name: "not allow token", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) ([]sdk.Coin, error) { - bondAmount := sdk.NewCoin(MultiStakingDenomB, sdk.NewInt(1000)) + bondAmount := sdk.NewCoin(MultiStakingDenomB, math.NewInt(1000)) - multiStakingMsg := stakingtypes.NewMsgBeginRedelegate(delAddr, valAddr1, valAddr2, bondAmount) + multiStakingMsg := stakingtypes.NewMsgBeginRedelegate(delAddr.String(), valAddr1.String(), valAddr2.String(), bondAmount) _, err := msgServer.BeginRedelegate(ctx, multiStakingMsg) return []sdk.Coin{}, err }, @@ -599,17 +598,20 @@ func (suite *KeeperTestSuite) TestBeginRedelegate() { name: "setup val3 with bond denom is arst then redelgate from val1 to val3", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) ([]sdk.Coin, error) { valPubKey3 := test.GenPubKey() - bondAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(500)) + bondAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(500)) valAddr3 := sdk.ValAddress(valPubKey3.Address()) - createMsg := stakingtypes.MsgCreateValidator{Description: stakingtypes.Description{Moniker: "test", Identity: "test", Website: "test", SecurityContact: "test", Details: "test"}, Commission: stakingtypes.CommissionRates{Rate: sdk.MustNewDecFromStr("0.05"), MaxRate: sdk.MustNewDecFromStr("0.1"), MaxChangeRate: sdk.MustNewDecFromStr("0.1")}, MinSelfDelegation: sdk.NewInt(200), DelegatorAddress: delAddr.String(), ValidatorAddress: valAddr3.String(), Pubkey: codectypes.UnsafePackAny(valPubKey3), Value: sdk.NewCoin(MultiStakingDenomB, sdk.NewInt(1000))} + + userBalance := sdk.NewCoin(MultiStakingDenomA, math.NewInt(10000)) + suite.FundAccount(sdk.AccAddress(valAddr3), sdk.NewCoins(userBalance, sdk.NewCoin(MultiStakingDenomB, math.NewInt(10000)))) + createMsg := stakingtypes.MsgCreateValidator{Description: stakingtypes.Description{Moniker: "test", Identity: "test", Website: "test", SecurityContact: "test", Details: "test"}, Commission: stakingtypes.CommissionRates{Rate: math.LegacyMustNewDecFromStr("0.05"), MaxRate: math.LegacyMustNewDecFromStr("0.1"), MaxChangeRate: math.LegacyMustNewDecFromStr("0.1")}, MinSelfDelegation: math.NewInt(200), DelegatorAddress: sdk.AccAddress(valAddr3).String(), ValidatorAddress: valAddr3.String(), Pubkey: codectypes.UnsafePackAny(valPubKey3), Value: sdk.NewCoin(MultiStakingDenomB, math.NewInt(1000))} _, err := msgServer.CreateValidator(suite.ctx, &createMsg) suite.Require().NoError(err) - multiStakingMsg := stakingtypes.NewMsgBeginRedelegate(delAddr, valAddr1, valAddr3, bondAmount) + multiStakingMsg := stakingtypes.NewMsgBeginRedelegate(delAddr.String(), valAddr1.String(), valAddr3.String(), bondAmount) _, err = msgServer.BeginRedelegate(ctx, multiStakingMsg) return []sdk.Coin{}, err }, - expRate: []sdk.Dec{}, + expRate: []math.LegacyDec{}, expLock: []math.Int{}, expErr: true, }, @@ -620,16 +622,17 @@ func (suite *KeeperTestSuite) TestBeginRedelegate() { suite.Run(tc.name, func() { suite.SetupTest() newParam := stakingtypes.DefaultParams() - newParam.MinCommissionRate = sdk.MustNewDecFromStr("0.02") + newParam.MinCommissionRate = math.LegacyMustNewDecFromStr("0.02") err := suite.app.StakingKeeper.SetParams(suite.ctx, newParam) suite.Require().NoError(err) - suite.msKeeper.SetBondWeight(suite.ctx, MultiStakingDenomA, sdk.OneDec()) - suite.msKeeper.SetBondWeight(suite.ctx, MultiStakingDenomB, sdk.OneDec()) + suite.msKeeper.SetBondWeight(suite.ctx, MultiStakingDenomA, math.LegacyOneDec()) + suite.msKeeper.SetBondWeight(suite.ctx, MultiStakingDenomB, math.LegacyOneDec()) - bondAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(1000)) - userBalance := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(10000)) - suite.FundAccount(delAddr, sdk.NewCoins(userBalance, sdk.NewCoin(MultiStakingDenomB, sdk.NewInt(10000)))) - suite.FundAccount(valDelAddr, sdk.NewCoins(userBalance, sdk.NewCoin(MultiStakingDenomB, sdk.NewInt(10000)))) + bondAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(1000)) + userBalance := sdk.NewCoin(MultiStakingDenomA, math.NewInt(10000)) + suite.FundAccount(delAddr, sdk.NewCoins(userBalance, sdk.NewCoin(MultiStakingDenomB, math.NewInt(10000)))) + suite.FundAccount(sdk.AccAddress(valAddr1), sdk.NewCoins(userBalance, sdk.NewCoin(MultiStakingDenomB, math.NewInt(10000)))) + suite.FundAccount(sdk.AccAddress(valAddr2), sdk.NewCoins(userBalance, sdk.NewCoin(MultiStakingDenomB, math.NewInt(10000)))) createMsg := stakingtypes.MsgCreateValidator{ Description: stakingtypes.Description{ @@ -640,12 +643,12 @@ func (suite *KeeperTestSuite) TestBeginRedelegate() { Details: "test", }, Commission: stakingtypes.CommissionRates{ - Rate: sdk.MustNewDecFromStr("0.05"), - MaxRate: sdk.MustNewDecFromStr("0.1"), - MaxChangeRate: sdk.MustNewDecFromStr("0.05"), + Rate: math.LegacyMustNewDecFromStr("0.05"), + MaxRate: math.LegacyMustNewDecFromStr("0.1"), + MaxChangeRate: math.LegacyMustNewDecFromStr("0.05"), }, - MinSelfDelegation: sdk.NewInt(200), - DelegatorAddress: valDelAddr.String(), + MinSelfDelegation: math.NewInt(200), + DelegatorAddress: sdk.AccAddress(valAddr1).String(), ValidatorAddress: valAddr1.String(), Pubkey: codectypes.UnsafePackAny(valPubKey1), Value: bondAmount, @@ -659,12 +662,12 @@ func (suite *KeeperTestSuite) TestBeginRedelegate() { Details: "test", }, Commission: stakingtypes.CommissionRates{ - Rate: sdk.MustNewDecFromStr("0.05"), - MaxRate: sdk.MustNewDecFromStr("0.1"), - MaxChangeRate: sdk.MustNewDecFromStr("0.1"), + Rate: math.LegacyMustNewDecFromStr("0.05"), + MaxRate: math.LegacyMustNewDecFromStr("0.1"), + MaxChangeRate: math.LegacyMustNewDecFromStr("0.1"), }, - MinSelfDelegation: sdk.NewInt(200), - DelegatorAddress: valDelAddr.String(), + MinSelfDelegation: math.NewInt(200), + DelegatorAddress: sdk.AccAddress(valAddr2).String(), ValidatorAddress: valAddr2.String(), Pubkey: codectypes.UnsafePackAny(valPubKey2), Value: bondAmount, @@ -689,10 +692,10 @@ func (suite *KeeperTestSuite) TestBeginRedelegate() { suite.Require().Equal(tc.expRate[0], lockRecord1.GetBondWeight()) suite.Require().Equal(tc.expLock[0], lockRecord1.LockedCoin.Amount) - delegation1, found := suite.app.StakingKeeper.GetDelegation(suite.ctx, delAddr, valAddr1) - suite.Require().True(found) - validator1, found := suite.app.StakingKeeper.GetValidator(suite.ctx, valAddr1) - suite.Require().True(found) + delegation1, err := suite.app.StakingKeeper.GetDelegation(suite.ctx, delAddr, valAddr1) + suite.Require().NoError(err) + validator1, err := suite.app.StakingKeeper.GetValidator(suite.ctx, valAddr1) + suite.Require().NoError(err) multiStakingCoin1 := multistakingtypes.NewMultiStakingCoin(multiStakingAmounts[0].Denom, multiStakingAmounts[0].Amount, tc.expRate[0]) expShares1, err := validator1.SharesFromTokens(multiStakingCoin1.BondValue()) @@ -705,10 +708,10 @@ func (suite *KeeperTestSuite) TestBeginRedelegate() { suite.Require().Equal(tc.expRate[1], lockRecord2.GetBondWeight()) suite.Require().Equal(tc.expLock[1], lockRecord2.LockedCoin.Amount) - delegation2, found := suite.app.StakingKeeper.GetDelegation(suite.ctx, delAddr, valAddr2) - suite.Require().True(found) - validator2, found := suite.app.StakingKeeper.GetValidator(suite.ctx, valAddr2) - suite.Require().True(found) + delegation2, err := suite.app.StakingKeeper.GetDelegation(suite.ctx, delAddr, valAddr2) + suite.Require().NoError(err) + validator2, err := suite.app.StakingKeeper.GetValidator(suite.ctx, valAddr2) + suite.Require().NoError(err) multiStakingCoin2 := multistakingtypes.NewMultiStakingCoin(multiStakingAmounts[1].Denom, multiStakingAmounts[1].Amount, tc.expRate[1]) expShares2, err := validator2.SharesFromTokens(multiStakingCoin2.BondValue()) @@ -734,38 +737,38 @@ func (suite *KeeperTestSuite) TestUndelegate() { { name: "undelegate success", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) error { - undelegateAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(500)) - multiStakingMsg := stakingtypes.NewMsgUndelegate(delAddr, valAddr, undelegateAmount) + undelegateAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(500)) + multiStakingMsg := stakingtypes.NewMsgUndelegate(delAddr.String(), valAddr.String(), undelegateAmount) _, err := msgServer.Undelegate(ctx, multiStakingMsg) return err }, - expUnlock: sdk.NewInt(500), - expLock: sdk.NewInt(500), + expUnlock: math.NewInt(500), + expLock: math.NewInt(500), expErr: false, }, { name: "undelegate 250 then undelegate 500", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) error { - undelegateAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(250)) - multiStakingMsg := stakingtypes.NewMsgUndelegate(delAddr, valAddr, undelegateAmount) + undelegateAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(250)) + multiStakingMsg := stakingtypes.NewMsgUndelegate(delAddr.String(), valAddr.String(), undelegateAmount) _, err := msgServer.Undelegate(ctx, multiStakingMsg) if err != nil { return err } - undelegateAmount1 := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(500)) - multiStakingMsg1 := stakingtypes.NewMsgUndelegate(delAddr, valAddr, undelegateAmount1) + undelegateAmount1 := sdk.NewCoin(MultiStakingDenomA, math.NewInt(500)) + multiStakingMsg1 := stakingtypes.NewMsgUndelegate(delAddr.String(), valAddr.String(), undelegateAmount1) _, err = msgServer.Undelegate(ctx, multiStakingMsg1) return err }, - expUnlock: sdk.NewInt(750), - expLock: sdk.NewInt(250), + expUnlock: math.NewInt(750), + expLock: math.NewInt(250), expErr: false, }, { name: "not found validator", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) error { - undelegateAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(500)) - multiStakingMsg := stakingtypes.NewMsgUndelegate(delAddr, test.GenValAddress(), undelegateAmount) + undelegateAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(500)) + multiStakingMsg := stakingtypes.NewMsgUndelegate(delAddr.String(), test.GenValAddress().String(), undelegateAmount) _, err := msgServer.Undelegate(ctx, multiStakingMsg) return err }, @@ -774,9 +777,9 @@ func (suite *KeeperTestSuite) TestUndelegate() { { name: "not allow token", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) error { - undelegateAmount := sdk.NewCoin(MultiStakingDenomB, sdk.NewInt(1000)) + undelegateAmount := sdk.NewCoin(MultiStakingDenomB, math.NewInt(1000)) - multiStakingMsg := stakingtypes.NewMsgUndelegate(delAddr, test.GenValAddress(), undelegateAmount) + multiStakingMsg := stakingtypes.NewMsgUndelegate(delAddr.String(), test.GenValAddress().String(), undelegateAmount) _, err := msgServer.Undelegate(ctx, multiStakingMsg) return err }, @@ -789,15 +792,16 @@ func (suite *KeeperTestSuite) TestUndelegate() { suite.Run(tc.name, func() { suite.SetupTest() newParam := stakingtypes.DefaultParams() - newParam.MinCommissionRate = sdk.MustNewDecFromStr("0.02") + newParam.MinCommissionRate = math.LegacyMustNewDecFromStr("0.02") err := suite.app.StakingKeeper.SetParams(suite.ctx, newParam) suite.Require().NoError(err) - initialWeight := sdk.MustNewDecFromStr("0.5") + initialWeight := math.LegacyMustNewDecFromStr("0.5") suite.msKeeper.SetBondWeight(suite.ctx, MultiStakingDenomA, initialWeight) - bondAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(1000)) - userBalance := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(10000)) - suite.FundAccount(delAddr, sdk.NewCoins(userBalance, sdk.NewCoin(MultiStakingDenomB, sdk.NewInt(10000)))) + bondAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(1000)) + userBalance := sdk.NewCoin(MultiStakingDenomA, math.NewInt(10000)) + suite.FundAccount(delAddr, sdk.NewCoins(userBalance, sdk.NewCoin(MultiStakingDenomB, math.NewInt(10000)))) + suite.FundAccount(sdk.AccAddress(valAddr), sdk.NewCoins(userBalance, sdk.NewCoin(MultiStakingDenomB, math.NewInt(10000)))) createMsg := stakingtypes.MsgCreateValidator{ Description: stakingtypes.Description{ @@ -808,12 +812,12 @@ func (suite *KeeperTestSuite) TestUndelegate() { Details: "test", }, Commission: stakingtypes.CommissionRates{ - Rate: sdk.MustNewDecFromStr("0.05"), - MaxRate: sdk.MustNewDecFromStr("0.1"), - MaxChangeRate: sdk.MustNewDecFromStr("0.05"), + Rate: math.LegacyMustNewDecFromStr("0.05"), + MaxRate: math.LegacyMustNewDecFromStr("0.1"), + MaxChangeRate: math.LegacyMustNewDecFromStr("0.05"), }, - MinSelfDelegation: sdk.NewInt(200), - DelegatorAddress: delAddr.String(), + MinSelfDelegation: math.NewInt(200), + DelegatorAddress: sdk.AccAddress(valAddr).String(), ValidatorAddress: valAddr.String(), Pubkey: codectypes.UnsafePackAny(valPubKey), Value: bondAmount, @@ -822,6 +826,10 @@ func (suite *KeeperTestSuite) TestUndelegate() { _, err = suite.msgServer.CreateValidator(suite.ctx, &createMsg) suite.Require().NoError(err) + delMsg := stakingtypes.NewMsgDelegate(delAddr.String(), valAddr.String(), bondAmount) + _, err = suite.msgServer.Delegate(suite.ctx, delMsg) + suite.Require().NoError(err) + suite.ctx = suite.ctx.WithBlockHeader(tmproto.Header{Time: time.Now()}) curHeight := suite.ctx.BlockHeight() err = tc.malleate(suite.ctx, suite.msgServer, *suite.msKeeper) @@ -835,10 +843,10 @@ func (suite *KeeperTestSuite) TestUndelegate() { suite.Require().True(found) suite.Require().Equal(tc.expLock, lockRecord.LockedCoin.Amount) - delegation, found := suite.app.StakingKeeper.GetDelegation(suite.ctx, delAddr, valAddr) - suite.Require().True(found) - validator, found := suite.app.StakingKeeper.GetValidator(suite.ctx, valAddr) - suite.Require().True(found) + delegation, err := suite.app.StakingKeeper.GetDelegation(suite.ctx, delAddr, valAddr) + suite.Require().NoError(err) + validator, err := suite.app.StakingKeeper.GetValidator(suite.ctx, valAddr) + suite.Require().NoError(err) multiStakingCoin := multistakingtypes.NewMultiStakingCoin(MultiStakingDenomA, tc.expLock, initialWeight) expShares, err := validator.SharesFromTokens(multiStakingCoin.BondValue()) @@ -850,8 +858,8 @@ func (suite *KeeperTestSuite) TestUndelegate() { suite.Require().True(found) suite.Require().Equal(tc.expUnlock, unbondRecord.Entries[0].UnlockingCoin.Amount) - ubd, found := suite.app.StakingKeeper.GetUnbondingDelegation(suite.ctx, delAddr, valAddr) - suite.Require().True(found) + ubd, err := suite.app.StakingKeeper.GetUnbondingDelegation(suite.ctx, delAddr, valAddr) + suite.Require().NoError(err) unlockStakingCoin := multistakingtypes.NewMultiStakingCoin(MultiStakingDenomA, tc.expUnlock, initialWeight) totalUBDAmount := math.ZeroInt() @@ -881,38 +889,38 @@ func (suite *KeeperTestSuite) TestCancelUnbondingDelegation() { { name: "cancel unbonding success", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) error { - cancelAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(500)) - multiStakingMsg := stakingtypes.NewMsgCancelUnbondingDelegation(delAddr, valAddr, ctx.BlockHeight(), cancelAmount) + cancelAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(500)) + multiStakingMsg := stakingtypes.NewMsgCancelUnbondingDelegation(delAddr.String(), valAddr.String(), ctx.BlockHeight(), cancelAmount) _, err := msgServer.CancelUnbondingDelegation(ctx, multiStakingMsg) return err }, - expUnlock: sdk.NewInt(500), - expLock: sdk.NewInt(1500), + expUnlock: math.NewInt(500), + expLock: math.NewInt(1500), expErr: false, }, { name: "cancel unbonding 250 then cancel unbonding 500", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) error { - cancelAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(250)) - multiStakingMsg := stakingtypes.NewMsgCancelUnbondingDelegation(delAddr, valAddr, ctx.BlockHeight(), cancelAmount) + cancelAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(250)) + multiStakingMsg := stakingtypes.NewMsgCancelUnbondingDelegation(delAddr.String(), valAddr.String(), ctx.BlockHeight(), cancelAmount) _, err := msgServer.CancelUnbondingDelegation(ctx, multiStakingMsg) if err != nil { return err } - cancelAmount1 := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(500)) - multiStakingMsg1 := stakingtypes.NewMsgCancelUnbondingDelegation(delAddr, valAddr, ctx.BlockHeight(), cancelAmount1) + cancelAmount1 := sdk.NewCoin(MultiStakingDenomA, math.NewInt(500)) + multiStakingMsg1 := stakingtypes.NewMsgCancelUnbondingDelegation(delAddr.String(), valAddr.String(), ctx.BlockHeight(), cancelAmount1) _, err = msgServer.CancelUnbondingDelegation(ctx, multiStakingMsg1) return err }, - expUnlock: sdk.NewInt(250), - expLock: sdk.NewInt(1750), + expUnlock: math.NewInt(250), + expLock: math.NewInt(1750), expErr: false, }, { name: "not found validator", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) error { - cancelAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(500)) - multiStakingMsg := stakingtypes.NewMsgCancelUnbondingDelegation(delAddr, test.GenValAddress(), ctx.BlockHeight(), cancelAmount) + cancelAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(500)) + multiStakingMsg := stakingtypes.NewMsgCancelUnbondingDelegation(delAddr.String(), test.GenValAddress().String(), ctx.BlockHeight(), cancelAmount) _, err := msgServer.CancelUnbondingDelegation(ctx, multiStakingMsg) return err }, @@ -921,9 +929,9 @@ func (suite *KeeperTestSuite) TestCancelUnbondingDelegation() { { name: "not allow token", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) error { - cancelAmount := sdk.NewCoin(MultiStakingDenomB, sdk.NewInt(1000)) + cancelAmount := sdk.NewCoin(MultiStakingDenomB, math.NewInt(1000)) - multiStakingMsg := stakingtypes.NewMsgCancelUnbondingDelegation(delAddr, valAddr, ctx.BlockHeight(), cancelAmount) + multiStakingMsg := stakingtypes.NewMsgCancelUnbondingDelegation(delAddr.String(), valAddr.String(), ctx.BlockHeight(), cancelAmount) _, err := msgServer.CancelUnbondingDelegation(ctx, multiStakingMsg) return err }, @@ -932,8 +940,8 @@ func (suite *KeeperTestSuite) TestCancelUnbondingDelegation() { { name: "not found entry at height 20", malleate: func(ctx sdk.Context, msgServer stakingtypes.MsgServer, msKeeper multistakingkeeper.Keeper) error { - cancelAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(500)) - multiStakingMsg := stakingtypes.NewMsgCancelUnbondingDelegation(delAddr, valAddr, 20, cancelAmount) + cancelAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(500)) + multiStakingMsg := stakingtypes.NewMsgCancelUnbondingDelegation(delAddr.String(), valAddr.String(), 20, cancelAmount) _, err := msgServer.CancelUnbondingDelegation(ctx, multiStakingMsg) return err }, @@ -946,15 +954,16 @@ func (suite *KeeperTestSuite) TestCancelUnbondingDelegation() { suite.Run(tc.name, func() { suite.SetupTest() newParam := stakingtypes.DefaultParams() - newParam.MinCommissionRate = sdk.MustNewDecFromStr("0.02") + newParam.MinCommissionRate = math.LegacyMustNewDecFromStr("0.02") err := suite.app.StakingKeeper.SetParams(suite.ctx, newParam) suite.Require().NoError(err) - initialWeight := sdk.MustNewDecFromStr("0.5") + initialWeight := math.LegacyMustNewDecFromStr("0.5") suite.msKeeper.SetBondWeight(suite.ctx, MultiStakingDenomA, initialWeight) - bondAmount := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(2000)) - userBalance := sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(10000)) - suite.FundAccount(delAddr, sdk.NewCoins(userBalance, sdk.NewCoin(MultiStakingDenomB, sdk.NewInt(10000)))) + bondAmount := sdk.NewCoin(MultiStakingDenomA, math.NewInt(2000)) + userBalance := sdk.NewCoin(MultiStakingDenomA, math.NewInt(10000)) + suite.FundAccount(delAddr, sdk.NewCoins(userBalance, sdk.NewCoin(MultiStakingDenomB, math.NewInt(10000)))) + suite.FundAccount(sdk.AccAddress(valAddr), sdk.NewCoins(userBalance, sdk.NewCoin(MultiStakingDenomB, math.NewInt(10000)))) createMsg := stakingtypes.MsgCreateValidator{ Description: stakingtypes.Description{ @@ -965,12 +974,12 @@ func (suite *KeeperTestSuite) TestCancelUnbondingDelegation() { Details: "test", }, Commission: stakingtypes.CommissionRates{ - Rate: sdk.MustNewDecFromStr("0.05"), - MaxRate: sdk.MustNewDecFromStr("0.1"), - MaxChangeRate: sdk.MustNewDecFromStr("0.05"), + Rate: math.LegacyMustNewDecFromStr("0.05"), + MaxRate: math.LegacyMustNewDecFromStr("0.1"), + MaxChangeRate: math.LegacyMustNewDecFromStr("0.05"), }, - MinSelfDelegation: sdk.NewInt(200), - DelegatorAddress: delAddr.String(), + MinSelfDelegation: math.NewInt(200), + DelegatorAddress: sdk.AccAddress(valAddr).String(), ValidatorAddress: valAddr.String(), Pubkey: codectypes.UnsafePackAny(valPubKey), Value: bondAmount, @@ -979,10 +988,14 @@ func (suite *KeeperTestSuite) TestCancelUnbondingDelegation() { _, err = suite.msgServer.CreateValidator(suite.ctx, &createMsg) suite.Require().NoError(err) - suite.ctx = suite.ctx.WithBlockHeader(tmproto.Header{Time: time.Now()}) + delMsg := stakingtypes.NewMsgDelegate(delAddr.String(), valAddr.String(), bondAmount) + _, err = suite.msgServer.Delegate(suite.ctx, delMsg) + suite.Require().NoError(err) + + suite.ctx = suite.ctx.WithBlockHeader(tmproto.Header{Time: time.Now()}).WithBlockHeight(1) curHeight := suite.ctx.BlockHeight() - unbondMsg := stakingtypes.NewMsgUndelegate(delAddr, valAddr, sdk.NewCoin(MultiStakingDenomA, sdk.NewInt(1000))) + unbondMsg := stakingtypes.NewMsgUndelegate(delAddr.String(), valAddr.String(), sdk.NewCoin(MultiStakingDenomA, math.NewInt(1000))) _, err = suite.msgServer.Undelegate(suite.ctx, unbondMsg) suite.Require().NoError(err) @@ -997,10 +1010,10 @@ func (suite *KeeperTestSuite) TestCancelUnbondingDelegation() { suite.Require().True(found) suite.Require().Equal(tc.expLock, lockRecord.LockedCoin.Amount) - delegation, found := suite.app.StakingKeeper.GetDelegation(suite.ctx, delAddr, valAddr) - suite.Require().True(found) - validator, found := suite.app.StakingKeeper.GetValidator(suite.ctx, valAddr) - suite.Require().True(found) + delegation, err := suite.app.StakingKeeper.GetDelegation(suite.ctx, delAddr, valAddr) + suite.Require().NoError(err) + validator, err := suite.app.StakingKeeper.GetValidator(suite.ctx, valAddr) + suite.Require().NoError(err) multiStakingCoin := multistakingtypes.NewMultiStakingCoin(MultiStakingDenomA, tc.expLock, initialWeight) expShares, err := validator.SharesFromTokens(multiStakingCoin.BondValue()) @@ -1012,8 +1025,8 @@ func (suite *KeeperTestSuite) TestCancelUnbondingDelegation() { suite.Require().True(found) suite.Require().Equal(tc.expUnlock, unbondRecord.Entries[0].UnlockingCoin.Amount) - ubd, found := suite.app.StakingKeeper.GetUnbondingDelegation(suite.ctx, delAddr, valAddr) - suite.Require().True(found) + ubd, err := suite.app.StakingKeeper.GetUnbondingDelegation(suite.ctx, delAddr, valAddr) + suite.Require().NoError(err) unlockStakingCoin := multistakingtypes.NewMultiStakingCoin(MultiStakingDenomA, tc.expUnlock, initialWeight) totalUBDAmount := math.ZeroInt() diff --git a/x/multi-staking/keeper/params.go b/x/multi-staking/keeper/params.go index 4000b9f0..548a506d 100644 --- a/x/multi-staking/keeper/params.go +++ b/x/multi-staking/keeper/params.go @@ -1,8 +1,9 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/realio-tech/multi-staking-module/x/multi-staking/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // SetParams sets the x/staking module parameters. diff --git a/x/multi-staking/keeper/proposal.go b/x/multi-staking/keeper/proposal.go index 4307376f..075c0b59 100644 --- a/x/multi-staking/keeper/proposal.go +++ b/x/multi-staking/keeper/proposal.go @@ -5,6 +5,8 @@ import ( "github.com/realio-tech/multi-staking-module/x/multi-staking/types" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -19,7 +21,7 @@ func (k Keeper) AddMultiStakingCoinProposal( } bondWeight := *p.BondWeight - if bondWeight.LTE(sdk.ZeroDec()) { + if bondWeight.LTE(math.LegacyZeroDec()) { return fmt.Errorf("Error MultiStakingCoin BondWeight %s invalid", bondWeight) //nolint:stylecheck } @@ -45,7 +47,7 @@ func (k Keeper) BondWeightProposal( } bondWeight := *p.UpdatedBondWeight - if bondWeight.LTE(sdk.ZeroDec()) { + if bondWeight.LTE(math.LegacyZeroDec()) { return fmt.Errorf("Error MultiStakingCoin BondWeight %s invalid", bondWeight) //nolint:stylecheck } diff --git a/x/multi-staking/keeper/proposal_test.go b/x/multi-staking/keeper/proposal_test.go index 3e9ad067..f4908dde 100644 --- a/x/multi-staking/keeper/proposal_test.go +++ b/x/multi-staking/keeper/proposal_test.go @@ -3,6 +3,8 @@ package keeper_test import ( "github.com/realio-tech/multi-staking-module/x/multi-staking/types" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -10,7 +12,7 @@ import ( ) func (suite *KeeperTestSuite) TestAddMultiStakingCoinProposal() { - bondWeight := sdk.NewDec(1) + bondWeight := math.LegacyNewDec(1) for _, tc := range []struct { desc string @@ -57,7 +59,7 @@ func (suite *KeeperTestSuite) TestAddMultiStakingCoinProposal() { if !tc.shouldErr { // store proposal - _, err = suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{legacyProposal}, "", tc.proposal.Title, tc.proposal.Description, proposer) + _, err = suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{legacyProposal}, "", tc.proposal.Title, tc.proposal.Description, proposer, tc.shouldErr) suite.Require().NoError(err) // execute proposal @@ -69,7 +71,7 @@ func (suite *KeeperTestSuite) TestAddMultiStakingCoinProposal() { suite.Require().True(found) } else { // store proposal - _, err = suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{legacyProposal}, "", tc.proposal.Title, tc.proposal.Description, proposer) + _, err = suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{legacyProposal}, "", tc.proposal.Title, tc.proposal.Description, proposer, tc.shouldErr) suite.Require().Error(err) } }) @@ -77,7 +79,7 @@ func (suite *KeeperTestSuite) TestAddMultiStakingCoinProposal() { } func (suite *KeeperTestSuite) TestUpdateBondWeightProposal() { - bondWeight := sdk.NewDec(1) + bondWeight := math.LegacyNewDec(1) for _, tc := range []struct { desc string @@ -88,7 +90,7 @@ func (suite *KeeperTestSuite) TestUpdateBondWeightProposal() { { desc: "Success", malleate: func(p *types.UpdateBondWeightProposal) { - oldBondWeight := sdk.NewDec(2) + oldBondWeight := math.LegacyNewDec(2) suite.msKeeper.SetBondWeight(suite.ctx, p.Denom, oldBondWeight) }, proposal: &types.UpdateBondWeightProposal{ @@ -122,7 +124,7 @@ func (suite *KeeperTestSuite) TestUpdateBondWeightProposal() { if !tc.shouldErr { // store proposal - _, err = suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{legacyProposal}, "", tc.proposal.Title, tc.proposal.Description, proposer) + _, err = suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{legacyProposal}, "", tc.proposal.Title, tc.proposal.Description, proposer, tc.shouldErr) suite.Require().NoError(err) // execute proposal @@ -135,7 +137,7 @@ func (suite *KeeperTestSuite) TestUpdateBondWeightProposal() { suite.Require().True(weight.Equal(bondWeight)) } else { // store proposal - _, err = suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{legacyProposal}, "", tc.proposal.Title, tc.proposal.Description, proposer) + _, err = suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{legacyProposal}, "", tc.proposal.Title, tc.proposal.Description, proposer, tc.shouldErr) suite.Require().Error(err) } }) diff --git a/x/multi-staking/keeper/store.go b/x/multi-staking/keeper/store.go index d8fe27e1..3eae6ba7 100644 --- a/x/multi-staking/keeper/store.go +++ b/x/multi-staking/keeper/store.go @@ -1,22 +1,26 @@ package keeper import ( + "context" "fmt" "github.com/realio-tech/multi-staking-module/x/multi-staking/types" - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/math" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) -func (k Keeper) GetBondWeight(ctx sdk.Context, tokenDenom string) (sdk.Dec, bool) { +func (k Keeper) GetBondWeight(ctx sdk.Context, tokenDenom string) (math.LegacyDec, bool) { store := ctx.KVStore(k.storeKey) bz := store.Get(types.GetBondWeightKey(tokenDenom)) if bz == nil { - return sdk.Dec{}, false + return math.LegacyDec{}, false } - bondCoinWeight := &sdk.Dec{} + bondCoinWeight := &math.LegacyDec{} err := bondCoinWeight.Unmarshal(bz) if err != nil { panic(fmt.Errorf("unable to unmarshal bond coin weight %v", err)) @@ -24,7 +28,7 @@ func (k Keeper) GetBondWeight(ctx sdk.Context, tokenDenom string) (sdk.Dec, bool return *bondCoinWeight, true } -func (k Keeper) SetBondWeight(ctx sdk.Context, tokenDenom string, tokenWeight sdk.Dec) { +func (k Keeper) SetBondWeight(ctx sdk.Context, tokenDenom string, tokenWeight math.LegacyDec) { store := ctx.KVStore(k.storeKey) bz, err := tokenWeight.Marshal() if err != nil { @@ -60,7 +64,7 @@ func (k Keeper) SetValidatorMultiStakingCoin(ctx sdk.Context, operatorAddr sdk.V func (k Keeper) ValidatorMultiStakingCoinIterator(ctx sdk.Context, cb func(valAddr string, denom string) (stop bool)) { store := ctx.KVStore(k.storeKey) prefixStore := prefix.NewStore(store, types.ValidatorMultiStakingCoinKey) - iterator := sdk.KVStorePrefixIterator(prefixStore, nil) + iterator := storetypes.KVStorePrefixIterator(prefixStore, nil) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { @@ -72,8 +76,9 @@ func (k Keeper) ValidatorMultiStakingCoinIterator(ctx sdk.Context, cb func(valAd } } -func (k Keeper) GetMultiStakingLock(ctx sdk.Context, multiStakingLockID types.LockID) (types.MultiStakingLock, bool) { - store := ctx.KVStore(k.storeKey) +func (k Keeper) GetMultiStakingLock(ctx context.Context, multiStakingLockID types.LockID) (types.MultiStakingLock, bool) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + store := sdkCtx.KVStore(k.storeKey) bz := store.Get(multiStakingLockID.ToBytes()) if bz == nil { @@ -85,13 +90,14 @@ func (k Keeper) GetMultiStakingLock(ctx sdk.Context, multiStakingLockID types.Lo return multiStakingLock, true } -func (k Keeper) SetMultiStakingLock(ctx sdk.Context, multiStakingLock types.MultiStakingLock) { +func (k Keeper) SetMultiStakingLock(ctx context.Context, multiStakingLock types.MultiStakingLock) { + sdkCtx := sdk.UnwrapSDKContext(ctx) if multiStakingLock.IsEmpty() { - k.RemoveMultiStakingLock(ctx, multiStakingLock.LockID) + k.RemoveMultiStakingLock(sdkCtx, multiStakingLock.LockID) return } - store := ctx.KVStore(k.storeKey) + store := sdkCtx.KVStore(k.storeKey) bz := k.cdc.MustMarshal(&multiStakingLock) @@ -107,7 +113,7 @@ func (k Keeper) RemoveMultiStakingLock(ctx sdk.Context, multiStakingLockID types func (k Keeper) MultiStakingLockIterator(ctx sdk.Context, cb func(stakingLock types.MultiStakingLock) (stop bool)) { store := ctx.KVStore(k.storeKey) prefixStore := prefix.NewStore(store, types.MultiStakingLockPrefix) - iterator := sdk.KVStorePrefixIterator(prefixStore, nil) + iterator := storetypes.KVStorePrefixIterator(prefixStore, nil) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { @@ -122,7 +128,7 @@ func (k Keeper) MultiStakingLockIterator(ctx sdk.Context, cb func(stakingLock ty func (k Keeper) MultiStakingUnlockIterator(ctx sdk.Context, cb func(multiStakingUnlock types.MultiStakingUnlock) (stop bool)) { store := ctx.KVStore(k.storeKey) prefixStore := prefix.NewStore(store, types.MultiStakingUnlockPrefix) - iterator := sdk.KVStorePrefixIterator(prefixStore, nil) + iterator := storetypes.KVStorePrefixIterator(prefixStore, nil) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { @@ -134,15 +140,15 @@ func (k Keeper) MultiStakingUnlockIterator(ctx sdk.Context, cb func(multiStaking } } -func (k Keeper) BondWeightIterator(ctx sdk.Context, cb func(denom string, bondWeight sdk.Dec) (stop bool)) { +func (k Keeper) BondWeightIterator(ctx sdk.Context, cb func(denom string, bondWeight math.LegacyDec) (stop bool)) { store := ctx.KVStore(k.storeKey) prefixStore := prefix.NewStore(store, types.BondWeightKey) - iterator := sdk.KVStorePrefixIterator(prefixStore, nil) + iterator := storetypes.KVStorePrefixIterator(prefixStore, nil) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { denom := string(iterator.Key()) - bondWeight := &sdk.Dec{} + bondWeight := &math.LegacyDec{} err := bondWeight.Unmarshal(iterator.Value()) if err != nil { panic(fmt.Errorf("unable to unmarshal bond coin weight %v", err)) diff --git a/x/multi-staking/keeper/store_test.go b/x/multi-staking/keeper/store_test.go index 26f5f134..26ec9bdd 100644 --- a/x/multi-staking/keeper/store_test.go +++ b/x/multi-staking/keeper/store_test.go @@ -5,6 +5,8 @@ import ( multistakingkeeper "github.com/realio-tech/multi-staking-module/x/multi-staking/keeper" "github.com/realio-tech/multi-staking-module/x/multi-staking/types" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -16,8 +18,8 @@ var ( func (suite *KeeperTestSuite) TestSetBondWeight() { suite.SetupTest() - gasWeight := sdk.OneDec() - govWeight := sdk.NewDecWithPrec(2, 4) + gasWeight := math.LegacyOneDec() + govWeight := math.LegacyNewDecWithPrec(2, 4) suite.msKeeper.SetBondWeight(suite.ctx, gasDenom, gasWeight) suite.msKeeper.SetBondWeight(suite.ctx, govDenom, govWeight) @@ -102,8 +104,8 @@ func (suite *KeeperTestSuite) TestSetMultiStakingLock() { }, LockedCoin: types.MultiStakingCoin{ Denom: gasDenom, - Amount: sdk.NewIntFromUint64(1000000), - BondWeight: sdk.NewDec(1), + Amount: math.NewIntFromUint64(1000000), + BondWeight: math.LegacyNewDec(1), }, } @@ -140,19 +142,19 @@ func (suite *KeeperTestSuite) TestMultiStakingLockIterator() { sampleLocks := []types.MultiStakingLock{ types.NewMultiStakingLock( types.MultiStakingLockID(delA.String(), valA.String()), - types.NewMultiStakingCoin(gasDenom, sdk.NewInt(1000), sdk.OneDec()), + types.NewMultiStakingCoin(gasDenom, math.NewInt(1000), math.LegacyOneDec()), ), types.NewMultiStakingLock( types.MultiStakingLockID(delA.String(), valB.String()), - types.NewMultiStakingCoin(govDenom, sdk.NewInt(1234), sdk.MustNewDecFromStr("0.3")), + types.NewMultiStakingCoin(govDenom, math.NewInt(1234), math.LegacyMustNewDecFromStr("0.3")), ), types.NewMultiStakingLock( types.MultiStakingLockID(delB.String(), valA.String()), - types.NewMultiStakingCoin(gasDenom, sdk.NewInt(5678), sdk.OneDec()), + types.NewMultiStakingCoin(gasDenom, math.NewInt(5678), math.LegacyOneDec()), ), types.NewMultiStakingLock( types.MultiStakingLockID(delB.String(), valB.String()), - types.NewMultiStakingCoin(govDenom, sdk.NewInt(3000), sdk.MustNewDecFromStr("0.3")), + types.NewMultiStakingCoin(govDenom, math.NewInt(3000), math.LegacyMustNewDecFromStr("0.3")), ), } @@ -188,22 +190,22 @@ func (suite *KeeperTestSuite) TestMultiStakingUnlockIterator() { types.NewMultiStakingUnlock( types.MultiStakingUnlockID(delA.String(), valA.String()), 1, - types.NewMultiStakingCoin(gasDenom, sdk.NewInt(1000), sdk.OneDec()), + types.NewMultiStakingCoin(gasDenom, math.NewInt(1000), math.LegacyOneDec()), ), types.NewMultiStakingUnlock( types.MultiStakingUnlockID(delA.String(), valB.String()), 2, - types.NewMultiStakingCoin(govDenom, sdk.NewInt(1234), sdk.MustNewDecFromStr("0.3")), + types.NewMultiStakingCoin(govDenom, math.NewInt(1234), math.LegacyMustNewDecFromStr("0.3")), ), types.NewMultiStakingUnlock( types.MultiStakingUnlockID(delB.String(), valA.String()), 3, - types.NewMultiStakingCoin(gasDenom, sdk.NewInt(5678), sdk.OneDec()), + types.NewMultiStakingCoin(gasDenom, math.NewInt(5678), math.LegacyOneDec()), ), types.NewMultiStakingUnlock( types.MultiStakingUnlockID(delB.String(), valB.String()), 4, - types.NewMultiStakingCoin(govDenom, sdk.NewInt(3000), sdk.MustNewDecFromStr("0.3")), + types.NewMultiStakingCoin(govDenom, math.NewInt(3000), math.LegacyMustNewDecFromStr("0.3")), ), } diff --git a/x/multi-staking/keeper/unlock.go b/x/multi-staking/keeper/unlock.go index d843a09e..8f131261 100644 --- a/x/multi-staking/keeper/unlock.go +++ b/x/multi-staking/keeper/unlock.go @@ -1,6 +1,7 @@ package keeper import ( + "context" "fmt" "github.com/realio-tech/multi-staking-module/x/multi-staking/types" @@ -38,17 +39,18 @@ func (k Keeper) GetUnlockEntryAtCreationHeight(ctx sdk.Context, unlockID types.U // SetMultiStakingUnlockEntry adds an entry to the unbonding delegation at // the given addresses. It creates the unbonding delegation if it does not exist. func (k Keeper) SetMultiStakingUnlockEntry( - ctx sdk.Context, unlockID types.UnlockID, + ctx context.Context, unlockID types.UnlockID, multistakingCoin types.MultiStakingCoin, ) types.MultiStakingUnlock { - unlock, found := k.GetMultiStakingUnlock(ctx, unlockID) + sdkCtx := sdk.UnwrapSDKContext(ctx) + unlock, found := k.GetMultiStakingUnlock(sdkCtx, unlockID) if found { - unlock.AddEntry(ctx.BlockHeight(), multistakingCoin) + unlock.AddEntry(sdkCtx.BlockHeight(), multistakingCoin) } else { - unlock = types.NewMultiStakingUnlock(unlockID, ctx.BlockHeight(), multistakingCoin) + unlock = types.NewMultiStakingUnlock(unlockID, sdkCtx.BlockHeight(), multistakingCoin) } - k.SetMultiStakingUnlock(ctx, unlock) + k.SetMultiStakingUnlock(sdkCtx, unlock) return unlock } @@ -73,10 +75,11 @@ func (k Keeper) DeleteUnlockEntryAtCreationHeight( } func (k Keeper) DecreaseUnlockEntryAmount( - ctx sdk.Context, unlockID types.UnlockID, + ctx context.Context, unlockID types.UnlockID, amount math.Int, creationHeight int64, ) (types.MultiStakingCoin, error) { - unlockRecord, found := k.GetMultiStakingUnlock(ctx, unlockID) + sdkCtx := sdk.UnwrapSDKContext(ctx) + unlockRecord, found := k.GetMultiStakingUnlock(sdkCtx, unlockID) if !found { return types.MultiStakingCoin{}, fmt.Errorf("not found unlock recored") } @@ -95,9 +98,9 @@ func (k Keeper) DecreaseUnlockEntryAmount( // set the unlocking record or remove it if there are no more entries if len(unlockRecord.Entries) == 0 { - k.DeleteMultiStakingUnlock(ctx, unlockID) + k.DeleteMultiStakingUnlock(sdkCtx, unlockID) } else { - k.SetMultiStakingUnlock(ctx, unlockRecord) + k.SetMultiStakingUnlock(sdkCtx, unlockRecord) } return types.NewMultiStakingCoin(unlockEntry.UnlockingCoin.Denom, amount, unlockEntry.GetBondWeight()), nil diff --git a/x/multi-staking/module.go b/x/multi-staking/module.go index 51ff82a5..299e3fbd 100644 --- a/x/multi-staking/module.go +++ b/x/multi-staking/module.go @@ -8,14 +8,19 @@ import ( gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/realio-tech/multi-staking-module/x/multi-staking/client/cli" "github.com/realio-tech/multi-staking-module/x/multi-staking/keeper" + "github.com/realio-tech/multi-staking-module/x/multi-staking/simulation" multistakingtypes "github.com/realio-tech/multi-staking-module/x/multi-staking/types" "github.com/spf13/cobra" + "cosmossdk.io/core/appmodule" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + sdksimulation "github.com/cosmos/cosmos-sdk/x/simulation" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/exported" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" @@ -25,8 +30,14 @@ import ( ) var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} + _ module.HasABCIGenesis = AppModule{} + _ module.HasServices = AppModule{} + _ module.HasABCIEndBlock = AppModule{} + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModule{} + _ module.AppModuleSimulation = AppModule{} + _ module.HasInvariants = AppModule{} + _ appmodule.HasBeginBlocker = AppModule{} ) // AppModule embeds the Cosmos SDK's x/staking AppModuleBasic. @@ -46,6 +57,7 @@ func (am AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { // RegisterInterfaces registers the module interface func (am AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { + stakingtypes.RegisterInterfaces(reg) multistakingtypes.RegisterInterfaces(reg) } @@ -72,8 +84,8 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *g } // GetTxCmd returns the staking module's root tx command. -func (AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.NewTxCmd() +func (amb AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.NewTxCmd(amb.cdc.InterfaceRegistry().SigningContext().ValidatorAddressCodec(), amb.cdc.InterfaceRegistry().SigningContext().AddressCodec()) } // GetQueryCmd returns the multi-staking and staking module's root query command. @@ -160,22 +172,53 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // BeginBlock returns the begin blocker for the multi-staking module. -func (am AppModule) BeginBlock(ctx sdk.Context, requestBeginBlock abci.RequestBeginBlock) { - am.skAppModule.BeginBlock(ctx, requestBeginBlock) +func (am AppModule) BeginBlock(ctx context.Context) error { + return am.skAppModule.BeginBlock(ctx) } // EndBlock returns the end blocker for the multi-staking module. It returns no validator // updates. -func (am AppModule) EndBlock(ctx sdk.Context, requestEndBlock abci.RequestEndBlock) []abci.ValidatorUpdate { +func (am AppModule) EndBlock(ctx context.Context) ([]abci.ValidatorUpdate, error) { // calculate the amount of coin - matureUnbondingDelegations := am.keeper.GetMatureUnbondingDelegations(ctx) + matureUnbondingDelegations, err := am.keeper.GetMatureUnbondingDelegations(ctx) + if err != nil { + return []abci.ValidatorUpdate{}, err + } // staking endblock - valUpdates := am.skAppModule.EndBlock(ctx, requestEndBlock) + valUpdates, err := am.skAppModule.EndBlock(ctx) + if err != nil { + return []abci.ValidatorUpdate{}, err + } // update endblock multi-staking am.keeper.EndBlocker(ctx, matureUnbondingDelegations) - return valUpdates + return valUpdates, nil +} + +func (am AppModule) StakingAppModule() staking.AppModule { + return am.skAppModule } // ConsensusVersion return module consensus version func (AppModule) ConsensusVersion() uint64 { return 2 } + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} + +// GenerateGenesisState creates a randomized GenState of the staking module. +func (am AppModule) GenerateGenesisState(simState *module.SimulationState) { + simulation.RandomizedGenState(simState) +} + +// RegisterStoreDecoder registers a decoder for staking module's types +func (am AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry) { + // sdr[types.StoreKey] = simulation.NewDecodeStore(am.cdc) +} + +// WeightedOperations returns the all the staking module operations with their respective weights. +func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { + return sdksimulation.WeightedOperations{} +} diff --git a/x/multi-staking/simulation/genesis.go b/x/multi-staking/simulation/genesis.go new file mode 100644 index 00000000..d4e8e1ec --- /dev/null +++ b/x/multi-staking/simulation/genesis.go @@ -0,0 +1,104 @@ +package simulation + +import ( + "encoding/json" + "fmt" + "math/rand" + "time" + + multistakingtypes "github.com/realio-tech/multi-staking-module/x/multi-staking/types" + + sdkmath "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +// Simulation parameter constants +const ( + unbondingTime = "unbonding_time" + maxValidators = "max_validators" + historicalEntries = "historical_entries" +) + +// genUnbondingTime returns randomized UnbondingTime +func genUnbondingTime(r *rand.Rand) (ubdTime time.Duration) { + return time.Duration(simulation.RandIntBetween(r, 60, 60*60*24*3*2)) * time.Second +} + +// genMaxValidators returns randomized MaxValidators +func genMaxValidators(r *rand.Rand) (maxValidators uint32) { + return uint32(r.Intn(250) + 1) +} + +// getHistEntries returns randomized HistoricalEntries between 0-100. +func getHistEntries(r *rand.Rand) uint32 { + return uint32(r.Intn(int(types.DefaultHistoricalEntries + 1))) +} + +// RandomizedGenState generates a random GenesisState for staking +func RandomizedGenState(simState *module.SimulationState) { + // params + var ( + unbondTime time.Duration + maxVals uint32 + histEntries uint32 + minCommissionRate sdkmath.LegacyDec + ) + + simState.AppParams.GetOrGenerate(unbondingTime, &unbondTime, simState.Rand, func(r *rand.Rand) { unbondTime = genUnbondingTime(r) }) + + simState.AppParams.GetOrGenerate(maxValidators, &maxVals, simState.Rand, func(r *rand.Rand) { maxVals = genMaxValidators(r) }) + + simState.AppParams.GetOrGenerate(historicalEntries, &histEntries, simState.Rand, func(r *rand.Rand) { histEntries = getHistEntries(r) }) + + // NOTE: the slashing module need to be defined after the staking module on the + // NewSimulationManager constructor for this to work + simState.UnbondTime = unbondTime + params := types.NewParams(simState.UnbondTime, maxVals, 7, histEntries, simState.BondDenom, minCommissionRate) + + // validators & delegations + var ( + validators []types.Validator + delegations []types.Delegation + ) + + valAddrs := make([]sdk.ValAddress, simState.NumBonded) + + for i := 0; i < int(simState.NumBonded); i++ { + valAddr := sdk.ValAddress(simState.Accounts[i].Address) + valAddrs[i] = valAddr + + maxCommission := sdkmath.LegacyNewDecWithPrec(int64(simulation.RandIntBetween(simState.Rand, 1, 100)), 2) + commission := types.NewCommission( + simulation.RandomDecAmount(simState.Rand, maxCommission), + maxCommission, + simulation.RandomDecAmount(simState.Rand, maxCommission), + ) + + validator, err := types.NewValidator(valAddr.String(), simState.Accounts[i].ConsKey.PubKey(), types.Description{}) + if err != nil { + panic(err) + } + validator.Tokens = simState.InitialStake + validator.DelegatorShares = sdkmath.LegacyNewDecFromInt(simState.InitialStake) + validator.Commission = commission + + delegation := types.NewDelegation(simState.Accounts[i].Address.String(), valAddr.String(), sdkmath.LegacyNewDecFromInt(simState.InitialStake)) + + validators = append(validators, validator) + delegations = append(delegations, delegation) + } + + stakingGenesis := types.NewGenesisState(params, validators, delegations) + + bz, err := json.MarshalIndent(&stakingGenesis.Params, "", " ") + if err != nil { + panic(err) + } + fmt.Printf("Selected randomly generated staking parameters:\n%s\n", bz) + multistakingGenesis := multistakingtypes.NewGenesisState(nil, nil, nil, nil, *stakingGenesis) + simState.GenState[multistakingtypes.ModuleName] = simState.Cdc.MustMarshalJSON(multistakingGenesis) +} diff --git a/x/multi-staking/types/codec.go b/x/multi-staking/types/codec.go index 76d51bbf..275f49ab 100644 --- a/x/multi-staking/types/codec.go +++ b/x/multi-staking/types/codec.go @@ -4,26 +4,9 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" v1beta1types "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - - authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec" - govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec" - groupcodec "github.com/cosmos/cosmos-sdk/x/group/codec" -) - -var ( - amino = codec.NewLegacyAmino() - - // AminoCdc references the global x/relationships module codec. Note, the codec should - // ONLY be used in certain instances of tests and for JSON encoding as Amino is - // still used for that purpose. - // - // The actual codec used for serialization should be provided to x/relationships and - // defined at the application level. - AminoCdc = codec.NewAminoCodec(amino) ) func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { @@ -46,15 +29,3 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } - -func init() { - RegisterLegacyAminoCodec(amino) - cryptocodec.RegisterCrypto(amino) - sdk.RegisterLegacyAminoCodec(amino) - - // Register all Amino interfaces and concrete types on the authz and gov Amino codec so that this can later be - // used to properly serialize MsgGrant, MsgExec and MsgSubmitProposal instances - RegisterLegacyAminoCodec(authzcodec.Amino) - RegisterLegacyAminoCodec(govcodec.Amino) - RegisterLegacyAminoCodec(groupcodec.Amino) -} diff --git a/x/multi-staking/types/expected_keepers.go b/x/multi-staking/types/expected_keepers.go index 68071966..1d44e1c0 100644 --- a/x/multi-staking/types/expected_keepers.go +++ b/x/multi-staking/types/expected_keepers.go @@ -1,10 +1,10 @@ package types import ( + context "context" time "time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" abci "github.com/cometbft/cometbft/abci/types" @@ -12,26 +12,26 @@ import ( type AccountKeeper interface { GetModuleAddress(moduleName string) sdk.AccAddress - GetModuleAccount(ctx sdk.Context, moduleName string) types.ModuleAccountI + GetModuleAccount(ctx context.Context, moduleName string) sdk.ModuleAccountI } type StakingKeeper interface { - DequeueAllMatureUBDQueue(ctx sdk.Context, currTime time.Time) (matureUnbonds []stakingtypes.DVPair) - BondDenom(ctx sdk.Context) (res string) - GetDelegation(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (delegation stakingtypes.Delegation, found bool) - GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, found bool) - GetUnbondingDelegation(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (unlock stakingtypes.UnbondingDelegation, found bool) - InitGenesis(ctx sdk.Context, data *stakingtypes.GenesisState) (res []abci.ValidatorUpdate) - ExportGenesis(ctx sdk.Context) *stakingtypes.GenesisState - GetParams(ctx sdk.Context) stakingtypes.Params + DequeueAllMatureUBDQueue(ctx context.Context, currTime time.Time) (matureUnbonds []stakingtypes.DVPair) + BondDenom(ctx context.Context) (res string) + GetDelegation(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (delegation stakingtypes.Delegation, found bool) + GetValidator(ctx context.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, found bool) + GetUnbondingDelegation(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (unlock stakingtypes.UnbondingDelegation, found bool) + InitGenesis(ctx context.Context, data *stakingtypes.GenesisState) (res []abci.ValidatorUpdate) + ExportGenesis(ctx context.Context) *stakingtypes.GenesisState + GetParams(ctx context.Context) stakingtypes.Params } type BankKeeper interface { - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin - GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error - BurnCoins(ctx sdk.Context, moduleName string, amounts sdk.Coins) error - SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error - SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error - SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin + GetAllBalances(ctx context.Context, addr sdk.AccAddress) sdk.Coins + MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error + BurnCoins(ctx context.Context, moduleName string, amounts sdk.Coins) error + SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SendCoins(ctx context.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error } diff --git a/x/multi-staking/types/genesis.go b/x/multi-staking/types/genesis.go index b484b65a..b6f24706 100644 --- a/x/multi-staking/types/genesis.go +++ b/x/multi-staking/types/genesis.go @@ -8,6 +8,16 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) +func NewGenesisState(multiStakingLocks []MultiStakingLock, multiStakingUnlocks []MultiStakingUnlock, multiStakingCoinInfo []MultiStakingCoinInfo, validatorMultiStakingCoins []ValidatorMultiStakingCoin, stakingGenesisState stakingtypes.GenesisState) *GenesisState { + return &GenesisState{ + multiStakingLocks, + multiStakingUnlocks, + multiStakingCoinInfo, + validatorMultiStakingCoins, + stakingGenesisState, + } +} + func DefaultGenesis() *GenesisState { stakingGenesis := stakingtypes.DefaultGenesisState() diff --git a/x/multi-staking/types/lock.go b/x/multi-staking/types/lock.go index 78eadf5b..ae8a70fb 100644 --- a/x/multi-staking/types/lock.go +++ b/x/multi-staking/types/lock.go @@ -43,7 +43,7 @@ func (multiStakingLock *MultiStakingLock) AddCoinToMultiStakingLock(addedCoin Mu return err } -func (m MultiStakingLock) GetBondWeight() sdk.Dec { +func (m MultiStakingLock) GetBondWeight() math.LegacyDec { return m.LockedCoin.BondWeight } diff --git a/x/multi-staking/types/lock_test.go b/x/multi-staking/types/lock_test.go index 069d59b0..311e6ffc 100644 --- a/x/multi-staking/types/lock_test.go +++ b/x/multi-staking/types/lock_test.go @@ -7,7 +7,7 @@ import ( "github.com/realio-tech/multi-staking-module/x/multi-staking/types" "github.com/stretchr/testify/require" - sdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/math" ) var ( @@ -28,29 +28,29 @@ func TestAddCoinToMultiStakingLock(t *testing.T) { }{ { name: "success", - originMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(100000), sdk.MustNewDecFromStr("0.3")), - addingMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(23456), sdk.MustNewDecFromStr("0.3")), - expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(123456), sdk.MustNewDecFromStr("0.3")), + originMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(100000), math.LegacyMustNewDecFromStr("0.3")), + addingMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(23456), math.LegacyMustNewDecFromStr("0.3")), + expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(123456), math.LegacyMustNewDecFromStr("0.3")), expErr: false, }, { name: "success and change bond weight", - originMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(100000), sdk.OneDec()), - addingMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(200000), sdk.MustNewDecFromStr("0.25")), - expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(300000), sdk.MustNewDecFromStr("0.5")), + originMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(100000), math.LegacyOneDec()), + addingMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(200000), math.LegacyMustNewDecFromStr("0.25")), + expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(300000), math.LegacyMustNewDecFromStr("0.5")), expErr: false, }, { name: "success from zero coin", - originMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.ZeroInt(), sdk.MustNewDecFromStr("0.3")), - addingMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(23456), sdk.MustNewDecFromStr("0.3")), - expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(23456), sdk.MustNewDecFromStr("0.3")), + originMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.ZeroInt(), math.LegacyMustNewDecFromStr("0.3")), + addingMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(23456), math.LegacyMustNewDecFromStr("0.3")), + expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(23456), math.LegacyMustNewDecFromStr("0.3")), expErr: false, }, { name: "denom mismatch", - originMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(100000), sdk.MustNewDecFromStr("0.3")), - addingMSCoin: types.NewMultiStakingCoin(MultiStakingDenomB, sdk.NewInt(23456), sdk.MustNewDecFromStr("0.3")), + originMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(100000), math.LegacyMustNewDecFromStr("0.3")), + addingMSCoin: types.NewMultiStakingCoin(MultiStakingDenomB, math.NewInt(23456), math.LegacyMustNewDecFromStr("0.3")), expErr: true, }, } @@ -87,21 +87,21 @@ func TestRemoveCoinFromMultiStakingLock(t *testing.T) { }{ { name: "success", - originMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(123456), sdk.MustNewDecFromStr("0.3")), - removeMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(23456), sdk.MustNewDecFromStr("0.3")), - expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(100000), sdk.MustNewDecFromStr("0.3")), + originMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(123456), math.LegacyMustNewDecFromStr("0.3")), + removeMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(23456), math.LegacyMustNewDecFromStr("0.3")), + expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(100000), math.LegacyMustNewDecFromStr("0.3")), expErr: false, }, { name: "denom mismatch", - originMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(100000), sdk.MustNewDecFromStr("0.3")), - removeMSCoin: types.NewMultiStakingCoin(MultiStakingDenomB, sdk.NewInt(23456), sdk.MustNewDecFromStr("0.3")), + originMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(100000), math.LegacyMustNewDecFromStr("0.3")), + removeMSCoin: types.NewMultiStakingCoin(MultiStakingDenomB, math.NewInt(23456), math.LegacyMustNewDecFromStr("0.3")), expErr: true, }, { name: "insufficient amount", - originMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(100000), sdk.MustNewDecFromStr("0.3")), - removeMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(234567), sdk.MustNewDecFromStr("0.3")), + originMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(100000), math.LegacyMustNewDecFromStr("0.3")), + removeMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(234567), math.LegacyMustNewDecFromStr("0.3")), expErr: true, }, } @@ -142,48 +142,48 @@ func TestMoveCoinToLock(t *testing.T) { }{ { name: "success", - fromMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(123456), sdk.MustNewDecFromStr("0.3")), - toMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(100000), sdk.MustNewDecFromStr("0.3")), - moveMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(23456), sdk.MustNewDecFromStr("0.3")), - expFromMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(100000), sdk.MustNewDecFromStr("0.3")), - expToMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(123456), sdk.MustNewDecFromStr("0.3")), + fromMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(123456), math.LegacyMustNewDecFromStr("0.3")), + toMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(100000), math.LegacyMustNewDecFromStr("0.3")), + moveMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(23456), math.LegacyMustNewDecFromStr("0.3")), + expFromMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(100000), math.LegacyMustNewDecFromStr("0.3")), + expToMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(123456), math.LegacyMustNewDecFromStr("0.3")), expErr: false, }, { name: "success and change rate", - fromMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(323456), sdk.MustNewDecFromStr("0.5")), - toMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(100000), sdk.OneDec()), - moveMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(300000), sdk.MustNewDecFromStr("0.5")), - expFromMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(23456), sdk.MustNewDecFromStr("0.5")), - expToMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(400000), sdk.MustNewDecFromStr("0.625")), + fromMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(323456), math.LegacyMustNewDecFromStr("0.5")), + toMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(100000), math.LegacyOneDec()), + moveMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(300000), math.LegacyMustNewDecFromStr("0.5")), + expFromMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(23456), math.LegacyMustNewDecFromStr("0.5")), + expToMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(400000), math.LegacyMustNewDecFromStr("0.625")), expErr: false, }, { name: "denom mismatch at fromLock", - fromMSCoin: types.NewMultiStakingCoin(MultiStakingDenomB, sdk.NewInt(123456), sdk.MustNewDecFromStr("0.3")), - toMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(100000), sdk.MustNewDecFromStr("0.3")), - moveMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(23456), sdk.MustNewDecFromStr("0.3")), + fromMSCoin: types.NewMultiStakingCoin(MultiStakingDenomB, math.NewInt(123456), math.LegacyMustNewDecFromStr("0.3")), + toMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(100000), math.LegacyMustNewDecFromStr("0.3")), + moveMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(23456), math.LegacyMustNewDecFromStr("0.3")), expErr: true, }, { name: "denom mismatch at toLock", - fromMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(123456), sdk.MustNewDecFromStr("0.3")), - toMSCoin: types.NewMultiStakingCoin(MultiStakingDenomB, sdk.NewInt(100000), sdk.MustNewDecFromStr("0.3")), - moveMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(23456), sdk.MustNewDecFromStr("0.3")), + fromMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(123456), math.LegacyMustNewDecFromStr("0.3")), + toMSCoin: types.NewMultiStakingCoin(MultiStakingDenomB, math.NewInt(100000), math.LegacyMustNewDecFromStr("0.3")), + moveMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(23456), math.LegacyMustNewDecFromStr("0.3")), expErr: true, }, { name: "denom mismatch at move coin", - fromMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(123456), sdk.MustNewDecFromStr("0.3")), - toMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(100000), sdk.MustNewDecFromStr("0.3")), - moveMSCoin: types.NewMultiStakingCoin(MultiStakingDenomB, sdk.NewInt(23456), sdk.MustNewDecFromStr("0.3")), + fromMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(123456), math.LegacyMustNewDecFromStr("0.3")), + toMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(100000), math.LegacyMustNewDecFromStr("0.3")), + moveMSCoin: types.NewMultiStakingCoin(MultiStakingDenomB, math.NewInt(23456), math.LegacyMustNewDecFromStr("0.3")), expErr: true, }, { name: "insufficient amount", - fromMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(123456), sdk.MustNewDecFromStr("0.3")), - toMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(200000), sdk.MustNewDecFromStr("0.3")), - moveMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(234567), sdk.MustNewDecFromStr("0.3")), + fromMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(123456), math.LegacyMustNewDecFromStr("0.3")), + toMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(200000), math.LegacyMustNewDecFromStr("0.3")), + moveMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(234567), math.LegacyMustNewDecFromStr("0.3")), expErr: true, }, } diff --git a/x/multi-staking/types/msg.go b/x/multi-staking/types/msg.go deleted file mode 100644 index 33fd7a18..00000000 --- a/x/multi-staking/types/msg.go +++ /dev/null @@ -1,36 +0,0 @@ -package types - -import ( - sdkerrors "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// staking message types -const ( - TypeMsgUpdateMultiStakingParams = "update_multistaking_params" -) - -var ( - _ sdk.Msg = &MsgUpdateMultiStakingParams{} -) - -// GetSignBytes returns the raw bytes for a MsgUpdateParams message that -// the expected signer needs to sign. -func (m *MsgUpdateMultiStakingParams) GetSignBytes() []byte { - bz := AminoCdc.MustMarshalJSON(m) - return sdk.MustSortJSON(bz) -} - -// ValidateBasic executes sanity validation on the provided data -func (m *MsgUpdateMultiStakingParams) ValidateBasic() error { - if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { - return sdkerrors.Wrap(err, "invalid authority address") - } - return nil -} - -// GetSigners returns the expected signers for a MsgUpdateParams message -func (m *MsgUpdateMultiStakingParams) GetSigners() []sdk.AccAddress { - addr, _ := sdk.AccAddressFromBech32(m.Authority) - return []sdk.AccAddress{addr} -} diff --git a/x/multi-staking/types/multi_staking.pb.go b/x/multi-staking/types/multi_staking.pb.go index 8ba4f294..00232f6c 100644 --- a/x/multi-staking/types/multi_staking.pb.go +++ b/x/multi-staking/types/multi_staking.pb.go @@ -4,11 +4,11 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/cosmos/cosmos-sdk/types" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types1 "github.com/cosmos/cosmos-sdk/x/staking/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" @@ -33,9 +33,9 @@ var _ = time.Kitchen const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type MultiStakingCoin struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` - BondWeight github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=bond_weight,json=bondWeight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bond_weight"` + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Amount cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount"` + BondWeight cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=bond_weight,json=bondWeight,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"bond_weight"` } func (m *MultiStakingCoin) Reset() { *m = MultiStakingCoin{} } @@ -362,8 +362,8 @@ func (m *UnlockEntry) GetUnlockingCoin() MultiStakingCoin { } type MultiStakingCoinInfo struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - BondWeight github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=bond_weight,json=bondWeight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bond_weight"` + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + BondWeight cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=bond_weight,json=bondWeight,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"bond_weight"` } func (m *MultiStakingCoinInfo) Reset() { *m = MultiStakingCoinInfo{} } @@ -407,18 +407,18 @@ func (m *MultiStakingCoinInfo) GetDenom() string { } type ValidatorInfo struct { - OperatorAddress string `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` - ConsensusPubkey *types.Any `protobuf:"bytes,2,opt,name=consensus_pubkey,json=consensusPubkey,proto3" json:"consensus_pubkey,omitempty"` - Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"` - Status types1.BondStatus `protobuf:"varint,4,opt,name=status,proto3,enum=cosmos.staking.v1beta1.BondStatus" json:"status,omitempty"` - Tokens github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=tokens,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"tokens"` - DelegatorShares github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=delegator_shares,json=delegatorShares,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"delegator_shares"` - Description types1.Description `protobuf:"bytes,7,opt,name=description,proto3" json:"description"` - UnbondingHeight int64 `protobuf:"varint,8,opt,name=unbonding_height,json=unbondingHeight,proto3" json:"unbonding_height,omitempty"` - UnbondingTime time.Time `protobuf:"bytes,9,opt,name=unbonding_time,json=unbondingTime,proto3,stdtime" json:"unbonding_time"` - Commission types1.Commission `protobuf:"bytes,10,opt,name=commission,proto3" json:"commission"` - MinSelfDelegation github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,11,opt,name=min_self_delegation,json=minSelfDelegation,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_self_delegation"` - BondDenom string `protobuf:"bytes,12,opt,name=bond_denom,json=bondDenom,proto3" json:"bond_denom,omitempty"` + OperatorAddress string `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` + ConsensusPubkey *types.Any `protobuf:"bytes,2,opt,name=consensus_pubkey,json=consensusPubkey,proto3" json:"consensus_pubkey,omitempty"` + Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"` + Status types1.BondStatus `protobuf:"varint,4,opt,name=status,proto3,enum=cosmos.staking.v1beta1.BondStatus" json:"status,omitempty"` + Tokens cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=tokens,proto3,customtype=cosmossdk.io/math.Int" json:"tokens"` + DelegatorShares cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=delegator_shares,json=delegatorShares,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"delegator_shares"` + Description types1.Description `protobuf:"bytes,7,opt,name=description,proto3" json:"description"` + UnbondingHeight int64 `protobuf:"varint,8,opt,name=unbonding_height,json=unbondingHeight,proto3" json:"unbonding_height,omitempty"` + UnbondingTime time.Time `protobuf:"bytes,9,opt,name=unbonding_time,json=unbondingTime,proto3,stdtime" json:"unbonding_time"` + Commission types1.Commission `protobuf:"bytes,10,opt,name=commission,proto3" json:"commission"` + MinSelfDelegation cosmossdk_io_math.Int `protobuf:"bytes,11,opt,name=min_self_delegation,json=minSelfDelegation,proto3,customtype=cosmossdk.io/math.Int" json:"min_self_delegation"` + BondDenom string `protobuf:"bytes,12,opt,name=bond_denom,json=bondDenom,proto3" json:"bond_denom,omitempty"` } func (m *ValidatorInfo) Reset() { *m = ValidatorInfo{} } @@ -470,67 +470,67 @@ func init() { } var fileDescriptor_c2c118bafa9b671a = []byte{ - // 945 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcd, 0x6e, 0x23, 0xc5, - 0x13, 0xf7, 0x24, 0x59, 0xc7, 0x29, 0xef, 0xc6, 0xde, 0xfe, 0x5b, 0x7f, 0x26, 0x11, 0xd8, 0xc1, - 0x8b, 0x20, 0x20, 0x65, 0x46, 0x09, 0xe2, 0x40, 0xd8, 0x4b, 0x1c, 0x23, 0x25, 0x0a, 0x1f, 0xcb, - 0x78, 0x17, 0x04, 0x12, 0x1a, 0x8d, 0x67, 0x3a, 0xe3, 0xc6, 0x33, 0xdd, 0xd6, 0x74, 0x8f, 0xc1, - 0x6f, 0x80, 0x04, 0x87, 0x3d, 0xc2, 0x6d, 0x1f, 0x62, 0x1f, 0x62, 0xc5, 0x69, 0xb5, 0x27, 0x84, - 0xc4, 0x82, 0x92, 0x0b, 0x07, 0x1e, 0x02, 0xf5, 0xc7, 0xd8, 0x8e, 0xa3, 0x1c, 0x40, 0x3e, 0xd9, - 0xf5, 0xf5, 0xeb, 0xaa, 0xfa, 0x55, 0x95, 0x0d, 0xf7, 0xd2, 0x3c, 0x11, 0x84, 0x8b, 0x60, 0x48, - 0x68, 0xec, 0x8e, 0xf7, 0x5d, 0x25, 0xfb, 0x46, 0xe1, 0x8c, 0x32, 0x26, 0x18, 0xaa, 0xcd, 0x3b, - 0x39, 0xe3, 0xfd, 0xed, 0x46, 0xcc, 0x62, 0xa6, 0x6c, 0xae, 0xfc, 0xa6, 0xdd, 0xb6, 0xb7, 0x42, - 0xc6, 0x53, 0xc6, 0x7d, 0x6d, 0xd0, 0x82, 0x31, 0x35, 0xb5, 0xe4, 0xf6, 0x03, 0x8e, 0xdd, 0xf1, - 0x7e, 0x1f, 0x8b, 0x60, 0xdf, 0x0d, 0x19, 0xa1, 0xc6, 0xfe, 0x86, 0xb1, 0xcf, 0x12, 0xd1, 0x2e, - 0x57, 0xf2, 0xd8, 0x6e, 0xc5, 0x8c, 0xc5, 0x09, 0x76, 0x95, 0xd4, 0xcf, 0xcf, 0x5d, 0x41, 0x52, - 0xcc, 0x45, 0x90, 0x8e, 0x8a, 0x0c, 0x16, 0x1d, 0x02, 0x3a, 0xd1, 0xa6, 0xf6, 0xef, 0x16, 0xd4, - 0x3f, 0x96, 0x65, 0xf4, 0x34, 0xe4, 0x31, 0x23, 0x14, 0x35, 0xe0, 0x56, 0x84, 0x29, 0x4b, 0x6d, - 0x6b, 0xc7, 0xda, 0xdd, 0xf0, 0xb4, 0x80, 0x1e, 0x42, 0x39, 0x48, 0x59, 0x4e, 0x85, 0xbd, 0x22, - 0xd5, 0x9d, 0xfb, 0xcf, 0x5e, 0xb6, 0x4a, 0xbf, 0xbd, 0x6c, 0xbd, 0x19, 0x13, 0x31, 0xc8, 0xfb, - 0x4e, 0xc8, 0x52, 0x53, 0x9d, 0xf9, 0xd8, 0xe3, 0xd1, 0xd0, 0x15, 0x93, 0x11, 0xe6, 0xce, 0x29, - 0x15, 0x2f, 0x9e, 0xee, 0x81, 0x29, 0xfe, 0x94, 0x0a, 0xcf, 0x60, 0xa1, 0xaf, 0xa1, 0xda, 0x67, - 0x34, 0xf2, 0xbf, 0xc5, 0x24, 0x1e, 0x08, 0x7b, 0xf5, 0x5f, 0x43, 0x77, 0x71, 0x38, 0x07, 0xdd, - 0xc5, 0xa1, 0x07, 0x12, 0xf0, 0x0b, 0x85, 0xd7, 0xfe, 0x14, 0xca, 0x1f, 0xb1, 0x70, 0x78, 0xda, - 0x45, 0xef, 0xc0, 0xdd, 0x19, 0x89, 0x38, 0xf3, 0x83, 0x28, 0xca, 0x4c, 0x81, 0x9a, 0xc8, 0x9e, - 0xd2, 0x1f, 0x45, 0x51, 0x86, 0xb6, 0xa0, 0x32, 0x0e, 0x12, 0xed, 0xa2, 0x8a, 0xf5, 0xd6, 0xc7, - 0x41, 0x22, 0x4d, 0xed, 0x9f, 0x17, 0x1a, 0x26, 0xd1, 0xd1, 0x7b, 0x50, 0x4e, 0xd4, 0x2b, 0x0a, - 0xb0, 0x7a, 0xf0, 0x8a, 0xb3, 0x30, 0x1a, 0x8e, 0x4e, 0xa2, 0xb3, 0x26, 0x0b, 0xf3, 0x8c, 0x33, - 0x3a, 0x81, 0xaa, 0xfc, 0x86, 0x23, 0x5f, 0x72, 0xae, 0x5e, 0xaa, 0x1e, 0xbc, 0x7e, 0x2d, 0x76, - 0x91, 0x1f, 0x83, 0x02, 0x3a, 0x56, 0x6a, 0x0e, 0xd7, 0xbe, 0x7f, 0xd2, 0x2a, 0xb5, 0x1f, 0xc1, - 0xd6, 0xe7, 0x41, 0x42, 0xa2, 0x40, 0xb0, 0xec, 0x1a, 0xa9, 0xf3, 0x35, 0x59, 0x57, 0x6a, 0x42, - 0xaf, 0x01, 0xc8, 0x04, 0x7c, 0x4d, 0xba, 0x2e, 0x78, 0x43, 0x6a, 0xba, 0x52, 0xd1, 0xfe, 0x0c, - 0x2a, 0x8f, 0x68, 0xb2, 0xec, 0x2e, 0xa2, 0xf9, 0x0c, 0x35, 0x3e, 0xfa, 0x00, 0x2a, 0x39, 0xbd, - 0xd2, 0xc9, 0xad, 0x6b, 0xdd, 0x28, 0x52, 0x31, 0x5d, 0x98, 0x06, 0xa0, 0xfb, 0xb0, 0x8e, 0xa9, - 0xc8, 0x08, 0xe6, 0xf6, 0xca, 0xce, 0xea, 0x6e, 0xf5, 0xe0, 0xd5, 0x1b, 0x62, 0x3f, 0xa4, 0x22, - 0x9b, 0x98, 0xf0, 0x22, 0xe4, 0xb0, 0x22, 0x3b, 0xf8, 0x93, 0xec, 0xe2, 0x8f, 0x16, 0x54, 0xe7, - 0x1c, 0xd1, 0x5b, 0x50, 0x0b, 0x33, 0x1c, 0x08, 0xc2, 0xa8, 0x3f, 0xd0, 0x53, 0x2a, 0x73, 0x5b, - 0xf5, 0x36, 0x0b, 0xf5, 0x89, 0xd2, 0xa2, 0x4f, 0x60, 0x53, 0x27, 0x43, 0x68, 0xfc, 0x9f, 0x18, - 0xbd, 0x33, 0x0d, 0xd7, 0xa4, 0xaa, 0x74, 0x7e, 0xb0, 0xa0, 0xb1, 0xe8, 0x7f, 0x4a, 0xcf, 0xd9, - 0x0d, 0x5b, 0xba, 0xb0, 0x4f, 0x2b, 0x4b, 0xde, 0xa7, 0xbf, 0xcb, 0x70, 0x67, 0x3a, 0x63, 0x2a, - 0x8d, 0x63, 0xa8, 0xb3, 0x11, 0xce, 0xa4, 0xac, 0xa8, 0xc6, 0x9c, 0xeb, 0x8c, 0x3a, 0xf6, 0x8b, - 0xa7, 0x7b, 0x0d, 0x83, 0x73, 0xa4, 0x2d, 0x3d, 0x91, 0x11, 0x1a, 0x7b, 0xb5, 0x22, 0xc2, 0xa8, - 0xd1, 0x97, 0x50, 0x0f, 0x19, 0xe5, 0x98, 0xf2, 0x9c, 0xfb, 0xa3, 0xbc, 0x3f, 0xc4, 0x13, 0xd3, - 0xbc, 0x86, 0xa3, 0x8f, 0x97, 0x53, 0x1c, 0x2f, 0xe7, 0x88, 0x4e, 0x3a, 0xf6, 0x2f, 0x33, 0xe8, - 0x30, 0x9b, 0x8c, 0x04, 0x73, 0x1e, 0xe4, 0xfd, 0x33, 0x3c, 0xf1, 0x6a, 0x53, 0x9c, 0x07, 0x0a, - 0x06, 0xfd, 0x1f, 0xca, 0xdf, 0x04, 0x24, 0xc1, 0x91, 0xba, 0x2d, 0x15, 0xcf, 0x48, 0xe8, 0x10, - 0xca, 0x5c, 0x04, 0x22, 0xe7, 0xf6, 0xda, 0x8e, 0xb5, 0xbb, 0x79, 0xd0, 0x76, 0x0c, 0xde, 0x8c, - 0x27, 0x75, 0x6c, 0x9d, 0x0e, 0xa3, 0x51, 0x4f, 0x79, 0x7a, 0x26, 0x42, 0x9e, 0x42, 0xc1, 0x86, - 0x98, 0x72, 0xfb, 0xd6, 0x32, 0x4e, 0xa1, 0xc6, 0x42, 0x31, 0xd4, 0x23, 0x9c, 0xe0, 0x58, 0xb5, - 0x92, 0x0f, 0x82, 0x0c, 0x73, 0xbb, 0xbc, 0x04, 0xfe, 0x6a, 0x53, 0xd4, 0x9e, 0x02, 0x45, 0x67, - 0x50, 0x8d, 0x30, 0x0f, 0x33, 0x32, 0x92, 0xd3, 0x6b, 0xaf, 0xab, 0x46, 0xdf, 0xbb, 0xa9, 0xfe, - 0xee, 0xcc, 0xd5, 0xcc, 0xe9, 0x7c, 0x34, 0x7a, 0x1b, 0xea, 0x39, 0x95, 0x13, 0x22, 0xa7, 0xde, - 0xec, 0x47, 0x45, 0xed, 0x47, 0x6d, 0xaa, 0x37, 0x0b, 0x72, 0x26, 0x17, 0xa4, 0x70, 0x95, 0x3f, - 0x52, 0xf6, 0x86, 0x7a, 0x7a, 0xfb, 0x1a, 0xc7, 0x0f, 0x8b, 0x5f, 0xb0, 0x4e, 0x45, 0xbe, 0xf8, - 0xf8, 0x8f, 0x96, 0x25, 0xb7, 0xc3, 0xc4, 0x4a, 0x2b, 0x3a, 0x91, 0x47, 0x2b, 0x4d, 0x09, 0xe7, - 0xb2, 0x06, 0x50, 0x40, 0x37, 0x72, 0x78, 0x3c, 0xf5, 0x2c, 0x8e, 0xe7, 0x2c, 0x16, 0x25, 0xf0, - 0xbf, 0x94, 0x50, 0x9f, 0xe3, 0xe4, 0xdc, 0x37, 0xad, 0x92, 0x90, 0xd5, 0x25, 0x50, 0x7b, 0x37, - 0x25, 0xb4, 0x87, 0x93, 0xf3, 0xee, 0x14, 0x56, 0x1e, 0x5b, 0xb5, 0xa0, 0x7a, 0x77, 0x6f, 0xeb, - 0x63, 0x2b, 0x35, 0xea, 0xd8, 0x1e, 0xde, 0x2e, 0xee, 0xd0, 0x5f, 0x4f, 0x5a, 0xa5, 0x4e, 0xef, - 0xd9, 0x45, 0xd3, 0x7a, 0x7e, 0xd1, 0xb4, 0xfe, 0xbc, 0x68, 0x5a, 0x8f, 0x2f, 0x9b, 0xa5, 0xe7, - 0x97, 0xcd, 0xd2, 0xaf, 0x97, 0xcd, 0xd2, 0x57, 0xef, 0xcf, 0xe5, 0x93, 0xe1, 0x20, 0x21, 0x4c, - 0xe0, 0x70, 0xa0, 0xff, 0xa7, 0xec, 0x15, 0xff, 0x17, 0xbe, 0x5b, 0x90, 0x55, 0x9a, 0xfd, 0xb2, - 0x6a, 0xf3, 0xbb, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xd1, 0xd6, 0x5f, 0xfa, 0xe5, 0x08, 0x00, - 0x00, + // 953 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xbf, 0x6f, 0x23, 0x45, + 0x14, 0xf6, 0x26, 0x39, 0xc7, 0x19, 0xdf, 0xc5, 0xbe, 0xc1, 0xc0, 0x26, 0x80, 0x1d, 0x7c, 0x48, + 0x04, 0x50, 0x76, 0xe5, 0x20, 0x0a, 0x02, 0x4d, 0x1c, 0x23, 0x25, 0xca, 0x01, 0xc7, 0x9a, 0x03, + 0xf1, 0x43, 0x5a, 0x8d, 0x77, 0x27, 0xeb, 0xc1, 0xbb, 0x33, 0xd6, 0xce, 0xac, 0xc1, 0x1d, 0x25, + 0x05, 0xc5, 0x95, 0xd0, 0xdd, 0x1f, 0x71, 0x3d, 0xa2, 0x3b, 0x51, 0x9d, 0xae, 0x42, 0x14, 0x07, + 0x4a, 0x1a, 0xfe, 0x0c, 0x34, 0x3f, 0x76, 0xed, 0xd8, 0x4a, 0x41, 0x74, 0x9d, 0xe7, 0xbd, 0xf7, + 0x7d, 0xf3, 0xde, 0xfb, 0xde, 0xbc, 0x35, 0xb8, 0x93, 0x64, 0xb1, 0x20, 0x5c, 0xa0, 0x11, 0xa1, + 0x91, 0x3b, 0xe9, 0xb8, 0xea, 0xec, 0x1b, 0x83, 0x33, 0x4e, 0x99, 0x60, 0xb0, 0x36, 0x1f, 0xe4, + 0x4c, 0x3a, 0xdb, 0x8d, 0x88, 0x45, 0x4c, 0xf9, 0x5c, 0xf9, 0x4b, 0x87, 0x6d, 0x6f, 0x05, 0x8c, + 0x27, 0x8c, 0xfb, 0xda, 0xa1, 0x0f, 0xc6, 0xd5, 0xd4, 0x27, 0x77, 0x80, 0x38, 0x76, 0x27, 0x9d, + 0x01, 0x16, 0xa8, 0xe3, 0x06, 0x8c, 0x50, 0xe3, 0x7f, 0xc3, 0xf8, 0x67, 0x89, 0xe8, 0x90, 0x4b, + 0x79, 0x6c, 0xb7, 0x22, 0xc6, 0xa2, 0x18, 0xbb, 0xea, 0x34, 0xc8, 0xce, 0x5c, 0x41, 0x12, 0xcc, + 0x05, 0x4a, 0xc6, 0x79, 0x06, 0x8b, 0x01, 0x88, 0x4e, 0xb5, 0xab, 0xfd, 0xbb, 0x05, 0xea, 0x1f, + 0xcb, 0x32, 0xfa, 0x9a, 0xf2, 0x88, 0x11, 0x0a, 0x1b, 0xe0, 0x46, 0x88, 0x29, 0x4b, 0x6c, 0x6b, + 0xc7, 0xda, 0xdd, 0xf0, 0xf4, 0x01, 0x1e, 0x81, 0x32, 0x4a, 0x58, 0x46, 0x85, 0xbd, 0x22, 0xcd, + 0xdd, 0x77, 0x1e, 0x3f, 0x6b, 0x95, 0xfe, 0x7a, 0xd6, 0x7a, 0x51, 0x27, 0xc9, 0xc3, 0x91, 0x43, + 0x98, 0x9b, 0x20, 0x31, 0x74, 0x4e, 0xa8, 0x78, 0xfa, 0x68, 0x0f, 0x98, 0x5a, 0x4f, 0xa8, 0xf0, + 0x0c, 0x14, 0x7a, 0xa0, 0x3a, 0x60, 0x34, 0xf4, 0xbf, 0xc7, 0x24, 0x1a, 0x0a, 0x7b, 0x55, 0x31, + 0x75, 0x0c, 0xd3, 0x2b, 0xcb, 0x4c, 0x77, 0x71, 0x84, 0x82, 0x69, 0x0f, 0x07, 0x73, 0x7c, 0x3d, + 0x1c, 0x78, 0x40, 0xb2, 0x7c, 0xa9, 0x48, 0xda, 0x9f, 0x82, 0xf2, 0x5d, 0x16, 0x8c, 0x4e, 0x7a, + 0xf0, 0x6d, 0x70, 0x7b, 0x26, 0x14, 0x4e, 0x7d, 0x14, 0x86, 0xa9, 0x29, 0x42, 0x8b, 0xd5, 0x57, + 0xf6, 0xc3, 0x30, 0x4c, 0xe1, 0x16, 0xa8, 0x4c, 0x50, 0xac, 0x43, 0x54, 0x41, 0xde, 0xfa, 0x04, + 0xc5, 0xd2, 0xd5, 0xfe, 0x75, 0xa1, 0x29, 0x92, 0x1d, 0xbe, 0x07, 0xca, 0xb1, 0xba, 0x45, 0x11, + 0x56, 0xf7, 0x5f, 0x76, 0x16, 0xe4, 0x77, 0x74, 0x12, 0xdd, 0x35, 0x59, 0x8d, 0x67, 0x82, 0xe1, + 0x31, 0xa8, 0xca, 0x5f, 0x38, 0xf4, 0xa5, 0xae, 0xea, 0xa6, 0xea, 0xfe, 0xeb, 0x4b, 0xd8, 0x45, + 0x0d, 0x0c, 0x0b, 0xd0, 0x58, 0x69, 0x39, 0x58, 0xfb, 0xe9, 0x61, 0xab, 0xd4, 0xbe, 0x0f, 0xb6, + 0xbe, 0x40, 0x31, 0x09, 0x91, 0x60, 0xe9, 0x92, 0x70, 0xf3, 0x35, 0x59, 0x97, 0x6a, 0x82, 0xaf, + 0x01, 0x20, 0x13, 0xf0, 0xb5, 0xb0, 0xba, 0xe0, 0x0d, 0x69, 0xe9, 0x49, 0x43, 0xfb, 0x33, 0x50, + 0xb9, 0x4f, 0xe3, 0xe7, 0xdd, 0x45, 0x38, 0x9f, 0xa1, 0xe6, 0x87, 0x1f, 0x80, 0x4a, 0x46, 0x2f, + 0x75, 0x72, 0x6b, 0xa9, 0x1b, 0x79, 0x2a, 0xa6, 0x0b, 0x05, 0x00, 0x7e, 0x08, 0xd6, 0x31, 0x15, + 0x29, 0xc1, 0xdc, 0x5e, 0xd9, 0x59, 0xdd, 0xad, 0xee, 0xbf, 0x7a, 0x05, 0xf6, 0x23, 0x2a, 0xd2, + 0xa9, 0x81, 0xe7, 0x90, 0x83, 0x8a, 0xec, 0xe0, 0x2f, 0xb2, 0x8b, 0x3f, 0x5b, 0xa0, 0x3a, 0x17, + 0x08, 0xdf, 0x04, 0xb5, 0x20, 0xc5, 0x48, 0x10, 0x46, 0xfd, 0xa1, 0x1e, 0x4d, 0x99, 0xdb, 0xaa, + 0xb7, 0x99, 0x9b, 0x8f, 0x95, 0x15, 0x7e, 0x02, 0x36, 0x75, 0x32, 0x84, 0x46, 0xd7, 0x52, 0xf4, + 0x56, 0x01, 0xd7, 0xa2, 0xaa, 0x74, 0x7e, 0xb4, 0x40, 0x63, 0x31, 0xfe, 0x84, 0x9e, 0xb1, 0x2b, + 0x5e, 0xe2, 0xc2, 0x23, 0x5a, 0x79, 0x1e, 0x8f, 0xe8, 0xb7, 0x32, 0xb8, 0x55, 0x0c, 0x96, 0xba, + 0xfb, 0x08, 0xd4, 0xd9, 0x18, 0xa7, 0xf2, 0xac, 0xf4, 0xc5, 0x9c, 0xeb, 0x34, 0xba, 0xf6, 0xd3, + 0x47, 0x7b, 0x0d, 0xc3, 0x73, 0xa8, 0x3d, 0x7d, 0x91, 0x12, 0x1a, 0x79, 0xb5, 0x1c, 0x61, 0xcc, + 0xf0, 0x2b, 0x50, 0x0f, 0x18, 0xe5, 0x98, 0xf2, 0x8c, 0xfb, 0xe3, 0x6c, 0x30, 0xc2, 0x53, 0xd3, + 0xb1, 0x86, 0xa3, 0xb7, 0x92, 0x93, 0x6f, 0x25, 0xe7, 0x90, 0x4e, 0xbb, 0xf6, 0x1f, 0x33, 0xea, + 0x20, 0x9d, 0x8e, 0x05, 0x73, 0xee, 0x65, 0x83, 0x53, 0x3c, 0xf5, 0x6a, 0x05, 0xcf, 0x3d, 0x45, + 0x03, 0x5f, 0x02, 0xe5, 0xef, 0x10, 0x89, 0x71, 0xa8, 0xb6, 0x48, 0xc5, 0x33, 0x27, 0x78, 0x00, + 0xca, 0x5c, 0x20, 0x91, 0x71, 0x7b, 0x6d, 0xc7, 0xda, 0xdd, 0xdc, 0x6f, 0x3b, 0x86, 0x6f, 0x26, + 0x8e, 0xda, 0xa2, 0x4e, 0x97, 0xd1, 0xb0, 0xaf, 0x22, 0x3d, 0x83, 0x90, 0x3b, 0x4e, 0xb0, 0x11, + 0xa6, 0xdc, 0xbe, 0x71, 0x8d, 0x1d, 0xa7, 0xa1, 0xf0, 0x5b, 0x50, 0x0f, 0x71, 0x8c, 0x23, 0xd5, + 0x39, 0x3e, 0x44, 0x29, 0xe6, 0x76, 0xf9, 0xba, 0x1a, 0xd5, 0x0a, 0xaa, 0xbe, 0x62, 0x82, 0xa7, + 0xa0, 0x1a, 0x62, 0x1e, 0xa4, 0x64, 0x2c, 0xc7, 0xd2, 0x5e, 0x57, 0xcd, 0xbc, 0x73, 0x55, 0x8d, + 0xbd, 0x59, 0xa8, 0x19, 0xc0, 0x79, 0x34, 0x7c, 0x0b, 0xd4, 0x33, 0x2a, 0xa7, 0x40, 0x8e, 0xb3, + 0x19, 0xfc, 0x8a, 0x1a, 0xfc, 0x5a, 0x61, 0x37, 0x93, 0x7f, 0x2a, 0x27, 0x3f, 0x0f, 0x95, 0x5f, + 0x18, 0x7b, 0x43, 0x5d, 0xbd, 0xbd, 0xa4, 0xe3, 0xe7, 0xf9, 0xe7, 0xa7, 0x5b, 0x91, 0x37, 0x3e, + 0xf8, 0xbb, 0x65, 0xc9, 0xb1, 0x37, 0x58, 0xe9, 0x85, 0xc7, 0x72, 0x1b, 0x25, 0x09, 0xe1, 0x5c, + 0xd6, 0x00, 0x14, 0xd1, 0x95, 0x3a, 0x1d, 0x15, 0x91, 0xf9, 0x56, 0x9c, 0x61, 0xe1, 0x37, 0xe0, + 0x85, 0x84, 0x50, 0x9f, 0xe3, 0xf8, 0xcc, 0x37, 0xad, 0x92, 0x94, 0xd5, 0xff, 0x2f, 0xdf, 0xed, + 0x84, 0xd0, 0x3e, 0x8e, 0xcf, 0x7a, 0x05, 0x8b, 0x5c, 0x9a, 0xea, 0xa1, 0xe9, 0x37, 0x78, 0x53, + 0x2f, 0x4d, 0x69, 0x51, 0x4b, 0xf3, 0xe0, 0x66, 0xbe, 0x4f, 0xfe, 0x7d, 0xd8, 0x2a, 0x75, 0xfb, + 0x8f, 0xcf, 0x9b, 0xd6, 0x93, 0xf3, 0xa6, 0xf5, 0xcf, 0x79, 0xd3, 0x7a, 0x70, 0xd1, 0x2c, 0x3d, + 0xb9, 0x68, 0x96, 0xfe, 0xbc, 0x68, 0x96, 0xbe, 0x7e, 0x3f, 0x22, 0x62, 0x98, 0x0d, 0x9c, 0x80, + 0x25, 0x6e, 0x8a, 0x51, 0x4c, 0x98, 0xc0, 0xc1, 0x50, 0xff, 0xa7, 0xd8, 0xcb, 0xbf, 0xed, 0x3f, + 0x2c, 0x9c, 0xc5, 0x74, 0x8c, 0xf9, 0xa0, 0xac, 0xba, 0xfa, 0xee, 0x7f, 0x01, 0x00, 0x00, 0xff, + 0xff, 0x43, 0xc9, 0xdd, 0x44, 0x91, 0x08, 0x00, 0x00, } func (m *MultiStakingCoin) Marshal() (dAtA []byte, err error) { diff --git a/x/multi-staking/types/multi_staking_coin.go b/x/multi-staking/types/multi_staking_coin.go index dc53691d..f1d44856 100644 --- a/x/multi-staking/types/multi_staking_coin.go +++ b/x/multi-staking/types/multi_staking_coin.go @@ -19,7 +19,7 @@ func (coin MultiStakingCoin) ToCoin() sdk.Coin { return sdk.NewCoin(coin.Denom, coin.Amount) } -func NewMultiStakingCoin(denom string, amount math.Int, weight sdk.Dec) MultiStakingCoin { +func NewMultiStakingCoin(denom string, amount math.Int, weight math.LegacyDec) MultiStakingCoin { return MultiStakingCoin{Denom: denom, Amount: amount, BondWeight: weight} } diff --git a/x/multi-staking/types/multi_staking_coin_test.go b/x/multi-staking/types/multi_staking_coin_test.go index 99da8cf2..e89eef58 100644 --- a/x/multi-staking/types/multi_staking_coin_test.go +++ b/x/multi-staking/types/multi_staking_coin_test.go @@ -7,8 +7,6 @@ import ( "github.com/stretchr/testify/require" "cosmossdk.io/math" - - sdk "github.com/cosmos/cosmos-sdk/types" ) func TestBondValue(t *testing.T) { @@ -19,13 +17,13 @@ func TestBondValue(t *testing.T) { }{ { name: "3001 x 0.3 = 900", - msCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(3001), sdk.MustNewDecFromStr("0.3")), - expBondValue: sdk.NewInt(900), + msCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(3001), math.LegacyMustNewDecFromStr("0.3")), + expBondValue: math.NewInt(900), }, { name: "604 x 0.2 = 120", - msCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(604), sdk.MustNewDecFromStr("0.2")), - expBondValue: sdk.NewInt(120), + msCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(604), math.LegacyMustNewDecFromStr("0.2")), + expBondValue: math.NewInt(120), }, } @@ -46,29 +44,29 @@ func TestSafeAdd(t *testing.T) { }{ { name: "success", - originMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(100000), sdk.MustNewDecFromStr("0.3")), - addingMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(23456), sdk.MustNewDecFromStr("0.3")), - expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(123456), sdk.MustNewDecFromStr("0.3")), + originMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(100000), math.LegacyMustNewDecFromStr("0.3")), + addingMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(23456), math.LegacyMustNewDecFromStr("0.3")), + expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(123456), math.LegacyMustNewDecFromStr("0.3")), expErr: false, }, { name: "success and change bond weight", - originMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(100000), sdk.OneDec()), - addingMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(200000), sdk.MustNewDecFromStr("0.25")), - expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(300000), sdk.MustNewDecFromStr("0.5")), + originMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(100000), math.LegacyOneDec()), + addingMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(200000), math.LegacyMustNewDecFromStr("0.25")), + expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(300000), math.LegacyMustNewDecFromStr("0.5")), expErr: false, }, { name: "success from zero coin", - originMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.ZeroInt(), sdk.MustNewDecFromStr("0.3")), - addingMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(23456), sdk.MustNewDecFromStr("0.3")), - expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(23456), sdk.MustNewDecFromStr("0.3")), + originMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.ZeroInt(), math.LegacyMustNewDecFromStr("0.3")), + addingMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(23456), math.LegacyMustNewDecFromStr("0.3")), + expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(23456), math.LegacyMustNewDecFromStr("0.3")), expErr: false, }, { name: "denom mismatch", - originMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(100000), sdk.MustNewDecFromStr("0.3")), - addingMSCoin: types.NewMultiStakingCoin(MultiStakingDenomB, sdk.NewInt(23456), sdk.MustNewDecFromStr("0.3")), + originMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(100000), math.LegacyMustNewDecFromStr("0.3")), + addingMSCoin: types.NewMultiStakingCoin(MultiStakingDenomB, math.NewInt(23456), math.LegacyMustNewDecFromStr("0.3")), expErr: true, }, } @@ -99,21 +97,21 @@ func TestSafeSub(t *testing.T) { }{ { name: "success", - msCoinA: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(123456), sdk.MustNewDecFromStr("0.3")), - msCoinB: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(23456), sdk.MustNewDecFromStr("0.3")), - expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(100000), sdk.MustNewDecFromStr("0.3")), + msCoinA: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(123456), math.LegacyMustNewDecFromStr("0.3")), + msCoinB: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(23456), math.LegacyMustNewDecFromStr("0.3")), + expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(100000), math.LegacyMustNewDecFromStr("0.3")), expErr: false, }, { name: "denom mismatch", - msCoinA: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(100000), sdk.MustNewDecFromStr("0.3")), - msCoinB: types.NewMultiStakingCoin(MultiStakingDenomB, sdk.NewInt(23456), sdk.MustNewDecFromStr("0.3")), + msCoinA: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(100000), math.LegacyMustNewDecFromStr("0.3")), + msCoinB: types.NewMultiStakingCoin(MultiStakingDenomB, math.NewInt(23456), math.LegacyMustNewDecFromStr("0.3")), expErr: true, }, { name: "insufficient amount", - msCoinA: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(100000), sdk.MustNewDecFromStr("0.3")), - msCoinB: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(234567), sdk.MustNewDecFromStr("0.3")), + msCoinA: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(100000), math.LegacyMustNewDecFromStr("0.3")), + msCoinB: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(234567), math.LegacyMustNewDecFromStr("0.3")), expErr: true, }, } diff --git a/x/multi-staking/types/proposal.go b/x/multi-staking/types/proposal.go index abaab189..5500397c 100644 --- a/x/multi-staking/types/proposal.go +++ b/x/multi-staking/types/proposal.go @@ -4,8 +4,8 @@ import ( "fmt" sdkerrors "cosmossdk.io/errors" + "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) @@ -27,7 +27,7 @@ func init() { } // NewAddMultiStakingCoinProposal returns new instance of AddMultiStakingCoinProposal -func NewAddMultiStakingCoinProposal(title, description, denom string, bondWeight sdk.Dec) govv1beta1.Content { +func NewAddMultiStakingCoinProposal(title, description, denom string, bondWeight math.LegacyDec) govv1beta1.Content { return &AddMultiStakingCoinProposal{ Title: title, Description: description, @@ -74,7 +74,7 @@ func (abtp AddMultiStakingCoinProposal) String() string { } // NewUpdateBondWeightProposal returns new instance of UpdateBondWeightProposal -func NewUpdateBondWeightProposal(title, description, denom string, bondWeight sdk.Dec) govv1beta1.Content { +func NewUpdateBondWeightProposal(title, description, denom string, bondWeight math.LegacyDec) govv1beta1.Content { return &UpdateBondWeightProposal{ Title: title, Description: description, diff --git a/x/multi-staking/types/proposal_test.go b/x/multi-staking/types/proposal_test.go index 0abfada7..1e66acb8 100644 --- a/x/multi-staking/types/proposal_test.go +++ b/x/multi-staking/types/proposal_test.go @@ -6,7 +6,8 @@ import ( "github.com/realio-tech/multi-staking-module/x/multi-staking/types" "github.com/stretchr/testify/suite" - sdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/math" + govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) @@ -26,7 +27,7 @@ func (suite *ProposalTestSuite) TestKeysTypes() { } func (suite *ProposalTestSuite) TestProposalString() { - testTokenWeight := sdk.OneDec() + testTokenWeight := math.LegacyOneDec() testCases := []struct { msg string proposal govv1beta1.Content @@ -55,16 +56,16 @@ func (suite *ProposalTestSuite) TestAddMultiStakingCoinProposal() { title string description string denom string - bondWeight sdk.Dec + bondWeight math.LegacyDec expectPass bool }{ // Valid tests - {msg: "Add bond token", title: "test", description: "test desc", denom: "token", bondWeight: sdk.OneDec(), expectPass: true}, + {msg: "Add bond token", title: "test", description: "test desc", denom: "token", bondWeight: math.LegacyOneDec(), expectPass: true}, // Invalid tests - {msg: "Add bond token - invalid token", title: "test", description: "test desc", denom: "", bondWeight: sdk.OneDec(), expectPass: false}, - {msg: "Add bond token - negative weight", title: "test", description: "test desc", denom: "token", bondWeight: sdk.MustNewDecFromStr("-1"), expectPass: false}, - {msg: "Add bond token - zero weight", title: "test", description: "test desc", denom: "token", bondWeight: sdk.ZeroDec(), expectPass: false}, + {msg: "Add bond token - invalid token", title: "test", description: "test desc", denom: "", bondWeight: math.LegacyOneDec(), expectPass: false}, + {msg: "Add bond token - negative weight", title: "test", description: "test desc", denom: "token", bondWeight: math.LegacyMustNewDecFromStr("-1"), expectPass: false}, + {msg: "Add bond token - zero weight", title: "test", description: "test desc", denom: "token", bondWeight: math.LegacyZeroDec(), expectPass: false}, } for i, tc := range testCases { @@ -85,16 +86,16 @@ func (suite *ProposalTestSuite) TestUpdateBondWeightProposal() { title string description string denom string - bondWeight sdk.Dec + bondWeight math.LegacyDec expectPass bool }{ // Valid tests - {msg: "Change bond token weight", title: "test", description: "test desc", denom: "token", bondWeight: sdk.OneDec(), expectPass: true}, + {msg: "Change bond token weight", title: "test", description: "test desc", denom: "token", bondWeight: math.LegacyOneDec(), expectPass: true}, // Invalid tests - {msg: "Change bond token weight - invalid token", title: "test", description: "test desc", denom: "", bondWeight: sdk.OneDec(), expectPass: false}, - {msg: "Change bond token weight - negative weight", title: "test", description: "test desc", denom: "token", bondWeight: sdk.MustNewDecFromStr("-1"), expectPass: false}, - {msg: "Change bond token weight - zero weight", title: "test", description: "test desc", denom: "token", bondWeight: sdk.ZeroDec(), expectPass: false}, + {msg: "Change bond token weight - invalid token", title: "test", description: "test desc", denom: "", bondWeight: math.LegacyOneDec(), expectPass: false}, + {msg: "Change bond token weight - negative weight", title: "test", description: "test desc", denom: "token", bondWeight: math.LegacyMustNewDecFromStr("-1"), expectPass: false}, + {msg: "Change bond token weight - zero weight", title: "test", description: "test desc", denom: "token", bondWeight: math.LegacyZeroDec(), expectPass: false}, } for i, tc := range testCases { diff --git a/x/multi-staking/types/proposals.pb.go b/x/multi-staking/types/proposals.pb.go index d031ecea..d7254b78 100644 --- a/x/multi-staking/types/proposals.pb.go +++ b/x/multi-staking/types/proposals.pb.go @@ -4,9 +4,9 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -28,10 +28,10 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // AddMultiStakingCoinProposal is a gov v1beta1 Content type to add a token as a // bond token type AddMultiStakingCoinProposal struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Denom string `protobuf:"bytes,3,opt,name=denom,proto3" json:"denom,omitempty"` - BondWeight *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=bond_weight,json=bondWeight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bond_weight,omitempty"` + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Denom string `protobuf:"bytes,3,opt,name=denom,proto3" json:"denom,omitempty"` + BondWeight *cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=bond_weight,json=bondWeight,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"bond_weight,omitempty"` } func (m *AddMultiStakingCoinProposal) Reset() { *m = AddMultiStakingCoinProposal{} } @@ -69,10 +69,10 @@ var xxx_messageInfo_AddMultiStakingCoinProposal proto.InternalMessageInfo // UpdateBondWeightProposal is a gov v1beta1 Content type to change the // weight of a bond token type UpdateBondWeightProposal struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Denom string `protobuf:"bytes,3,opt,name=denom,proto3" json:"denom,omitempty"` - UpdatedBondWeight *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=updated_bond_weight,json=updatedBondWeight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"updated_bond_weight,omitempty"` + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Denom string `protobuf:"bytes,3,opt,name=denom,proto3" json:"denom,omitempty"` + UpdatedBondWeight *cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=updated_bond_weight,json=updatedBondWeight,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"updated_bond_weight,omitempty"` } func (m *UpdateBondWeightProposal) Reset() { *m = UpdateBondWeightProposal{} } @@ -115,30 +115,31 @@ func init() { func init() { proto.RegisterFile("multistaking/v1/proposals.proto", fileDescriptor_5028153a52b38c49) } var fileDescriptor_5028153a52b38c49 = []byte{ - // 368 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x52, 0xbf, 0x4b, 0xc3, 0x40, - 0x14, 0x4e, 0xfc, 0x05, 0x5e, 0x07, 0x31, 0x76, 0x88, 0x15, 0x92, 0xd2, 0x41, 0x44, 0x48, 0x42, - 0x70, 0x51, 0x37, 0xd3, 0xae, 0x82, 0xb4, 0x88, 0xe8, 0x52, 0x92, 0xdc, 0x91, 0x1c, 0x4d, 0xf2, - 0x42, 0xee, 0x1a, 0xf5, 0x3f, 0x70, 0x74, 0x74, 0xec, 0x1f, 0xd1, 0x3f, 0x42, 0x9c, 0x8a, 0x93, - 0x38, 0x88, 0xb4, 0x8b, 0xb3, 0x7f, 0x80, 0x48, 0x2e, 0x51, 0x8a, 0xa3, 0xe8, 0x74, 0xf7, 0xdd, - 0xf7, 0xde, 0xf7, 0xbe, 0x77, 0x7c, 0x48, 0x8f, 0x87, 0x11, 0xa7, 0x8c, 0xbb, 0x03, 0x9a, 0x04, - 0x56, 0x6e, 0x5b, 0x69, 0x06, 0x29, 0x30, 0x37, 0x62, 0x66, 0x9a, 0x01, 0x07, 0x65, 0x6d, 0xbe, - 0xc0, 0xcc, 0xed, 0x46, 0x3d, 0x80, 0x00, 0x04, 0x67, 0x15, 0xb7, 0xb2, 0xac, 0xb1, 0xe9, 0x03, - 0x8b, 0x81, 0xf5, 0x4b, 0xa2, 0x04, 0x25, 0xd5, 0x7a, 0x97, 0xd1, 0xd6, 0x11, 0xc6, 0xc7, 0x85, - 0x4e, 0xaf, 0xd4, 0x69, 0x03, 0x4d, 0x4e, 0xaa, 0x41, 0x4a, 0x1d, 0x2d, 0x73, 0xca, 0x23, 0xa2, - 0xca, 0x4d, 0x79, 0x67, 0xb5, 0x5b, 0x02, 0xa5, 0x89, 0x6a, 0x98, 0x30, 0x3f, 0xa3, 0x29, 0xa7, - 0x90, 0xa8, 0x0b, 0x82, 0x9b, 0x7f, 0x2a, 0xfa, 0x30, 0x49, 0x20, 0x56, 0x17, 0xcb, 0x3e, 0x01, - 0x94, 0x73, 0x54, 0xf3, 0x20, 0xc1, 0xfd, 0x4b, 0x42, 0x83, 0x90, 0xab, 0x4b, 0x05, 0xe7, 0xec, - 0x3f, 0xbf, 0xe8, 0xdb, 0x01, 0xe5, 0xe1, 0xd0, 0x33, 0x7d, 0x88, 0x2b, 0x7f, 0xd5, 0x61, 0x30, - 0x3c, 0xb0, 0xf8, 0x75, 0x4a, 0x98, 0xd9, 0x21, 0xfe, 0xe3, 0xd8, 0x40, 0x95, 0xfd, 0x0e, 0xf1, - 0xbb, 0xa8, 0x10, 0x3b, 0x13, 0x5a, 0x87, 0xbb, 0x37, 0x23, 0x5d, 0xba, 0x1b, 0xe9, 0xd2, 0xdb, - 0x48, 0x97, 0x1e, 0xc6, 0x46, 0xa3, 0xaa, 0x0b, 0x20, 0x37, 0x73, 0xdb, 0x23, 0xdc, 0xb5, 0xcd, - 0x36, 0x24, 0x9c, 0x24, 0xbc, 0xf5, 0x21, 0x23, 0xf5, 0x34, 0xc5, 0x2e, 0x27, 0xce, 0xb7, 0xc0, - 0x3f, 0x6d, 0x1c, 0xa2, 0x8d, 0xa1, 0x98, 0x84, 0xfb, 0x7f, 0xb9, 0xf9, 0x7a, 0x25, 0xea, 0xfc, - 0xea, 0x03, 0x9c, 0xde, 0xfd, 0x54, 0x93, 0x27, 0x53, 0x4d, 0x7e, 0x9d, 0x6a, 0xf2, 0xed, 0x4c, - 0x93, 0x26, 0x33, 0x4d, 0x7a, 0x9a, 0x69, 0xd2, 0xc5, 0xc1, 0x9c, 0x9d, 0x8c, 0xb8, 0x11, 0x05, - 0x4e, 0xfc, 0xd0, 0x12, 0x39, 0x33, 0xbe, 0x92, 0x78, 0xf5, 0x03, 0x0b, 0x97, 0xde, 0x8a, 0x48, - 0xd4, 0xde, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6a, 0x2a, 0x5f, 0xbd, 0xb6, 0x02, 0x00, 0x00, + // 372 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x92, 0xbf, 0x4a, 0xfb, 0x50, + 0x14, 0xc7, 0x93, 0xdf, 0x1f, 0xc1, 0xdb, 0x41, 0x8c, 0x1d, 0x62, 0x0b, 0x49, 0xe9, 0x24, 0x42, + 0x12, 0x82, 0x93, 0x6e, 0xa6, 0x1d, 0x55, 0xa4, 0x45, 0x04, 0x41, 0x4a, 0x92, 0x7b, 0x49, 0x2e, + 0x4d, 0x72, 0x42, 0xee, 0x6d, 0xb4, 0x6f, 0xe0, 0xe8, 0xe8, 0xd8, 0x87, 0xe8, 0x43, 0x88, 0x53, + 0x71, 0x12, 0x07, 0x91, 0x76, 0xd0, 0xdd, 0x17, 0x90, 0xe4, 0x46, 0x29, 0x8e, 0x8a, 0xdb, 0xfd, + 0xde, 0xef, 0x39, 0x9f, 0x73, 0x0e, 0x7c, 0x91, 0x1e, 0x8f, 0x22, 0x4e, 0x19, 0x77, 0x87, 0x34, + 0x09, 0xac, 0xdc, 0xb6, 0xd2, 0x0c, 0x52, 0x60, 0x6e, 0xc4, 0xcc, 0x34, 0x03, 0x0e, 0xca, 0xda, + 0x72, 0x81, 0x99, 0xdb, 0x8d, 0x7a, 0x00, 0x01, 0x94, 0x9e, 0x55, 0xbc, 0x44, 0x59, 0x63, 0xd3, + 0x07, 0x16, 0x03, 0x1b, 0x08, 0x43, 0x08, 0x61, 0xb5, 0x5f, 0x64, 0xd4, 0xdc, 0xc7, 0xf8, 0xb0, + 0xe0, 0xf4, 0x05, 0xa7, 0x03, 0x34, 0x39, 0xae, 0x06, 0x29, 0x75, 0xf4, 0x9f, 0x53, 0x1e, 0x11, + 0x55, 0x6e, 0xc9, 0x5b, 0xab, 0x3d, 0x21, 0x94, 0x16, 0xaa, 0x61, 0xc2, 0xfc, 0x8c, 0xa6, 0x9c, + 0x42, 0xa2, 0xfe, 0x29, 0xbd, 0xe5, 0xaf, 0xa2, 0x0f, 0x93, 0x04, 0x62, 0xf5, 0xaf, 0xe8, 0x2b, + 0x85, 0x72, 0x84, 0x6a, 0x1e, 0x24, 0x78, 0x70, 0x41, 0x68, 0x10, 0x72, 0xf5, 0x5f, 0xe1, 0x39, + 0xc6, 0xe3, 0x93, 0xde, 0x14, 0x4b, 0x31, 0x3c, 0x34, 0x29, 0x58, 0xb1, 0xcb, 0x43, 0xf3, 0x80, + 0x04, 0xae, 0x3f, 0xee, 0x12, 0xff, 0x7e, 0x6a, 0xa0, 0x6a, 0xe7, 0x2e, 0xf1, 0x7b, 0xa8, 0x20, + 0x9c, 0x96, 0x80, 0xbd, 0xed, 0xab, 0x89, 0x2e, 0xdd, 0x4c, 0x74, 0xe9, 0x75, 0xa2, 0x4b, 0x77, + 0x53, 0xa3, 0x51, 0xd5, 0x05, 0x90, 0x9b, 0xb9, 0xed, 0x11, 0xee, 0xda, 0x66, 0x07, 0x12, 0x4e, + 0x12, 0xde, 0x7e, 0x93, 0x91, 0x7a, 0x92, 0x62, 0x97, 0x13, 0xe7, 0x13, 0xf0, 0x4b, 0x67, 0x9e, + 0xa3, 0x8d, 0x51, 0x39, 0x09, 0x0f, 0x7e, 0x7c, 0xee, 0x7a, 0x45, 0x72, 0xbe, 0x75, 0xb5, 0xd3, + 0xbf, 0x9d, 0x6b, 0xf2, 0x6c, 0xae, 0xc9, 0xcf, 0x73, 0x4d, 0xbe, 0x5e, 0x68, 0xd2, 0x6c, 0xa1, + 0x49, 0x0f, 0x0b, 0x4d, 0x3a, 0xdb, 0x0d, 0x28, 0x0f, 0x47, 0x9e, 0xe9, 0x43, 0x6c, 0x65, 0xc4, + 0x8d, 0x28, 0x70, 0xe2, 0x87, 0x56, 0x99, 0x28, 0xe3, 0x23, 0x73, 0x97, 0x5f, 0x34, 0x1f, 0xa7, + 0x84, 0x79, 0x2b, 0x65, 0x76, 0x76, 0xde, 0x03, 0x00, 0x00, 0xff, 0xff, 0x7b, 0x54, 0x04, 0x8f, + 0xa0, 0x02, 0x00, 0x00, } func (m *AddMultiStakingCoinProposal) Marshal() (dAtA []byte, err error) { @@ -475,7 +476,7 @@ func (m *AddMultiStakingCoinProposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Dec + var v cosmossdk_io_math.LegacyDec m.BondWeight = &v if err := m.BondWeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -657,7 +658,7 @@ func (m *UpdateBondWeightProposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Dec + var v cosmossdk_io_math.LegacyDec m.UpdatedBondWeight = &v if err := m.UpdatedBondWeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/x/multi-staking/types/query.pb.go b/x/multi-staking/types/query.pb.go index 41c7b198..604726eb 100644 --- a/x/multi-staking/types/query.pb.go +++ b/x/multi-staking/types/query.pb.go @@ -5,9 +5,9 @@ package types import ( context "context" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -545,8 +545,8 @@ func (m *QueryBondWeightRequest) GetDenom() string { } type QueryBondWeightResponse struct { - Weight github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=weight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"weight"` - Found bool `protobuf:"varint,2,opt,name=found,proto3" json:"found,omitempty"` + Weight cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=weight,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"weight"` + Found bool `protobuf:"varint,2,opt,name=found,proto3" json:"found,omitempty"` } func (m *QueryBondWeightResponse) Reset() { *m = QueryBondWeightResponse{} } @@ -890,71 +890,71 @@ func init() { proto.RegisterFile("multistaking/v1/query.proto", fileDescriptor_8 var fileDescriptor_82d174b604da394d = []byte{ // 1056 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x57, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xf6, 0x84, 0x3a, 0x34, 0xaf, 0xfc, 0x68, 0x07, 0xb7, 0xa4, 0xa6, 0xd8, 0x89, 0xa3, 0x38, - 0xa1, 0xe0, 0xdd, 0xda, 0x15, 0x44, 0xa5, 0x94, 0x0a, 0x37, 0x80, 0xf8, 0x11, 0x01, 0x1b, 0x0a, - 0x08, 0x21, 0x45, 0x1b, 0x7b, 0xba, 0x59, 0xc5, 0xde, 0x71, 0xbd, 0xe3, 0xd0, 0x2a, 0xca, 0x05, - 0x09, 0x89, 0x1b, 0x48, 0x3d, 0x23, 0x2a, 0x2e, 0x20, 0x4e, 0x1c, 0x7a, 0x03, 0xae, 0xa8, 0x27, - 0x54, 0xca, 0x05, 0x71, 0xa8, 0x50, 0xc2, 0x81, 0x3f, 0x03, 0xed, 0xcc, 0xdb, 0xb5, 0xbd, 0xeb, - 0xf5, 0x6e, 0x50, 0x7a, 0xe8, 0x29, 0x99, 0x9d, 0xf7, 0xe3, 0xfb, 0xbe, 0xf9, 0x76, 0xdf, 0x18, - 0x9e, 0x6a, 0xf7, 0x5a, 0xc2, 0x76, 0x85, 0xb9, 0x69, 0x3b, 0x96, 0xbe, 0x55, 0xd5, 0xaf, 0xf6, - 0x58, 0xf7, 0xba, 0xd6, 0xe9, 0x72, 0xc1, 0xe9, 0xe3, 0x83, 0x9b, 0xda, 0x56, 0x35, 0x9f, 0xb3, - 0xb8, 0xc5, 0xe5, 0x9e, 0xee, 0xfd, 0xa7, 0xc2, 0xf2, 0x27, 0x1b, 0xdc, 0x6d, 0x73, 0x77, 0x4d, - 0x6d, 0xa8, 0x05, 0x6e, 0xcd, 0x85, 0xcb, 0xcb, 0xf5, 0x9a, 0x5f, 0x52, 0x05, 0x9d, 0x56, 0x29, - 0xfa, 0xba, 0xe9, 0x32, 0xd5, 0x5f, 0xdf, 0xaa, 0xae, 0x33, 0x61, 0x56, 0xf5, 0x8e, 0x69, 0xd9, - 0x8e, 0x29, 0x6c, 0xee, 0x60, 0xec, 0x29, 0x8b, 0x73, 0xab, 0xc5, 0x74, 0xb3, 0x63, 0xeb, 0xa6, - 0xe3, 0x70, 0x21, 0x37, 0xb1, 0x5d, 0xc9, 0x82, 0xa7, 0xdf, 0xf3, 0xf2, 0x57, 0xbc, 0x2e, 0xab, - 0xaa, 0xc9, 0xdb, 0xbc, 0xb1, 0xe9, 0x1a, 0xec, 0x6a, 0x8f, 0xb9, 0x82, 0xbe, 0x06, 0xd0, 0x2f, - 0x39, 0x4d, 0x66, 0xc8, 0xe2, 0x91, 0x5a, 0x59, 0x43, 0xc8, 0x5e, 0x7f, 0x4d, 0xf1, 0xc7, 0xfe, - 0xda, 0xbb, 0xa6, 0xc5, 0x30, 0xd7, 0x18, 0xc8, 0x2c, 0x7d, 0x4b, 0xa0, 0x10, 0xd7, 0xc9, 0xed, - 0x70, 0xc7, 0x65, 0x74, 0x09, 0xb2, 0x2d, 0xef, 0xc1, 0x34, 0x99, 0x79, 0x68, 0xf1, 0x48, 0x6d, - 0x56, 0x0b, 0x89, 0xa9, 0x85, 0x53, 0x0d, 0x15, 0x4f, 0x5f, 0x1f, 0xc2, 0x38, 0x21, 0x31, 0x2e, - 0x24, 0x62, 0x54, 0x5d, 0x87, 0x40, 0xfe, 0x44, 0xe0, 0xd4, 0x48, 0x90, 0xbe, 0x1a, 0x6f, 0x42, - 0xae, 0x7f, 0x1e, 0xac, 0xbb, 0x66, 0x36, 0x9b, 0x5d, 0xe6, 0xba, 0x52, 0x97, 0xa9, 0xfa, 0xf4, - 0xdd, 0x5b, 0x95, 0x1c, 0xb6, 0x7d, 0x45, 0xed, 0xac, 0x8a, 0xae, 0xed, 0x58, 0x06, 0x6d, 0xfb, - 0x05, 0x59, 0x17, 0x77, 0xe8, 0xab, 0x70, 0x6c, 0xcb, 0x6c, 0xd9, 0x4d, 0x53, 0xf0, 0x7e, 0xa1, - 0x89, 0x84, 0x42, 0x47, 0x83, 0x14, 0x7c, 0xfe, 0xe2, 0xe1, 0x2f, 0x6e, 0x16, 0x33, 0xff, 0xde, - 0x2c, 0x66, 0x4a, 0xad, 0x98, 0xb3, 0x0c, 0x04, 0x7e, 0x1e, 0x0e, 0x79, 0x82, 0xe1, 0x29, 0xa6, - 0xd0, 0x57, 0x86, 0xd3, 0x1c, 0x64, 0xaf, 0xf0, 0x9e, 0xd3, 0x94, 0xe0, 0x0e, 0x1b, 0x6a, 0x51, - 0xb2, 0xa1, 0x18, 0xe9, 0x76, 0xd9, 0x69, 0xdd, 0x0f, 0xef, 0xfc, 0x40, 0x60, 0x26, 0xbe, 0x17, - 0x92, 0xbb, 0x00, 0x0f, 0xf7, 0x9c, 0x41, 0xff, 0xcc, 0x8d, 0xe5, 0xa7, 0xd2, 0x0d, 0x3f, 0xe7, - 0xe0, 0x3c, 0xf4, 0xcb, 0x28, 0xa3, 0x63, 0xb7, 0x07, 0xc1, 0x45, 0x22, 0xf6, 0x5c, 0x03, 0xa9, - 0xcf, 0xc3, 0xa4, 0x92, 0x0d, 0xcf, 0x34, 0x95, 0xd2, 0x98, 0x12, 0xe3, 0xa6, 0x4d, 0x98, 0x8d, - 0x74, 0xbd, 0xc4, 0x6d, 0xe7, 0x0d, 0xe7, 0x0a, 0xbf, 0x1f, 0x7e, 0x2a, 0x8d, 0xeb, 0x16, 0xd0, - 0xcc, 0xda, 0xde, 0x03, 0xf4, 0xd3, 0xfc, 0x58, 0x96, 0x7e, 0xba, 0xa1, 0x72, 0x0e, 0xce, 0x4f, - 0x1a, 0x9c, 0x90, 0x58, 0xeb, 0xdc, 0x69, 0x7e, 0xc8, 0x6c, 0x6b, 0x43, 0xf8, 0x72, 0xe4, 0x20, - 0xdb, 0x64, 0x0e, 0x6f, 0x2b, 0xdf, 0x18, 0x6a, 0x51, 0xfa, 0x9c, 0xc0, 0x93, 0x91, 0x04, 0x64, - 0xf4, 0x3e, 0x4c, 0x7e, 0x2a, 0x9f, 0xa0, 0xd5, 0x5e, 0xba, 0x7d, 0xaf, 0x98, 0xf9, 0xeb, 0x5e, - 0xb1, 0x6c, 0xd9, 0x62, 0xa3, 0xb7, 0xae, 0x35, 0x78, 0x1b, 0xa7, 0x11, 0xfe, 0xa9, 0xb8, 0xcd, - 0x4d, 0x5d, 0x5c, 0xef, 0x30, 0x57, 0x5b, 0x66, 0x8d, 0xbb, 0xb7, 0x2a, 0x80, 0x0c, 0x96, 0x59, - 0xc3, 0xc0, 0x5a, 0x31, 0x27, 0xda, 0x85, 0x79, 0x09, 0xe3, 0x03, 0xdf, 0x6a, 0x61, 0xb5, 0x7c, - 0x1a, 0x17, 0xe1, 0xb1, 0x61, 0x07, 0x27, 0xbe, 0x07, 0x8f, 0x0e, 0xd9, 0x77, 0xc0, 0xbb, 0x2f, - 0x43, 0x39, 0xa9, 0x27, 0x2a, 0x31, 0x5a, 0xbb, 0x6b, 0xa8, 0x75, 0x90, 0x1f, 0x58, 0xef, 0x04, - 0x4c, 0xba, 0xc2, 0x14, 0x3d, 0x7c, 0x49, 0x0d, 0x5c, 0x85, 0x2c, 0x39, 0xf1, 0xbf, 0x2d, 0xf9, - 0xbd, 0x7f, 0x6a, 0x83, 0xad, 0x11, 0xeb, 0x32, 0x40, 0x40, 0xd8, 0x37, 0x63, 0x21, 0x62, 0xc6, - 0x20, 0xd1, 0x73, 0x61, 0xfd, 0x90, 0x77, 0xb2, 0xc6, 0x40, 0xde, 0xc1, 0x19, 0xf2, 0x23, 0x38, - 0x3e, 0x8c, 0xf4, 0xa0, 0x0e, 0xb2, 0xf4, 0x49, 0x58, 0xfe, 0x40, 0x82, 0x3a, 0x4c, 0x05, 0xa1, - 0xf8, 0xe2, 0xa7, 0x53, 0xa0, 0x9f, 0x56, 0xfb, 0xf9, 0x11, 0xc8, 0xca, 0xf2, 0xf4, 0x1b, 0x02, - 0xc7, 0x22, 0xd7, 0x10, 0xaa, 0x45, 0x0a, 0x8e, 0xbd, 0x19, 0xe5, 0xf5, 0xd4, 0xf1, 0x8a, 0x44, - 0xe9, 0x99, 0xcf, 0xfe, 0xf8, 0xe7, 0xc6, 0xc4, 0x1c, 0x9d, 0xd5, 0xbb, 0xcc, 0x6c, 0xd9, 0x5c, - 0xb0, 0xc6, 0x86, 0x1e, 0xbe, 0xee, 0xa9, 0x69, 0xf4, 0x2b, 0x81, 0xa3, 0xe1, 0x42, 0xb4, 0x92, - 0xae, 0xa1, 0x8f, 0x4f, 0x4b, 0x1b, 0x8e, 0xf0, 0x56, 0x25, 0xbc, 0x15, 0xfa, 0x56, 0x12, 0x3c, - 0x7d, 0x3b, 0x32, 0x71, 0x76, 0xf4, 0xed, 0x51, 0x13, 0x6d, 0x87, 0x7e, 0x47, 0xe0, 0x89, 0x11, - 0x53, 0x9b, 0x9e, 0x49, 0x06, 0x37, 0x7c, 0x99, 0xc8, 0x57, 0xf7, 0x91, 0x81, 0x8c, 0x9e, 0x95, - 0x8c, 0xe6, 0xe9, 0xdc, 0x38, 0x46, 0xfe, 0x05, 0xe0, 0x37, 0x02, 0x34, 0x5a, 0x8c, 0xea, 0x69, - 0xdb, 0xfa, 0x38, 0xcf, 0xa4, 0x4f, 0x40, 0x98, 0x97, 0x25, 0xcc, 0x77, 0xe8, 0x4a, 0x32, 0xcc, - 0xfd, 0x48, 0xff, 0x3b, 0x81, 0x93, 0xb1, 0x1f, 0x42, 0xfa, 0xc2, 0x68, 0x98, 0x49, 0x5f, 0xeb, - 0xfc, 0xd2, 0xbe, 0xf3, 0x90, 0xe5, 0x25, 0xc9, 0xf2, 0x02, 0x3d, 0x3f, 0x8e, 0x65, 0xc0, 0xae, - 0xd2, 0xe0, 0xb6, 0x13, 0x66, 0xbb, 0x43, 0x7f, 0x24, 0x70, 0x7c, 0xe4, 0xd0, 0xa6, 0xb5, 0x64, - 0xd9, 0xc3, 0xf7, 0x89, 0xfc, 0xd9, 0x7d, 0xe5, 0x20, 0x0f, 0x4d, 0xf2, 0x58, 0xa4, 0xe5, 0x71, - 0x3c, 0x3c, 0xf4, 0x15, 0x75, 0x11, 0xb8, 0x41, 0x00, 0xfa, 0xa3, 0x98, 0x2e, 0x8c, 0xee, 0x19, - 0x99, 0xee, 0xf9, 0xc5, 0xe4, 0x40, 0x44, 0x54, 0x93, 0x88, 0x9e, 0xa3, 0xa7, 0xc7, 0x21, 0x52, - 0xb3, 0x5a, 0xdf, 0x96, 0x83, 0x6e, 0x87, 0x7e, 0x49, 0x00, 0xfa, 0xa3, 0x26, 0x0e, 0x55, 0x64, - 0x0e, 0xc6, 0xa1, 0x8a, 0x4e, 0xad, 0x74, 0x3a, 0x0d, 0xcc, 0xa7, 0xaf, 0x09, 0x4c, 0x05, 0x65, - 0x68, 0x39, 0xa1, 0x8f, 0x8f, 0x67, 0x21, 0x31, 0x0e, 0xe1, 0x5c, 0x94, 0x70, 0xce, 0xd1, 0xa5, - 0x74, 0x70, 0x22, 0xd6, 0xab, 0xaf, 0xde, 0xde, 0x2d, 0x90, 0x3b, 0xbb, 0x05, 0xf2, 0xf7, 0x6e, - 0x81, 0x7c, 0xb5, 0x57, 0xc8, 0xdc, 0xd9, 0x2b, 0x64, 0xfe, 0xdc, 0x2b, 0x64, 0x3e, 0x3e, 0x37, - 0x70, 0x7b, 0x0a, 0x17, 0xaf, 0xf8, 0xd5, 0xaf, 0x85, 0xd6, 0xf2, 0x52, 0xb5, 0x3e, 0x29, 0x7f, - 0x85, 0x9f, 0xfd, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x95, 0xf3, 0x19, 0xc5, 0x55, 0x10, 0x00, 0x00, + 0x14, 0xf6, 0x84, 0x3a, 0x34, 0xaf, 0xfc, 0x68, 0x07, 0xb7, 0xa4, 0x6e, 0xb1, 0x13, 0x47, 0xf9, + 0x41, 0xc1, 0xbb, 0xb5, 0x2b, 0x88, 0x4a, 0x55, 0x2a, 0xdc, 0x00, 0x2a, 0x34, 0x02, 0x36, 0x2a, + 0x20, 0x84, 0x14, 0x6d, 0xec, 0xe9, 0x66, 0x15, 0x7b, 0xc7, 0xf5, 0x8e, 0x43, 0x43, 0x94, 0x0b, + 0x27, 0x6e, 0x20, 0xf5, 0x8c, 0xa8, 0xb8, 0x80, 0x38, 0x71, 0xe8, 0x0d, 0xb8, 0xa2, 0x9e, 0x50, + 0x29, 0x17, 0xc4, 0xa1, 0x42, 0x09, 0x07, 0xfe, 0x0c, 0xb4, 0x33, 0x6f, 0xd7, 0xf6, 0xae, 0xd7, + 0xbb, 0x41, 0xc9, 0x81, 0x5b, 0x66, 0xe7, 0xbd, 0xf7, 0x7d, 0xdf, 0x7b, 0x9f, 0xf7, 0x6d, 0xe0, + 0x4c, 0xab, 0xdb, 0x14, 0xb6, 0x2b, 0xcc, 0x0d, 0xdb, 0xb1, 0xf4, 0xcd, 0x8a, 0x7e, 0xab, 0xcb, + 0x3a, 0x5b, 0x5a, 0xbb, 0xc3, 0x05, 0xa7, 0x4f, 0xf7, 0x5f, 0x6a, 0x9b, 0x95, 0x7c, 0xce, 0xe2, + 0x16, 0x97, 0x77, 0xba, 0xf7, 0x97, 0x0a, 0xcb, 0x9f, 0xae, 0x73, 0xb7, 0xc5, 0xdd, 0x55, 0x75, + 0xa1, 0x0e, 0x78, 0x35, 0x13, 0x2e, 0x2f, 0xcf, 0xab, 0x7e, 0x49, 0x15, 0x74, 0x4e, 0xa5, 0xe8, + 0x6b, 0xa6, 0xcb, 0x14, 0xbe, 0xbe, 0x59, 0x59, 0x63, 0xc2, 0xac, 0xe8, 0x6d, 0xd3, 0xb2, 0x1d, + 0x53, 0xd8, 0xdc, 0xc1, 0xd8, 0xb3, 0x16, 0xe7, 0x56, 0x93, 0xe9, 0x66, 0xdb, 0xd6, 0x4d, 0xc7, + 0xe1, 0x42, 0x5e, 0x22, 0x5c, 0xc9, 0x82, 0xe7, 0xde, 0xf3, 0xf2, 0x97, 0x3d, 0x94, 0x15, 0x05, + 0x72, 0x9d, 0xd7, 0x37, 0x5c, 0x83, 0xdd, 0xea, 0x32, 0x57, 0xd0, 0x37, 0x00, 0x7a, 0x25, 0x27, + 0xc9, 0x14, 0x59, 0x38, 0x56, 0x9d, 0xd3, 0x90, 0xb2, 0x87, 0xaf, 0x29, 0xfd, 0x88, 0xaf, 0xbd, + 0x6b, 0x5a, 0x0c, 0x73, 0x8d, 0xbe, 0xcc, 0xd2, 0x37, 0x04, 0x0a, 0x71, 0x48, 0x6e, 0x9b, 0x3b, + 0x2e, 0xa3, 0x8b, 0x90, 0x6d, 0x7a, 0x0f, 0x26, 0xc9, 0xd4, 0x63, 0x0b, 0xc7, 0xaa, 0xd3, 0x5a, + 0xa8, 0x99, 0x5a, 0x38, 0xd5, 0x50, 0xf1, 0xf4, 0xcd, 0x01, 0x8e, 0x63, 0x92, 0xe3, 0x7c, 0x22, + 0x47, 0x85, 0x3a, 0x40, 0xf2, 0x47, 0x02, 0x67, 0x87, 0x92, 0xf4, 0xbb, 0xf1, 0x16, 0xe4, 0x7a, + 0xf3, 0x60, 0x9d, 0x55, 0xb3, 0xd1, 0xe8, 0x30, 0xd7, 0x95, 0x7d, 0x99, 0xa8, 0x4d, 0x3e, 0xbc, + 0x57, 0xce, 0x21, 0xec, 0x6b, 0xea, 0x66, 0x45, 0x74, 0x6c, 0xc7, 0x32, 0x68, 0xcb, 0x2f, 0xc8, + 0x3a, 0x78, 0x43, 0x5f, 0x87, 0x13, 0x9b, 0x66, 0xd3, 0x6e, 0x98, 0x82, 0xf7, 0x0a, 0x8d, 0x25, + 0x14, 0x3a, 0x1e, 0xa4, 0xe0, 0xf3, 0x57, 0x8e, 0x7e, 0x7e, 0xb7, 0x98, 0xf9, 0xe7, 0x6e, 0x31, + 0x53, 0x6a, 0xc6, 0xcc, 0x32, 0x68, 0xf0, 0x4b, 0x70, 0xc4, 0x6b, 0x18, 0x4e, 0x31, 0x45, 0x7f, + 0x65, 0x38, 0xcd, 0x41, 0xf6, 0x26, 0xef, 0x3a, 0x0d, 0x49, 0xee, 0xa8, 0xa1, 0x0e, 0x25, 0x1b, + 0x8a, 0x11, 0xb4, 0x1b, 0x4e, 0xf3, 0x30, 0xbc, 0xf3, 0x3d, 0x81, 0xa9, 0x78, 0x2c, 0x14, 0x77, + 0x19, 0x1e, 0xef, 0x3a, 0xfd, 0xfe, 0x99, 0x19, 0xa9, 0x4f, 0xa5, 0x1b, 0x7e, 0xce, 0xc1, 0x79, + 0xe8, 0xe7, 0x61, 0x46, 0x47, 0xb4, 0xff, 0x83, 0x8b, 0x44, 0xec, 0x5c, 0x83, 0x56, 0x5f, 0x82, + 0x71, 0xd5, 0x36, 0x9c, 0x69, 0xaa, 0x4e, 0x63, 0x4a, 0x8c, 0x9b, 0x36, 0x60, 0x3a, 0x82, 0x7a, + 0x95, 0xdb, 0xce, 0x35, 0xe7, 0x26, 0x3f, 0x0c, 0x3f, 0x95, 0x46, 0xa1, 0x05, 0x32, 0xb3, 0xb6, + 0xf7, 0x00, 0xfd, 0x34, 0x3b, 0x52, 0xa5, 0x9f, 0x6e, 0xa8, 0x9c, 0x83, 0xf3, 0x93, 0x06, 0xa7, + 0x24, 0xd7, 0x1a, 0x77, 0x1a, 0x1f, 0x30, 0xdb, 0x5a, 0x17, 0x7e, 0x3b, 0x72, 0x90, 0x6d, 0x30, + 0x87, 0xb7, 0x94, 0x6f, 0x0c, 0x75, 0x28, 0x7d, 0x0a, 0xcf, 0x46, 0xe2, 0x51, 0xd0, 0x35, 0x18, + 0xff, 0x44, 0x3e, 0x41, 0xa7, 0x55, 0xee, 0x3f, 0x2a, 0x66, 0xfe, 0x7c, 0x54, 0x3c, 0xa3, 0x68, + 0xb9, 0x8d, 0x0d, 0xcd, 0xe6, 0x7a, 0xcb, 0x14, 0xeb, 0xda, 0x75, 0x66, 0x99, 0xf5, 0xad, 0x25, + 0x56, 0x7f, 0x78, 0xaf, 0x0c, 0xc8, 0x7a, 0x89, 0xd5, 0x0d, 0x2c, 0x10, 0x33, 0xc5, 0x0e, 0xcc, + 0x4a, 0xec, 0xf7, 0x7d, 0x7b, 0x85, 0x3b, 0xe4, 0x53, 0xbf, 0x02, 0x4f, 0x0d, 0xba, 0x36, 0xd1, + 0xfb, 0x4f, 0x0e, 0x58, 0xb6, 0xcf, 0xaf, 0xaf, 0xc2, 0x5c, 0x12, 0x26, 0xca, 0x1f, 0xde, 0xaf, + 0xdb, 0xd8, 0xdf, 0x20, 0x3f, 0xb0, 0xdb, 0x29, 0x18, 0x77, 0x85, 0x29, 0xba, 0xf8, 0xc3, 0x34, + 0xf0, 0x14, 0xb2, 0xe1, 0xd8, 0x7f, 0xb6, 0xe1, 0x77, 0x04, 0x47, 0xd5, 0x0f, 0x8d, 0x5c, 0x97, + 0x00, 0x02, 0xc1, 0xbe, 0x01, 0x0b, 0x11, 0x03, 0x06, 0x89, 0x9e, 0xf3, 0x6a, 0x47, 0xbc, 0x71, + 0x1a, 0x7d, 0x79, 0x07, 0x67, 0xc2, 0x0f, 0xe1, 0xe4, 0x20, 0xd3, 0x83, 0x1a, 0x64, 0xe9, 0xe3, + 0x70, 0xfb, 0x83, 0x16, 0xd4, 0x60, 0x22, 0x08, 0xc5, 0x1f, 0x7b, 0xba, 0x0e, 0xf4, 0xd2, 0xaa, + 0x3f, 0x3d, 0x01, 0x59, 0x59, 0x9e, 0x7e, 0x4d, 0xe0, 0x44, 0xe4, 0xd3, 0x83, 0x6a, 0x91, 0x82, + 0x23, 0xbf, 0x86, 0xf2, 0x7a, 0xea, 0x78, 0x25, 0xa2, 0xf4, 0xfc, 0x67, 0xbf, 0xff, 0x7d, 0x67, + 0x6c, 0x86, 0x4e, 0xeb, 0x1d, 0x66, 0x36, 0x6d, 0x2e, 0x58, 0x7d, 0x5d, 0x0f, 0x7f, 0xe2, 0xa9, + 0x0d, 0xf4, 0x0b, 0x81, 0xe3, 0xe1, 0x42, 0xb4, 0x9c, 0x0e, 0xd0, 0xe7, 0xa7, 0xa5, 0x0d, 0x47, + 0x7a, 0x2b, 0x92, 0xde, 0x32, 0x7d, 0x3b, 0x89, 0x9e, 0xbe, 0x1d, 0xd9, 0x32, 0x3b, 0xfa, 0xf6, + 0xb0, 0x2d, 0xb6, 0x43, 0xbf, 0x25, 0xf0, 0xcc, 0x90, 0x4d, 0x4d, 0xcf, 0x27, 0x93, 0x1b, 0xfc, + 0x80, 0xc8, 0x57, 0xf6, 0x91, 0x81, 0x8a, 0x5e, 0x90, 0x8a, 0x66, 0xe9, 0xcc, 0x28, 0x45, 0xfe, + 0xd2, 0xff, 0x95, 0x00, 0x8d, 0x16, 0xa3, 0x7a, 0x5a, 0x58, 0x9f, 0xe7, 0xf9, 0xf4, 0x09, 0x48, + 0xf3, 0x86, 0xa4, 0xf9, 0x0e, 0x5d, 0x4e, 0xa6, 0xb9, 0x9f, 0xd6, 0xff, 0x46, 0xe0, 0x74, 0xec, + 0x8b, 0x90, 0xbe, 0x3c, 0x9c, 0x66, 0xd2, 0xdb, 0x3a, 0xbf, 0xb8, 0xef, 0x3c, 0x54, 0x79, 0x55, + 0xaa, 0xbc, 0x4c, 0x2f, 0x8d, 0x52, 0x19, 0xa8, 0x2b, 0xd7, 0xb9, 0xed, 0x84, 0xd5, 0xee, 0xd0, + 0x1f, 0x08, 0x9c, 0x1c, 0xba, 0xa8, 0x69, 0x35, 0xb9, 0xed, 0xe1, 0x6f, 0x88, 0xfc, 0x85, 0x7d, + 0xe5, 0xa0, 0x0e, 0x4d, 0xea, 0x58, 0xa0, 0x73, 0xa3, 0x74, 0x78, 0xec, 0xcb, 0x6a, 0xf9, 0xdf, + 0x21, 0x00, 0xbd, 0xfd, 0x4b, 0xe7, 0x87, 0x63, 0x46, 0x36, 0x7a, 0x7e, 0x21, 0x39, 0x10, 0x19, + 0x55, 0x25, 0xa3, 0x17, 0xe9, 0xb9, 0x51, 0x8c, 0xd4, 0xae, 0xd6, 0xb7, 0xe5, 0xa2, 0xdb, 0xa1, + 0x5f, 0x10, 0x80, 0xde, 0xaa, 0x89, 0x63, 0x15, 0xd9, 0x83, 0x71, 0xac, 0xa2, 0x5b, 0x2b, 0x5d, + 0x9f, 0xfa, 0xf6, 0xd3, 0x57, 0x04, 0x26, 0x82, 0x32, 0x74, 0x2e, 0x01, 0xc7, 0xe7, 0x33, 0x9f, + 0x18, 0x87, 0x74, 0xae, 0x48, 0x3a, 0x17, 0xe9, 0x62, 0x3a, 0x3a, 0x11, 0xeb, 0xd5, 0x56, 0xee, + 0xef, 0x16, 0xc8, 0x83, 0xdd, 0x02, 0xf9, 0x6b, 0xb7, 0x40, 0xbe, 0xdc, 0x2b, 0x64, 0x1e, 0xec, + 0x15, 0x32, 0x7f, 0xec, 0x15, 0x32, 0x1f, 0x5d, 0xb4, 0x6c, 0xb1, 0xde, 0x5d, 0xd3, 0xea, 0xbc, + 0x15, 0x29, 0x5e, 0xf6, 0xab, 0xdf, 0x0e, 0x9d, 0xc5, 0x56, 0x9b, 0xb9, 0x6b, 0xe3, 0xf2, 0x3f, + 0xef, 0x0b, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x92, 0x1a, 0x84, 0x85, 0x49, 0x10, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/multi-staking/types/tx.pb.go b/x/multi-staking/types/tx.pb.go index 77a7898d..882ab9ca 100644 --- a/x/multi-staking/types/tx.pb.go +++ b/x/multi-staking/types/tx.pb.go @@ -130,7 +130,7 @@ func init() { func init() { proto.RegisterFile("multistaking/v1/tx.proto", fileDescriptor_c52c073cb95ae80e) } var fileDescriptor_c52c073cb95ae80e = []byte{ - // 348 bytes of a gzipped FileDescriptorProto + // 355 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xc8, 0x2d, 0xcd, 0x29, 0xc9, 0x2c, 0x2e, 0x49, 0xcc, 0xce, 0xcc, 0x4b, 0xd7, 0x2f, 0x33, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x47, 0x96, 0xd1, 0x2b, 0x33, 0x94, 0x12, 0x49, 0xcf, 0x4f, @@ -145,14 +145,15 @@ var fileDescriptor_c52c073cb95ae80e = []byte{ 0x97, 0x14, 0x65, 0xe6, 0xa5, 0x07, 0x21, 0x94, 0x0a, 0x99, 0x72, 0xb1, 0x41, 0xdc, 0x26, 0xc1, 0xa4, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xae, 0x87, 0xe6, 0x7f, 0x3d, 0x88, 0x05, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0x15, 0x5b, 0xf1, 0x35, 0x3d, 0xdf, 0xa0, 0x85, 0x30, 0x46, 0x49, - 0x95, 0x4b, 0x19, 0x8f, 0xeb, 0x82, 0x52, 0x8b, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x8d, 0x5a, 0x19, + 0x95, 0x4b, 0x19, 0x8f, 0xeb, 0x82, 0x52, 0x8b, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x8d, 0x7a, 0x18, 0xb9, 0x98, 0x7d, 0x8b, 0xd3, 0x85, 0xea, 0xb8, 0x24, 0x70, 0xfa, 0x44, 0x07, 0xc3, 0x05, 0x78, - 0x4c, 0x96, 0x32, 0x21, 0x45, 0x35, 0xcc, 0x1d, 0x4e, 0xc1, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, - 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, - 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x99, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, - 0x5f, 0x94, 0x9a, 0x98, 0x93, 0x99, 0x5f, 0x92, 0x9a, 0x9c, 0xa1, 0x0f, 0xb6, 0x44, 0x17, 0x16, - 0xa1, 0x15, 0x68, 0xfc, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0x4c, 0x19, 0x03, 0x02, - 0x00, 0x00, 0xff, 0xff, 0x40, 0x56, 0x39, 0xe7, 0x5c, 0x02, 0x00, 0x00, + 0x4c, 0x96, 0x32, 0x21, 0x45, 0x35, 0xcc, 0x1d, 0x52, 0xac, 0x0d, 0xcf, 0x37, 0x68, 0x31, 0x3a, + 0x05, 0x9f, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, + 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x65, 0x7a, 0x66, 0x49, + 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x51, 0x6a, 0x62, 0x4e, 0x66, 0x7e, 0x49, 0x6a, + 0x72, 0x86, 0x3e, 0xd8, 0x2e, 0x5d, 0x58, 0xbc, 0x56, 0xa0, 0xf1, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, + 0x93, 0xd8, 0xc0, 0x11, 0x66, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xfe, 0xc9, 0xb8, 0xed, 0x63, + 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/multi-staking/types/unlock.go b/x/multi-staking/types/unlock.go index d10aa7f7..92f5e5df 100644 --- a/x/multi-staking/types/unlock.go +++ b/x/multi-staking/types/unlock.go @@ -23,12 +23,12 @@ func (e UnlockEntry) String() string { return string(out) } -func (u UnlockEntry) GetBondWeight() sdk.Dec { +func (u UnlockEntry) GetBondWeight() math.LegacyDec { return u.UnlockingCoin.BondWeight } func (unlockEntry UnlockEntry) UnbondAmountToUnlockAmount(unbondAmount math.Int) math.Int { - return sdk.NewDecFromInt(unbondAmount).Quo(unlockEntry.GetBondWeight()).TruncateInt() + return math.LegacyNewDecFromInt(unbondAmount).Quo(unlockEntry.GetBondWeight()).TruncateInt() } func (unlockEntry UnlockEntry) UnlockAmountToUnbondAmount(unlockAmount math.Int) math.Int { diff --git a/x/multi-staking/types/unlock_test.go b/x/multi-staking/types/unlock_test.go index 1ac40e74..e558cc46 100644 --- a/x/multi-staking/types/unlock_test.go +++ b/x/multi-staking/types/unlock_test.go @@ -7,7 +7,7 @@ import ( "github.com/realio-tech/multi-staking-module/x/multi-staking/types" "github.com/stretchr/testify/require" - sdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/math" ) func TestFindEntryIndexByHeight(t *testing.T) { @@ -15,11 +15,11 @@ func TestFindEntryIndexByHeight(t *testing.T) { delAddr := test.GenAddress() unlockID := types.MultiStakingUnlockID(delAddr.String(), valAddr.String()) initalEntries := []types.UnlockEntry{ - types.NewUnlockEntry(1, types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(123456), sdk.MustNewDecFromStr("0.3"))), - types.NewUnlockEntry(2, types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(100000), sdk.OneDec())), - types.NewUnlockEntry(3, types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(200000), sdk.MustNewDecFromStr("0.5"))), - types.NewUnlockEntry(4, types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(300000), sdk.MustNewDecFromStr("0.5"))), - types.NewUnlockEntry(5, types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(500000), sdk.MustNewDecFromStr("0.2"))), + types.NewUnlockEntry(1, types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(123456), math.LegacyMustNewDecFromStr("0.3"))), + types.NewUnlockEntry(2, types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(100000), math.LegacyOneDec())), + types.NewUnlockEntry(3, types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(200000), math.LegacyMustNewDecFromStr("0.5"))), + types.NewUnlockEntry(4, types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(300000), math.LegacyMustNewDecFromStr("0.5"))), + types.NewUnlockEntry(5, types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(500000), math.LegacyMustNewDecFromStr("0.2"))), } testCases := []struct { @@ -67,11 +67,11 @@ func TestAddEntry(t *testing.T) { delAddr := test.GenAddress() unlockID := types.MultiStakingUnlockID(delAddr.String(), valAddr.String()) initalEntries := []types.UnlockEntry{ - types.NewUnlockEntry(1, types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(123456), sdk.MustNewDecFromStr("0.3"))), - types.NewUnlockEntry(2, types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(100000), sdk.OneDec())), - types.NewUnlockEntry(3, types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(200000), sdk.MustNewDecFromStr("0.5"))), - types.NewUnlockEntry(4, types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(300000), sdk.MustNewDecFromStr("0.5"))), - types.NewUnlockEntry(5, types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(500000), sdk.MustNewDecFromStr("0.2"))), + types.NewUnlockEntry(1, types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(123456), math.LegacyMustNewDecFromStr("0.3"))), + types.NewUnlockEntry(2, types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(100000), math.LegacyOneDec())), + types.NewUnlockEntry(3, types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(200000), math.LegacyMustNewDecFromStr("0.5"))), + types.NewUnlockEntry(4, types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(300000), math.LegacyMustNewDecFromStr("0.5"))), + types.NewUnlockEntry(5, types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(500000), math.LegacyMustNewDecFromStr("0.2"))), } testCases := []struct { @@ -84,29 +84,29 @@ func TestAddEntry(t *testing.T) { { name: "success", height: 1, - addingMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(123000), sdk.MustNewDecFromStr("0.3")), - expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(246456), sdk.MustNewDecFromStr("0.3")), + addingMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(123000), math.LegacyMustNewDecFromStr("0.3")), + expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(246456), math.LegacyMustNewDecFromStr("0.3")), expPanic: false, }, { name: "success and change rate", height: 2, - addingMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(400000), sdk.MustNewDecFromStr("0.5")), - expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(500000), sdk.MustNewDecFromStr("0.6")), + addingMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(400000), math.LegacyMustNewDecFromStr("0.5")), + expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(500000), math.LegacyMustNewDecFromStr("0.6")), expPanic: false, }, { name: "success add new entry", height: 12, - addingMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(123456), sdk.MustNewDecFromStr("0.3")), - expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(123456), sdk.MustNewDecFromStr("0.3")), + addingMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(123456), math.LegacyMustNewDecFromStr("0.3")), + expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(123456), math.LegacyMustNewDecFromStr("0.3")), expPanic: false, }, { name: "denom mismatch", height: 3, - addingMSCoin: types.NewMultiStakingCoin(MultiStakingDenomB, sdk.NewInt(123000), sdk.MustNewDecFromStr("0.3")), - expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(246456), sdk.MustNewDecFromStr("0.3")), + addingMSCoin: types.NewMultiStakingCoin(MultiStakingDenomB, math.NewInt(123000), math.LegacyMustNewDecFromStr("0.3")), + expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(246456), math.LegacyMustNewDecFromStr("0.3")), expPanic: true, }, } @@ -141,11 +141,11 @@ func TestRemoveCoinFromEntry(t *testing.T) { delAddr := test.GenAddress() unlockID := types.MultiStakingUnlockID(delAddr.String(), valAddr.String()) initalEntries := []types.UnlockEntry{ - types.NewUnlockEntry(1, types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(123456), sdk.MustNewDecFromStr("0.3"))), - types.NewUnlockEntry(2, types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(100000), sdk.OneDec())), - types.NewUnlockEntry(3, types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(200000), sdk.MustNewDecFromStr("0.5"))), - types.NewUnlockEntry(4, types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(300000), sdk.MustNewDecFromStr("0.5"))), - types.NewUnlockEntry(5, types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(500000), sdk.MustNewDecFromStr("0.2"))), + types.NewUnlockEntry(1, types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(123456), math.LegacyMustNewDecFromStr("0.3"))), + types.NewUnlockEntry(2, types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(100000), math.LegacyOneDec())), + types.NewUnlockEntry(3, types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(200000), math.LegacyMustNewDecFromStr("0.5"))), + types.NewUnlockEntry(4, types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(300000), math.LegacyMustNewDecFromStr("0.5"))), + types.NewUnlockEntry(5, types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(500000), math.LegacyMustNewDecFromStr("0.2"))), } testCases := []struct { @@ -158,29 +158,29 @@ func TestRemoveCoinFromEntry(t *testing.T) { { name: "success", index: 0, - removeMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(123000), sdk.MustNewDecFromStr("0.3")), - expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(456), sdk.MustNewDecFromStr("0.3")), + removeMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(123000), math.LegacyMustNewDecFromStr("0.3")), + expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(456), math.LegacyMustNewDecFromStr("0.3")), expErr: false, }, { name: "success and remove all", index: 4, - removeMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(500000), sdk.MustNewDecFromStr("0.3")), - expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.ZeroInt(), sdk.MustNewDecFromStr("0.3")), + removeMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(500000), math.LegacyMustNewDecFromStr("0.3")), + expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.ZeroInt(), math.LegacyMustNewDecFromStr("0.3")), expErr: false, }, { name: "entry index is out of bound", index: 10, - removeMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(400000), sdk.MustNewDecFromStr("0.3")), - expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(246456), sdk.MustNewDecFromStr("0.3")), + removeMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(400000), math.LegacyMustNewDecFromStr("0.3")), + expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(246456), math.LegacyMustNewDecFromStr("0.3")), expErr: true, }, { name: "remove too much", index: 5, - removeMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(1000000), sdk.MustNewDecFromStr("0.3")), - expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, sdk.NewInt(246456), sdk.MustNewDecFromStr("0.3")), + removeMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(1000000), math.LegacyMustNewDecFromStr("0.3")), + expMSCoin: types.NewMultiStakingCoin(MultiStakingDenomA, math.NewInt(246456), math.LegacyMustNewDecFromStr("0.3")), expErr: true, }, } diff --git a/x/multi-staking/types/utils.go b/x/multi-staking/types/utils.go index 289a44de..ff46a132 100644 --- a/x/multi-staking/types/utils.go +++ b/x/multi-staking/types/utils.go @@ -16,3 +16,11 @@ func AccAddrAndValAddrFromStrings(accAddrString string, valAddrStraing string) ( return accAddr, valAcc, nil } + +func ValidatorAccAddrAndValAddrFromStrings(valAddrString string) (sdk.AccAddress, sdk.ValAddress, error) { + valAddr, err := sdk.ValAddressFromBech32(valAddrString) + if err != nil { + return sdk.AccAddress{}, sdk.ValAddress{}, err + } + return sdk.AccAddress(valAddr), valAddr, nil +}