diff --git a/client/chain/context.go b/client/chain/context.go index e638fbaf..075338ad 100644 --- a/client/chain/context.go +++ b/client/chain/context.go @@ -13,6 +13,7 @@ import ( keyscodec "github.com/InjectiveLabs/sdk-go/chain/crypto/codec" + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" auction "github.com/InjectiveLabs/sdk-go/chain/auction/types" evm "github.com/InjectiveLabs/sdk-go/chain/evm/types" exchange "github.com/InjectiveLabs/sdk-go/chain/exchange/types" @@ -21,7 +22,6 @@ import ( oracle "github.com/InjectiveLabs/sdk-go/chain/oracle/types" peggy "github.com/InjectiveLabs/sdk-go/chain/peggy/types" chaintypes "github.com/InjectiveLabs/sdk-go/chain/types" - wasmtypes "github.com/InjectiveLabs/sdk-go/wasm/types" cosmostypes "github.com/cosmos/cosmos-sdk/types" signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" @@ -38,8 +38,8 @@ import ( slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - ibcapplicationtypes "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types" - ibccoretypes "github.com/cosmos/ibc-go/v2/modules/core/types" + ibcapplicationtypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" + ibccoretypes "github.com/cosmos/ibc-go/v3/modules/core/types" ) // NewTxConfig initializes new Cosmos TxConfig with certain signModes enabled. diff --git a/go.mod b/go.mod index 79faaf58..de9b086c 100644 --- a/go.mod +++ b/go.mod @@ -1,40 +1,24 @@ module github.com/InjectiveLabs/sdk-go -go 1.16 +go 1.17 require ( github.com/CosmWasm/wasmd v0.0.0-00010101000000-000000000000 github.com/InjectiveLabs/suplog v1.3.3 - github.com/allegro/bigcache v1.2.1 // indirect - github.com/aristanetworks/goarista v0.0.0-20201012165903-2cb20defcd66 // indirect github.com/bandprotocol/bandchain-packet v0.0.2 - github.com/bitly/go-simplejson v0.5.0 // indirect github.com/btcsuite/btcd v0.22.0-beta github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce - github.com/bugsnag/panicwrap v1.2.0 // indirect - github.com/cespare/cp v1.1.1 // indirect github.com/cosmos/cosmos-sdk v0.45.4 - github.com/cosmos/ibc-go/v2 v2.0.2 github.com/cosmos/ibc-go/v3 v3.0.0 - github.com/deckarep/golang-set v1.7.1 // indirect github.com/ethereum/go-ethereum v1.9.25 - github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 // indirect - github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect - github.com/gofrs/uuid v3.3.0+incompatible // indirect github.com/gogo/protobuf v1.3.3 github.com/golang/protobuf v1.5.2 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.3 - github.com/jackpal/go-nat-pmp v1.0.2 // indirect - github.com/karalabe/usb v0.0.0-20191104083709-911d15fe12a9 // indirect - github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect github.com/pkg/errors v0.9.1 - github.com/prometheus/tsdb v0.10.0 // indirect github.com/regen-network/cosmos-proto v0.3.1 - github.com/rjeczalik/notify v0.9.2 // indirect github.com/shopspring/decimal v1.2.0 github.com/spf13/cobra v1.4.0 - github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969 // indirect github.com/tendermint/tendermint v0.34.19 github.com/tyler-smith/go-bip39 v1.0.2 golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 @@ -45,12 +29,133 @@ require ( gopkg.in/yaml.v2 v2.4.0 ) +require ( + filippo.io/edwards25519 v1.0.0-beta.2 // indirect + github.com/99designs/keyring v1.1.6 // indirect + github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect + github.com/CosmWasm/wasmvm v1.0.0 // indirect + github.com/DataDog/zstd v1.4.5 // indirect + github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect + github.com/VictoriaMetrics/fastcache v1.5.7 // indirect + github.com/allegro/bigcache v1.2.1 // indirect + github.com/aristanetworks/goarista v0.0.0-20201012165903-2cb20defcd66 // indirect + github.com/armon/go-metrics v0.3.10 // indirect + github.com/aws/aws-sdk-go v1.40.45 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/bgentry/speakeasy v0.1.0 // indirect + github.com/bitly/go-simplejson v0.5.0 // indirect + github.com/bugsnag/bugsnag-go v1.5.3 // indirect + github.com/bugsnag/panicwrap v1.2.0 // indirect + github.com/cespare/cp v1.1.1 // indirect + github.com/cespare/xxhash v1.1.0 // indirect + github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/confio/ics23/go v0.7.0 // indirect + github.com/cosmos/btcutil v1.0.4 // indirect + github.com/cosmos/go-bip39 v1.0.0 // indirect + github.com/cosmos/gorocksdb v1.2.0 // indirect + github.com/cosmos/iavl v0.17.3 // indirect + github.com/cosmos/ledger-cosmos-go v0.11.1 // indirect + github.com/cosmos/ledger-go v0.9.2 // indirect + github.com/danieljoos/wincred v1.0.2 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/deckarep/golang-set v1.7.1 // indirect + github.com/dgraph-io/badger/v2 v2.2007.2 // indirect + github.com/dgraph-io/ristretto v0.0.3 // indirect + github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect + github.com/dustin/go-humanize v1.0.0 // indirect + github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b // indirect + github.com/edsrzf/mmap-go v1.0.0 // indirect + github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 // indirect + github.com/fsnotify/fsnotify v1.5.1 // indirect + github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect + github.com/go-kit/kit v0.12.0 // indirect + github.com/go-kit/log v0.2.0 // indirect + github.com/go-logfmt/logfmt v0.5.1 // indirect + github.com/go-ole/go-ole v1.2.1 // indirect + github.com/go-stack/stack v1.8.0 // indirect + github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect + github.com/gofrs/uuid v3.3.0+incompatible // indirect + github.com/golang/snappy v0.0.3 // indirect + github.com/google/btree v1.0.0 // indirect + github.com/google/uuid v1.1.2 // indirect + github.com/gorilla/mux v1.8.0 // indirect + github.com/gorilla/websocket v1.5.0 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.3.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-immutable-radix v1.3.1 // indirect + github.com/hashicorp/golang-lru v0.5.4 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87 // indirect + github.com/holiman/uint256 v1.1.1 // indirect + github.com/huin/goupnp v1.0.0 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/jackpal/go-nat-pmp v1.0.2 // indirect + github.com/jmespath/go-jmespath v0.4.0 // indirect + github.com/jmhodges/levigo v1.0.0 // indirect + github.com/karalabe/usb v0.0.0-20191104083709-911d15fe12a9 // indirect + github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect + github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d // indirect + github.com/libp2p/go-buffer-pool v0.0.2 // indirect + github.com/magiconair/properties v1.8.6 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect + github.com/mattn/go-runewidth v0.0.4 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/mitchellh/mapstructure v1.4.3 // indirect + github.com/mtibben/percent v0.2.1 // indirect + github.com/oklog/ulid v1.3.1 // indirect + github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c // indirect + github.com/pborman/uuid v1.2.0 // indirect + github.com/pelletier/go-toml v1.9.4 // indirect + github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect + github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7 // indirect + github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_golang v1.12.1 // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/common v0.32.1 // indirect + github.com/prometheus/procfs v0.7.3 // indirect + github.com/prometheus/tsdb v0.10.0 // indirect + github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect + github.com/rjeczalik/notify v0.9.2 // indirect + github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa // indirect + github.com/shirou/gopsutil v2.20.5+incompatible // indirect + github.com/sirupsen/logrus v1.8.1 // indirect + github.com/spf13/afero v1.8.2 // indirect + github.com/spf13/cast v1.4.1 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/spf13/viper v1.11.0 // indirect + github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969 // indirect + github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570 // indirect + github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3 // indirect + github.com/stretchr/testify v1.7.1 // indirect + github.com/subosito/gotenv v1.2.0 // indirect + github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca // indirect + github.com/tendermint/btcd v0.1.1 // indirect + github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 // indirect + github.com/tendermint/go-amino v0.16.0 // indirect + github.com/tendermint/tm-db v0.6.7 // indirect + github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208 // indirect + github.com/zondax/hid v0.9.0 // indirect + go.etcd.io/bbolt v1.3.6 // indirect + golang.org/x/net v0.0.0-20220517181318-183a9ca12b87 // indirect + golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect + golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect + golang.org/x/text v0.3.7 // indirect + gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect +) + replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 replace google.golang.org/grpc => google.golang.org/grpc v1.33.2 replace github.com/btcsuite/btcutil => github.com/btcsuite/btcutil v1.0.2 -replace github.com/cosmos/cosmos-sdk => github.com/InjectiveLabs/cosmos-sdk v0.45.2-inj +replace github.com/cosmos/cosmos-sdk => github.com/InjectiveLabs/cosmos-sdk v0.45.4-inj replace github.com/CosmWasm/wasmd => github.com/InjectiveLabs/wasmd v0.27.0-inj diff --git a/go.sum b/go.sum index 31447fa5..90c165fd 100644 --- a/go.sum +++ b/go.sum @@ -78,7 +78,6 @@ github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.0.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= @@ -92,8 +91,8 @@ github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/HdrHistogram/hdrhistogram-go v1.1.0/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= -github.com/InjectiveLabs/cosmos-sdk v0.45.2-inj h1:GtdqT+aHzm0hZ5gpLSdZkgxLSDhDQIkqPGVkzCDXdJc= -github.com/InjectiveLabs/cosmos-sdk v0.45.2-inj/go.mod h1:DhSVBqJkhjB694w99FudptzPhU0XHd/qcyiNCLOjkds= +github.com/InjectiveLabs/cosmos-sdk v0.45.4-inj h1:FnniY+8JRz0o+01KVhdR9U8BCcroe8dklapQtJuCTOw= +github.com/InjectiveLabs/cosmos-sdk v0.45.4-inj/go.mod h1:WOqtDxN3eCCmnYLVla10xG7lEXkFjpTaqm2a2WasgCc= github.com/InjectiveLabs/suplog v1.3.3 h1:ARIR3lWD9BxcrmqTwgcGBt8t7e10gwOqllUAXa/MfxI= github.com/InjectiveLabs/suplog v1.3.3/go.mod h1:+I9WRgUhzmo1V/n7IkW24kFBFB9ZTPAiXXXCogWxmTM= github.com/InjectiveLabs/wasmd v0.27.0-inj h1:j/cR2j9BlWQ2+KbfUjp4PjCPjOfavJeK//Zmmg/mjkM= @@ -119,7 +118,6 @@ github.com/Workiva/go-datastructures v1.0.53 h1:J6Y/52yX10Xc5JjXmGtWoSSxs3mZnGSa github.com/Workiva/go-datastructures v1.0.53/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20201201074141-dd0ecada1be6/go.mod h1:eSYp2T6f0apnuW8TzhV3f6Aff2SE8Dwio++U4ha4yEM= github.com/adlio/schema v1.1.13/go.mod h1:L5Z7tw+7lRK1Fnpi/LT/ooCP1elkXn0krMWBQHUhEDE= -github.com/adlio/schema v1.2.3/go.mod h1:nD7ZWmMMbwU12Pqwg+qL0rTvHBrBXfNz+5UQxTfy38M= github.com/adlio/schema v1.3.0/go.mod h1:51QzxkpeFs6lRY11kPye26IaFPOV+HqEj01t5aXXKfs= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= @@ -262,8 +260,6 @@ github.com/cosmos/iavl v0.17.3 h1:s2N819a2olOmiauVa0WAhoIJq9EhSXE9HDBAoR9k+8Y= github.com/cosmos/iavl v0.17.3/go.mod h1:prJoErZFABYZGDHka1R6Oay4z9PrNeFFiMKHDAMOi4w= github.com/cosmos/ibc-go v1.0.0 h1:RtIRERSENyApp6WK7Germ3/wq8xvHxfsqfW/Xh+CJ2o= github.com/cosmos/ibc-go v1.0.0/go.mod h1:2wHKQUa+BLJMEyN635KrHfmTTwSNHBtXcqdY8JWGuXA= -github.com/cosmos/ibc-go/v2 v2.0.2 h1:y7eUgggMEVe43wHLw9XrGbeaTWtfkJYMoL3m6YW4fIY= -github.com/cosmos/ibc-go/v2 v2.0.2/go.mod h1:XUmW7wmubCRhIEAGtMGS+5IjiSSmcAwihoN/yPGd6Kk= github.com/cosmos/ibc-go/v3 v3.0.0 h1:XUNplHVS51Q2gMnTFsFsH9QJ7flsovMamnltKbEgPQ4= github.com/cosmos/ibc-go/v3 v3.0.0/go.mod h1:Mb+1NXiPOLd+CPFlOC6BKeAUaxXlhuWenMmRiUiSmwY= github.com/cosmos/interchain-accounts v0.1.0/go.mod h1:Fv6LXDs+0ng4mIDVWwEJMXbAIMxY4kiq+A7Bw1Fb9AY= @@ -992,7 +988,6 @@ github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tL github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= -github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= github.com/spf13/cobra v1.3.0/go.mod h1:BrRVncBjOJa/eUcVVm9CE+oC6as8k+VYr4NY7WCi9V4= github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q= github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= @@ -1008,7 +1003,6 @@ github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/y github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.8.0/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= -github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/spf13/viper v1.10.0/go.mod h1:SoyBPwAtKDzypXNDFKN5kzH7ppppbGZtls1UpIy5AsM= github.com/spf13/viper v1.10.1/go.mod h1:IGlFPqhNAPKRxohIzWpI5QEy4kuI7tcl5WvR+8qy1rU= github.com/spf13/viper v1.11.0 h1:7OX/1FS6n7jHD1zGrZTM7WtY13ZELRyosK4k93oPr44= @@ -1056,7 +1050,6 @@ github.com/tendermint/tendermint v0.34.0-rc6/go.mod h1:ugzyZO5foutZImv0Iyx/gOFCX github.com/tendermint/tendermint v0.34.0/go.mod h1:Aj3PIipBFSNO21r+Lq3TtzQ+uKESxkbA3yo/INM4QwQ= github.com/tendermint/tendermint v0.34.11/go.mod h1:aeHL7alPh4uTBIJQ8mgFEE8VwJLXI1VD3rVOmH2Mcy0= github.com/tendermint/tendermint v0.34.14/go.mod h1:FrwVm3TvsVicI9Z7FlucHV6Znfd5KBc/Lpp69cCwtk0= -github.com/tendermint/tendermint v0.34.16/go.mod h1:n0G22GynfeXTYbrn2IeLeB+oqsAe6R6jl4vZxZ1Y8F4= github.com/tendermint/tendermint v0.34.19 h1:y0P1qI5wSa9IRuhKnTDA6IUcOrLi1hXJuALR+R7HFEk= github.com/tendermint/tendermint v0.34.19/go.mod h1:R5+wgIwSxMdKQcmOaeudL0Cjkr3HDkhpcdum6VeU3R4= github.com/tendermint/tm-db v0.6.2/go.mod h1:GYtQ67SUvATOcoY8/+x6ylk8Qo02BQyLrAs+yAcLvGI= @@ -1698,7 +1691,6 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.63.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.66.4 h1:SsAcf+mM7mRZo2nJNGt8mZCjG8ZRaNGMURJw7BsIST4= gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= diff --git a/wasm/types/README.md b/wasm/types/README.md deleted file mode 100644 index 7b517f66..00000000 --- a/wasm/types/README.md +++ /dev/null @@ -1,24 +0,0 @@ -## Referencing WASM types - -Please don't include `github.com/CosmWasm/wasmd` as an sdk-go project dependency, those types needed on the client side should be included in this repo directly. - -### Used types files: - -``` -wasm/types/ante.go -wasm/types/codec.go -wasm/types/errors.go -wasm/types/events.go -wasm/types/genesis.go -wasm/types/genesis.pb.go -wasm/types/ibc.pb.go -wasm/types/params.go -wasm/types/proposal.go -wasm/types/proposal.pb.go -wasm/types/query.pb.go -wasm/types/query.pb.gw.go -wasm/types/tx.go -wasm/types/tx.pb.go -wasm/types/types.go -wasm/types/types.pb.go -``` diff --git a/wasm/types/ante.go b/wasm/types/ante.go deleted file mode 100644 index 4c76efdf..00000000 --- a/wasm/types/ante.go +++ /dev/null @@ -1,24 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) - -type contextKey int - -const ( - // private type creates an interface key for Context that cannot be accessed by any other package - contextKeyTXCount contextKey = iota -) - -// WithTXCounter stores a transaction counter value in the context -func WithTXCounter(ctx sdk.Context, counter uint32) sdk.Context { - return ctx.WithValue(contextKeyTXCount, counter) -} - -// TXCounter returns the tx counter value and found bool from the context. -// The result will be (0, false) for external queries or simulations where no counter available. -func TXCounter(ctx sdk.Context) (uint32, bool) { - val, ok := ctx.Value(contextKeyTXCount).(uint32) - return val, ok -} diff --git a/wasm/types/codec.go b/wasm/types/codec.go deleted file mode 100644 index 007f42ed..00000000 --- a/wasm/types/codec.go +++ /dev/null @@ -1,70 +0,0 @@ -package types - -import ( - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/msgservice" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" -) - -// RegisterLegacyAminoCodec registers the account types and interface -func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { //nolint:staticcheck - cdc.RegisterConcrete(&MsgStoreCode{}, "wasm/MsgStoreCode", nil) - cdc.RegisterConcrete(&MsgInstantiateContract{}, "wasm/MsgInstantiateContract", nil) - cdc.RegisterConcrete(&MsgExecuteContract{}, "wasm/MsgExecuteContract", nil) - cdc.RegisterConcrete(&MsgMigrateContract{}, "wasm/MsgMigrateContract", nil) - cdc.RegisterConcrete(&MsgUpdateAdmin{}, "wasm/MsgUpdateAdmin", nil) - cdc.RegisterConcrete(&MsgClearAdmin{}, "wasm/MsgClearAdmin", nil) - cdc.RegisterConcrete(&PinCodesProposal{}, "wasm/PinCodesProposal", nil) - cdc.RegisterConcrete(&UnpinCodesProposal{}, "wasm/UnpinCodesProposal", nil) - - cdc.RegisterConcrete(&StoreCodeProposal{}, "wasm/StoreCodeProposal", nil) - cdc.RegisterConcrete(&InstantiateContractProposal{}, "wasm/InstantiateContractProposal", nil) - cdc.RegisterConcrete(&MigrateContractProposal{}, "wasm/MigrateContractProposal", nil) - cdc.RegisterConcrete(&UpdateAdminProposal{}, "wasm/UpdateAdminProposal", nil) - cdc.RegisterConcrete(&ClearAdminProposal{}, "wasm/ClearAdminProposal", nil) -} - -func RegisterInterfaces(registry types.InterfaceRegistry) { - registry.RegisterImplementations( - (*sdk.Msg)(nil), - &MsgStoreCode{}, - &MsgInstantiateContract{}, - &MsgExecuteContract{}, - &MsgMigrateContract{}, - &MsgUpdateAdmin{}, - &MsgClearAdmin{}, - &MsgIBCCloseChannel{}, - &MsgIBCSend{}, - ) - registry.RegisterImplementations( - (*govtypes.Content)(nil), - &StoreCodeProposal{}, - &InstantiateContractProposal{}, - &MigrateContractProposal{}, - &UpdateAdminProposal{}, - &ClearAdminProposal{}, - &PinCodesProposal{}, - &UnpinCodesProposal{}, - ) - - registry.RegisterInterface("ContractInfoExtension", (*ContractInfoExtension)(nil)) - - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) -} - -var ( - amino = codec.NewLegacyAmino() - - // ModuleCdc references the global x/wasm module codec. - - ModuleCdc = codec.NewAminoCodec(amino) -) - -func init() { - RegisterLegacyAminoCodec(amino) - cryptocodec.RegisterCrypto(amino) - amino.Seal() -} diff --git a/wasm/types/errors.go b/wasm/types/errors.go deleted file mode 100644 index f6cd5d62..00000000 --- a/wasm/types/errors.go +++ /dev/null @@ -1,72 +0,0 @@ -package types - -import ( - sdkErrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -// Codes for wasm contract errors -var ( - DefaultCodespace = ModuleName - - // Note: never use code 1 for any errors - that is reserved for ErrInternal in the core cosmos sdk - - // ErrCreateFailed error for wasm code that has already been uploaded or failed - ErrCreateFailed = sdkErrors.Register(DefaultCodespace, 2, "create wasm contract failed") - - // ErrAccountExists error for a contract account that already exists - ErrAccountExists = sdkErrors.Register(DefaultCodespace, 3, "contract account already exists") - - // ErrInstantiateFailed error for rust instantiate contract failure - ErrInstantiateFailed = sdkErrors.Register(DefaultCodespace, 4, "instantiate wasm contract failed") - - // ErrExecuteFailed error for rust execution contract failure - ErrExecuteFailed = sdkErrors.Register(DefaultCodespace, 5, "execute wasm contract failed") - - // ErrGasLimit error for out of gas - ErrGasLimit = sdkErrors.Register(DefaultCodespace, 6, "insufficient gas") - - // ErrInvalidGenesis error for invalid genesis file syntax - ErrInvalidGenesis = sdkErrors.Register(DefaultCodespace, 7, "invalid genesis") - - // ErrNotFound error for an entry not found in the store - ErrNotFound = sdkErrors.Register(DefaultCodespace, 8, "not found") - - // ErrQueryFailed error for rust smart query contract failure - ErrQueryFailed = sdkErrors.Register(DefaultCodespace, 9, "query wasm contract failed") - - // ErrInvalidMsg error when we cannot process the error returned from the contract - ErrInvalidMsg = sdkErrors.Register(DefaultCodespace, 10, "invalid CosmosMsg from the contract") - - // ErrMigrationFailed error for rust execution contract failure - ErrMigrationFailed = sdkErrors.Register(DefaultCodespace, 11, "migrate wasm contract failed") - - // ErrEmpty error for empty content - ErrEmpty = sdkErrors.Register(DefaultCodespace, 12, "empty") - - // ErrLimit error for content that exceeds a limit - ErrLimit = sdkErrors.Register(DefaultCodespace, 13, "exceeds limit") - - // ErrInvalid error for content that is invalid in this context - ErrInvalid = sdkErrors.Register(DefaultCodespace, 14, "invalid") - - // ErrDuplicate error for content that exists - ErrDuplicate = sdkErrors.Register(DefaultCodespace, 15, "duplicate") - - // ErrMaxIBCChannels error for maximum number of ibc channels reached - ErrMaxIBCChannels = sdkErrors.Register(DefaultCodespace, 16, "max transfer channels") - - // ErrUnsupportedForContract error when a feature is used that is not supported for/ by this contract - ErrUnsupportedForContract = sdkErrors.Register(DefaultCodespace, 17, "unsupported for this contract") - - // ErrPinContractFailed error for pinning contract failures - ErrPinContractFailed = sdkErrors.Register(DefaultCodespace, 18, "pinning contract failed") - - // ErrUnpinContractFailed error for unpinning contract failures - ErrUnpinContractFailed = sdkErrors.Register(DefaultCodespace, 19, "unpinning contract failed") - - // ErrUnknownMsg error by a message handler to show that it is not responsible for this message type - ErrUnknownMsg = sdkErrors.Register(DefaultCodespace, 20, "unknown message from the contract") - - // ErrInvalidEvent error if an attribute/event from the contract is invalid - ErrInvalidEvent = sdkErrors.Register(DefaultCodespace, 21, "invalid event") -) diff --git a/wasm/types/events.go b/wasm/types/events.go deleted file mode 100644 index 0c32476f..00000000 --- a/wasm/types/events.go +++ /dev/null @@ -1,28 +0,0 @@ -package types - -const ( - // WasmModuleEventType is stored with any contract TX that returns non empty EventAttributes - WasmModuleEventType = "wasm" - // CustomContractEventPrefix contracts can create custom events. To not mix them with other system events they got the `wasm-` prefix. - CustomContractEventPrefix = "wasm-" - - EventTypeStoreCode = "store_code" - EventTypeInstantiate = "instantiate" - EventTypeExecute = "execute" - EventTypeMigrate = "migrate" - EventTypePinCode = "pin_code" - EventTypeUnpinCode = "unpin_code" - EventTypeSudo = "sudo" - EventTypeReply = "reply" - EventTypeGovContractResult = "gov_contract_result" -) - -// event attributes returned from contract execution -const ( - AttributeReservedPrefix = "_" - - AttributeKeyContractAddr = "_contract_address" - AttributeKeyCodeID = "code_id" - AttributeKeyResultDataHex = "result" - AttributeKeyFeature = "feature" -) diff --git a/wasm/types/genesis.go b/wasm/types/genesis.go deleted file mode 100644 index 98df6fd6..00000000 --- a/wasm/types/genesis.go +++ /dev/null @@ -1,100 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -func (s Sequence) ValidateBasic() error { - if len(s.IDKey) == 0 { - return sdkerrors.Wrap(ErrEmpty, "id key") - } - return nil -} - -func (s GenesisState) ValidateBasic() error { - if err := s.Params.ValidateBasic(); err != nil { - return sdkerrors.Wrap(err, "params") - } - for i := range s.Codes { - if err := s.Codes[i].ValidateBasic(); err != nil { - return sdkerrors.Wrapf(err, "code: %d", i) - } - } - for i := range s.Contracts { - if err := s.Contracts[i].ValidateBasic(); err != nil { - return sdkerrors.Wrapf(err, "contract: %d", i) - } - } - for i := range s.Sequences { - if err := s.Sequences[i].ValidateBasic(); err != nil { - return sdkerrors.Wrapf(err, "sequence: %d", i) - } - } - for i := range s.GenMsgs { - if err := s.GenMsgs[i].ValidateBasic(); err != nil { - return sdkerrors.Wrapf(err, "gen message: %d", i) - } - } - return nil -} - -func (c Code) ValidateBasic() error { - if c.CodeID == 0 { - return sdkerrors.Wrap(ErrEmpty, "code id") - } - if err := c.CodeInfo.ValidateBasic(); err != nil { - return sdkerrors.Wrap(err, "code info") - } - if err := validateWasmCode(c.CodeBytes); err != nil { - return sdkerrors.Wrap(err, "code bytes") - } - return nil -} - -func (c Contract) ValidateBasic() error { - if _, err := sdk.AccAddressFromBech32(c.ContractAddress); err != nil { - return sdkerrors.Wrap(err, "contract address") - } - if err := c.ContractInfo.ValidateBasic(); err != nil { - return sdkerrors.Wrap(err, "contract info") - } - - if c.ContractInfo.Created != nil { - return sdkerrors.Wrap(ErrInvalid, "created must be empty") - } - for i := range c.ContractState { - if err := c.ContractState[i].ValidateBasic(); err != nil { - return sdkerrors.Wrapf(err, "contract state %d", i) - } - } - return nil -} - -// AsMsg returns the underlying cosmos-sdk message instance. Null when can not be mapped to a known type. -func (m GenesisState_GenMsgs) AsMsg() sdk.Msg { - if msg := m.GetStoreCode(); msg != nil { - return msg - } - if msg := m.GetInstantiateContract(); msg != nil { - return msg - } - if msg := m.GetExecuteContract(); msg != nil { - return msg - } - return nil -} - -func (m GenesisState_GenMsgs) ValidateBasic() error { - msg := m.AsMsg() - if msg == nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "unknown message") - } - return msg.ValidateBasic() -} - -// ValidateGenesis performs basic validation of supply genesis data returning an -// error for any failed validation criteria. -func ValidateGenesis(data GenesisState) error { - return data.ValidateBasic() -} diff --git a/wasm/types/genesis.pb.go b/wasm/types/genesis.pb.go deleted file mode 100644 index 0c5096e4..00000000 --- a/wasm/types/genesis.pb.go +++ /dev/null @@ -1,1795 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmwasm/wasm/v1/genesis.proto - -package types - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// GenesisState - genesis state of x/wasm -type GenesisState struct { - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - Codes []Code `protobuf:"bytes,2,rep,name=codes,proto3" json:"codes,omitempty"` - Contracts []Contract `protobuf:"bytes,3,rep,name=contracts,proto3" json:"contracts,omitempty"` - Sequences []Sequence `protobuf:"bytes,4,rep,name=sequences,proto3" json:"sequences,omitempty"` - GenMsgs []GenesisState_GenMsgs `protobuf:"bytes,5,rep,name=gen_msgs,json=genMsgs,proto3" json:"gen_msgs,omitempty"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_2ab3f539b23472a6, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -func (m *GenesisState) GetCodes() []Code { - if m != nil { - return m.Codes - } - return nil -} - -func (m *GenesisState) GetContracts() []Contract { - if m != nil { - return m.Contracts - } - return nil -} - -func (m *GenesisState) GetSequences() []Sequence { - if m != nil { - return m.Sequences - } - return nil -} - -func (m *GenesisState) GetGenMsgs() []GenesisState_GenMsgs { - if m != nil { - return m.GenMsgs - } - return nil -} - -// GenMsgs define the messages that can be executed during genesis phase in -// order. The intention is to have more human readable data that is auditable. -type GenesisState_GenMsgs struct { - // sum is a single message - // - // Types that are valid to be assigned to Sum: - // *GenesisState_GenMsgs_StoreCode - // *GenesisState_GenMsgs_InstantiateContract - // *GenesisState_GenMsgs_ExecuteContract - Sum isGenesisState_GenMsgs_Sum `protobuf_oneof:"sum"` -} - -func (m *GenesisState_GenMsgs) Reset() { *m = GenesisState_GenMsgs{} } -func (m *GenesisState_GenMsgs) String() string { return proto.CompactTextString(m) } -func (*GenesisState_GenMsgs) ProtoMessage() {} -func (*GenesisState_GenMsgs) Descriptor() ([]byte, []int) { - return fileDescriptor_2ab3f539b23472a6, []int{0, 0} -} -func (m *GenesisState_GenMsgs) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState_GenMsgs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState_GenMsgs.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GenesisState_GenMsgs) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState_GenMsgs.Merge(m, src) -} -func (m *GenesisState_GenMsgs) XXX_Size() int { - return m.Size() -} -func (m *GenesisState_GenMsgs) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState_GenMsgs.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState_GenMsgs proto.InternalMessageInfo - -type isGenesisState_GenMsgs_Sum interface { - isGenesisState_GenMsgs_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type GenesisState_GenMsgs_StoreCode struct { - StoreCode *MsgStoreCode `protobuf:"bytes,1,opt,name=store_code,json=storeCode,proto3,oneof" json:"store_code,omitempty"` -} -type GenesisState_GenMsgs_InstantiateContract struct { - InstantiateContract *MsgInstantiateContract `protobuf:"bytes,2,opt,name=instantiate_contract,json=instantiateContract,proto3,oneof" json:"instantiate_contract,omitempty"` -} -type GenesisState_GenMsgs_ExecuteContract struct { - ExecuteContract *MsgExecuteContract `protobuf:"bytes,3,opt,name=execute_contract,json=executeContract,proto3,oneof" json:"execute_contract,omitempty"` -} - -func (*GenesisState_GenMsgs_StoreCode) isGenesisState_GenMsgs_Sum() {} -func (*GenesisState_GenMsgs_InstantiateContract) isGenesisState_GenMsgs_Sum() {} -func (*GenesisState_GenMsgs_ExecuteContract) isGenesisState_GenMsgs_Sum() {} - -func (m *GenesisState_GenMsgs) GetSum() isGenesisState_GenMsgs_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *GenesisState_GenMsgs) GetStoreCode() *MsgStoreCode { - if x, ok := m.GetSum().(*GenesisState_GenMsgs_StoreCode); ok { - return x.StoreCode - } - return nil -} - -func (m *GenesisState_GenMsgs) GetInstantiateContract() *MsgInstantiateContract { - if x, ok := m.GetSum().(*GenesisState_GenMsgs_InstantiateContract); ok { - return x.InstantiateContract - } - return nil -} - -func (m *GenesisState_GenMsgs) GetExecuteContract() *MsgExecuteContract { - if x, ok := m.GetSum().(*GenesisState_GenMsgs_ExecuteContract); ok { - return x.ExecuteContract - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*GenesisState_GenMsgs) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*GenesisState_GenMsgs_StoreCode)(nil), - (*GenesisState_GenMsgs_InstantiateContract)(nil), - (*GenesisState_GenMsgs_ExecuteContract)(nil), - } -} - -// Code struct encompasses CodeInfo and CodeBytes -type Code struct { - CodeID uint64 `protobuf:"varint,1,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` - CodeInfo CodeInfo `protobuf:"bytes,2,opt,name=code_info,json=codeInfo,proto3" json:"code_info"` - CodeBytes []byte `protobuf:"bytes,3,opt,name=code_bytes,json=codeBytes,proto3" json:"code_bytes,omitempty"` - // Pinned to wasmvm cache - Pinned bool `protobuf:"varint,4,opt,name=pinned,proto3" json:"pinned,omitempty"` -} - -func (m *Code) Reset() { *m = Code{} } -func (m *Code) String() string { return proto.CompactTextString(m) } -func (*Code) ProtoMessage() {} -func (*Code) Descriptor() ([]byte, []int) { - return fileDescriptor_2ab3f539b23472a6, []int{1} -} -func (m *Code) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Code) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Code.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Code) XXX_Merge(src proto.Message) { - xxx_messageInfo_Code.Merge(m, src) -} -func (m *Code) XXX_Size() int { - return m.Size() -} -func (m *Code) XXX_DiscardUnknown() { - xxx_messageInfo_Code.DiscardUnknown(m) -} - -var xxx_messageInfo_Code proto.InternalMessageInfo - -func (m *Code) GetCodeID() uint64 { - if m != nil { - return m.CodeID - } - return 0 -} - -func (m *Code) GetCodeInfo() CodeInfo { - if m != nil { - return m.CodeInfo - } - return CodeInfo{} -} - -func (m *Code) GetCodeBytes() []byte { - if m != nil { - return m.CodeBytes - } - return nil -} - -func (m *Code) GetPinned() bool { - if m != nil { - return m.Pinned - } - return false -} - -// Contract struct encompasses ContractAddress, ContractInfo, and ContractState -type Contract struct { - ContractAddress string `protobuf:"bytes,1,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"` - ContractInfo ContractInfo `protobuf:"bytes,2,opt,name=contract_info,json=contractInfo,proto3" json:"contract_info"` - ContractState []Model `protobuf:"bytes,3,rep,name=contract_state,json=contractState,proto3" json:"contract_state"` -} - -func (m *Contract) Reset() { *m = Contract{} } -func (m *Contract) String() string { return proto.CompactTextString(m) } -func (*Contract) ProtoMessage() {} -func (*Contract) Descriptor() ([]byte, []int) { - return fileDescriptor_2ab3f539b23472a6, []int{2} -} -func (m *Contract) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Contract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Contract.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Contract) XXX_Merge(src proto.Message) { - xxx_messageInfo_Contract.Merge(m, src) -} -func (m *Contract) XXX_Size() int { - return m.Size() -} -func (m *Contract) XXX_DiscardUnknown() { - xxx_messageInfo_Contract.DiscardUnknown(m) -} - -var xxx_messageInfo_Contract proto.InternalMessageInfo - -func (m *Contract) GetContractAddress() string { - if m != nil { - return m.ContractAddress - } - return "" -} - -func (m *Contract) GetContractInfo() ContractInfo { - if m != nil { - return m.ContractInfo - } - return ContractInfo{} -} - -func (m *Contract) GetContractState() []Model { - if m != nil { - return m.ContractState - } - return nil -} - -// Sequence key and value of an id generation counter -type Sequence struct { - IDKey []byte `protobuf:"bytes,1,opt,name=id_key,json=idKey,proto3" json:"id_key,omitempty"` - Value uint64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *Sequence) Reset() { *m = Sequence{} } -func (m *Sequence) String() string { return proto.CompactTextString(m) } -func (*Sequence) ProtoMessage() {} -func (*Sequence) Descriptor() ([]byte, []int) { - return fileDescriptor_2ab3f539b23472a6, []int{3} -} -func (m *Sequence) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Sequence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Sequence.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Sequence) XXX_Merge(src proto.Message) { - xxx_messageInfo_Sequence.Merge(m, src) -} -func (m *Sequence) XXX_Size() int { - return m.Size() -} -func (m *Sequence) XXX_DiscardUnknown() { - xxx_messageInfo_Sequence.DiscardUnknown(m) -} - -var xxx_messageInfo_Sequence proto.InternalMessageInfo - -func (m *Sequence) GetIDKey() []byte { - if m != nil { - return m.IDKey - } - return nil -} - -func (m *Sequence) GetValue() uint64 { - if m != nil { - return m.Value - } - return 0 -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "cosmwasm.wasm.v1.GenesisState") - proto.RegisterType((*GenesisState_GenMsgs)(nil), "cosmwasm.wasm.v1.GenesisState.GenMsgs") - proto.RegisterType((*Code)(nil), "cosmwasm.wasm.v1.Code") - proto.RegisterType((*Contract)(nil), "cosmwasm.wasm.v1.Contract") - proto.RegisterType((*Sequence)(nil), "cosmwasm.wasm.v1.Sequence") -} - -func init() { proto.RegisterFile("cosmwasm/wasm/v1/genesis.proto", fileDescriptor_2ab3f539b23472a6) } - -var fileDescriptor_2ab3f539b23472a6 = []byte{ - // 646 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x94, 0xcf, 0x6e, 0xd3, 0x4e, - 0x10, 0xc7, 0xe3, 0x26, 0x4e, 0x93, 0x69, 0x7e, 0xbf, 0x56, 0xdb, 0xaa, 0x35, 0x06, 0x9c, 0x28, - 0xa0, 0x2a, 0x48, 0x28, 0x51, 0x8b, 0xc4, 0x0d, 0x01, 0x6e, 0x2b, 0x6a, 0x55, 0x95, 0xc0, 0x15, - 0x42, 0x42, 0xaa, 0x22, 0xd7, 0xde, 0x1a, 0x8b, 0xda, 0x1b, 0xb2, 0x9b, 0x52, 0x9f, 0x79, 0x01, - 0x1e, 0x01, 0x5e, 0x06, 0xf5, 0xd8, 0x23, 0xa7, 0x08, 0xa5, 0x37, 0x9e, 0x02, 0xed, 0x1f, 0xbb, - 0x06, 0xa7, 0x17, 0x2b, 0x3b, 0xf3, 0x9d, 0xcf, 0xfc, 0xc9, 0xec, 0x82, 0xe5, 0x13, 0x1a, 0x7f, - 0xf6, 0x68, 0x3c, 0x10, 0x9f, 0xf3, 0xad, 0x41, 0x88, 0x13, 0x4c, 0x23, 0xda, 0x1f, 0x8d, 0x09, - 0x23, 0x68, 0x25, 0xf3, 0xf7, 0xc5, 0xe7, 0x7c, 0xcb, 0x5c, 0x0b, 0x49, 0x48, 0x84, 0x73, 0xc0, - 0x7f, 0x49, 0x9d, 0x79, 0xaf, 0xc4, 0x61, 0xe9, 0x08, 0x2b, 0x8a, 0x79, 0xa7, 0xec, 0xbd, 0x90, - 0xae, 0xee, 0x37, 0x1d, 0x5a, 0xaf, 0x64, 0xca, 0x23, 0xe6, 0x31, 0x8c, 0x9e, 0x42, 0x7d, 0xe4, - 0x8d, 0xbd, 0x98, 0x1a, 0x5a, 0x47, 0xeb, 0x2d, 0x6d, 0x1b, 0xfd, 0x7f, 0x4b, 0xe8, 0xbf, 0x16, - 0x7e, 0xbb, 0x76, 0x39, 0x6d, 0x57, 0x5c, 0xa5, 0x46, 0x7b, 0xa0, 0xfb, 0x24, 0xc0, 0xd4, 0x58, - 0xe8, 0x54, 0x7b, 0x4b, 0xdb, 0xeb, 0xe5, 0xb0, 0x1d, 0x12, 0x60, 0x7b, 0x83, 0x07, 0xfd, 0x9e, - 0xb6, 0x97, 0x85, 0xf8, 0x31, 0x89, 0x23, 0x86, 0xe3, 0x11, 0x4b, 0x5d, 0x19, 0x8d, 0xde, 0x42, - 0xd3, 0x27, 0x09, 0x1b, 0x7b, 0x3e, 0xa3, 0x46, 0x55, 0xa0, 0xcc, 0x79, 0x28, 0x29, 0xb1, 0xef, - 0x2a, 0xdc, 0x6a, 0x1e, 0x54, 0x40, 0xde, 0x90, 0x38, 0x96, 0xe2, 0x4f, 0x13, 0x9c, 0xf8, 0x98, - 0x1a, 0xb5, 0xdb, 0xb0, 0x47, 0x4a, 0x72, 0x83, 0xcd, 0x83, 0x8a, 0xd8, 0xdc, 0x88, 0x8e, 0xa1, - 0x11, 0xe2, 0x64, 0x18, 0xd3, 0x90, 0x1a, 0xba, 0xa0, 0x6e, 0x96, 0xa9, 0xc5, 0xf1, 0xf2, 0xc3, - 0x21, 0x0d, 0xa9, 0x6d, 0xaa, 0x0c, 0x28, 0x8b, 0x2f, 0x24, 0x58, 0x0c, 0xa5, 0xc8, 0xfc, 0xb2, - 0x00, 0x8b, 0x2a, 0x00, 0x3d, 0x07, 0xa0, 0x8c, 0x8c, 0xf1, 0x90, 0xcf, 0x49, 0xfd, 0x37, 0x56, - 0x39, 0xd9, 0x21, 0x0d, 0x8f, 0xb8, 0x8c, 0x0f, 0x7b, 0xbf, 0xe2, 0x36, 0x69, 0x76, 0x40, 0xc7, - 0xb0, 0x16, 0x25, 0x94, 0x79, 0x09, 0x8b, 0x3c, 0xc6, 0x31, 0x72, 0x36, 0xc6, 0x82, 0x40, 0xf5, - 0xe6, 0xa2, 0x9c, 0x9b, 0x80, 0x6c, 0xe4, 0xfb, 0x15, 0x77, 0x35, 0x2a, 0x9b, 0xd1, 0x1b, 0x58, - 0xc1, 0x17, 0xd8, 0x9f, 0x14, 0xd1, 0x55, 0x81, 0x7e, 0x38, 0x17, 0xbd, 0x27, 0xc5, 0x05, 0xec, - 0x32, 0xfe, 0xdb, 0x64, 0xeb, 0x50, 0xa5, 0x93, 0xb8, 0xfb, 0x5d, 0x83, 0x9a, 0xe8, 0xe0, 0x01, - 0x2c, 0xf2, 0xe6, 0x87, 0x51, 0x20, 0xfa, 0xaf, 0xd9, 0x30, 0x9b, 0xb6, 0xeb, 0xdc, 0xe5, 0xec, - 0xba, 0x75, 0xee, 0x72, 0x02, 0xf4, 0x8c, 0x2f, 0x10, 0x17, 0x25, 0xa7, 0x44, 0xf5, 0x66, 0xce, - 0xdf, 0x45, 0x27, 0x39, 0x25, 0x6a, 0x89, 0x1b, 0xbe, 0x3a, 0xa3, 0xfb, 0x00, 0x22, 0xfc, 0x24, - 0x65, 0x98, 0x8a, 0x06, 0x5a, 0xae, 0x00, 0xda, 0xdc, 0x80, 0xd6, 0xa1, 0x3e, 0x8a, 0x92, 0x04, - 0x07, 0x46, 0xad, 0xa3, 0xf5, 0x1a, 0xae, 0x3a, 0x75, 0x7f, 0x68, 0xd0, 0xc8, 0x47, 0xf1, 0x08, - 0x56, 0xb2, 0x11, 0x0c, 0xbd, 0x20, 0x18, 0x63, 0x2a, 0x2f, 0x53, 0xd3, 0x5d, 0xce, 0xec, 0x2f, - 0xa5, 0x19, 0x39, 0xf0, 0x5f, 0x2e, 0x2d, 0x54, 0x6c, 0xdd, 0xbe, 0xf2, 0x85, 0xaa, 0x5b, 0x7e, - 0xc1, 0x86, 0x76, 0xe1, 0xff, 0x1c, 0x45, 0xf9, 0xae, 0xa9, 0xeb, 0xb3, 0x31, 0x67, 0xfc, 0x24, - 0xc0, 0x67, 0x0a, 0x92, 0xe7, 0x17, 0xfb, 0xd9, 0xb5, 0xa1, 0x91, 0xdd, 0x02, 0xd4, 0x81, 0x7a, - 0x14, 0x0c, 0x3f, 0xe2, 0x54, 0x54, 0xdf, 0xb2, 0x9b, 0xb3, 0x69, 0x5b, 0x77, 0x76, 0x0f, 0x70, - 0xea, 0xea, 0x51, 0x70, 0x80, 0x53, 0xb4, 0x06, 0xfa, 0xb9, 0x77, 0x36, 0xc1, 0xa2, 0xec, 0x9a, - 0x2b, 0x0f, 0xf6, 0x8b, 0xcb, 0x99, 0xa5, 0x5d, 0xcd, 0x2c, 0xed, 0xd7, 0xcc, 0xd2, 0xbe, 0x5e, - 0x5b, 0x95, 0xab, 0x6b, 0xab, 0xf2, 0xf3, 0xda, 0xaa, 0xbc, 0xdf, 0x0c, 0x23, 0xf6, 0x61, 0x72, - 0xd2, 0xf7, 0x49, 0x3c, 0xd8, 0x21, 0x34, 0x7e, 0x97, 0xbd, 0x49, 0xc1, 0xe0, 0x42, 0xbe, 0x4d, - 0xe2, 0xd9, 0x3a, 0xa9, 0x8b, 0xc7, 0xe9, 0xc9, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7c, 0x05, - 0x87, 0xde, 0x1f, 0x05, 0x00, 0x00, -} - -func (m *GenesisState) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.GenMsgs) > 0 { - for iNdEx := len(m.GenMsgs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.GenMsgs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.Sequences) > 0 { - for iNdEx := len(m.Sequences) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Sequences[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.Contracts) > 0 { - for iNdEx := len(m.Contracts) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Contracts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Codes) > 0 { - for iNdEx := len(m.Codes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Codes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *GenesisState_GenMsgs) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GenesisState_GenMsgs) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState_GenMsgs) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *GenesisState_GenMsgs_StoreCode) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState_GenMsgs_StoreCode) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.StoreCode != nil { - { - size, err := m.StoreCode.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *GenesisState_GenMsgs_InstantiateContract) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState_GenMsgs_InstantiateContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.InstantiateContract != nil { - { - size, err := m.InstantiateContract.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *GenesisState_GenMsgs_ExecuteContract) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState_GenMsgs_ExecuteContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ExecuteContract != nil { - { - size, err := m.ExecuteContract.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *Code) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Code) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Code) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pinned { - i-- - if m.Pinned { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if len(m.CodeBytes) > 0 { - i -= len(m.CodeBytes) - copy(dAtA[i:], m.CodeBytes) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.CodeBytes))) - i-- - dAtA[i] = 0x1a - } - { - size, err := m.CodeInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.CodeID != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.CodeID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Contract) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Contract) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Contract) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ContractState) > 0 { - for iNdEx := len(m.ContractState) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ContractState[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - { - size, err := m.ContractInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.ContractAddress) > 0 { - i -= len(m.ContractAddress) - copy(dAtA[i:], m.ContractAddress) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.ContractAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Sequence) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Sequence) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Sequence) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Value != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.Value)) - i-- - dAtA[i] = 0x10 - } - if len(m.IDKey) > 0 { - i -= len(m.IDKey) - copy(dAtA[i:], m.IDKey) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.IDKey))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) - if len(m.Codes) > 0 { - for _, e := range m.Codes { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.Contracts) > 0 { - for _, e := range m.Contracts { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.Sequences) > 0 { - for _, e := range m.Sequences { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.GenMsgs) > 0 { - for _, e := range m.GenMsgs { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - return n -} - -func (m *GenesisState_GenMsgs) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n -} - -func (m *GenesisState_GenMsgs_StoreCode) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.StoreCode != nil { - l = m.StoreCode.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - return n -} -func (m *GenesisState_GenMsgs_InstantiateContract) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.InstantiateContract != nil { - l = m.InstantiateContract.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - return n -} -func (m *GenesisState_GenMsgs_ExecuteContract) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ExecuteContract != nil { - l = m.ExecuteContract.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - return n -} -func (m *Code) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CodeID != 0 { - n += 1 + sovGenesis(uint64(m.CodeID)) - } - l = m.CodeInfo.Size() - n += 1 + l + sovGenesis(uint64(l)) - l = len(m.CodeBytes) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - if m.Pinned { - n += 2 - } - return n -} - -func (m *Contract) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ContractAddress) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = m.ContractInfo.Size() - n += 1 + l + sovGenesis(uint64(l)) - if len(m.ContractState) > 0 { - for _, e := range m.ContractState { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - return n -} - -func (m *Sequence) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.IDKey) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - if m.Value != 0 { - n += 1 + sovGenesis(uint64(m.Value)) - } - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GenesisState) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Codes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Codes = append(m.Codes, Code{}) - if err := m.Codes[len(m.Codes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Contracts", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Contracts = append(m.Contracts, Contract{}) - if err := m.Contracts[len(m.Contracts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sequences", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Sequences = append(m.Sequences, Sequence{}) - if err := m.Sequences[len(m.Sequences)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GenMsgs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.GenMsgs = append(m.GenMsgs, GenesisState_GenMsgs{}) - if err := m.GenMsgs[len(m.GenMsgs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GenesisState_GenMsgs) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GenMsgs: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenMsgs: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StoreCode", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &MsgStoreCode{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &GenesisState_GenMsgs_StoreCode{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InstantiateContract", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &MsgInstantiateContract{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &GenesisState_GenMsgs_InstantiateContract{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecuteContract", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &MsgExecuteContract{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &GenesisState_GenMsgs_ExecuteContract{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Code) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Code: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Code: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CodeID", wireType) - } - m.CodeID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CodeID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CodeInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.CodeInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CodeBytes", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CodeBytes = append(m.CodeBytes[:0], dAtA[iNdEx:postIndex]...) - if m.CodeBytes == nil { - m.CodeBytes = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Pinned", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Pinned = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Contract) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Contract: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Contract: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ContractInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractState", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContractState = append(m.ContractState, Model{}) - if err := m.ContractState[len(m.ContractState)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Sequence) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Sequence: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Sequence: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IDKey", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IDKey = append(m.IDKey[:0], dAtA[iNdEx:postIndex]...) - if m.IDKey == nil { - m.IDKey = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - m.Value = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Value |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenesis(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/wasm/types/ibc.pb.go b/wasm/types/ibc.pb.go deleted file mode 100644 index ac6c9f00..00000000 --- a/wasm/types/ibc.pb.go +++ /dev/null @@ -1,591 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmwasm/wasm/v1/ibc.proto - -package types - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// MsgIBCSend -type MsgIBCSend struct { - // the channel by which the packet will be sent - Channel string `protobuf:"bytes,2,opt,name=channel,proto3" json:"channel,omitempty" yaml:"source_channel"` - // Timeout height relative to the current block height. - // The timeout is disabled when set to 0. - TimeoutHeight uint64 `protobuf:"varint,4,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height,omitempty" yaml:"timeout_height"` - // Timeout timestamp (in nanoseconds) relative to the current block timestamp. - // The timeout is disabled when set to 0. - TimeoutTimestamp uint64 `protobuf:"varint,5,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3" json:"timeout_timestamp,omitempty" yaml:"timeout_timestamp"` - // Data is the payload to transfer. We must not make assumption what format or - // content is in here. - Data []byte `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"` -} - -func (m *MsgIBCSend) Reset() { *m = MsgIBCSend{} } -func (m *MsgIBCSend) String() string { return proto.CompactTextString(m) } -func (*MsgIBCSend) ProtoMessage() {} -func (*MsgIBCSend) Descriptor() ([]byte, []int) { - return fileDescriptor_af0d1c43ea53c4b9, []int{0} -} -func (m *MsgIBCSend) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgIBCSend) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgIBCSend.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgIBCSend) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgIBCSend.Merge(m, src) -} -func (m *MsgIBCSend) XXX_Size() int { - return m.Size() -} -func (m *MsgIBCSend) XXX_DiscardUnknown() { - xxx_messageInfo_MsgIBCSend.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgIBCSend proto.InternalMessageInfo - -// MsgIBCCloseChannel port and channel need to be owned by the contract -type MsgIBCCloseChannel struct { - Channel string `protobuf:"bytes,2,opt,name=channel,proto3" json:"channel,omitempty" yaml:"source_channel"` -} - -func (m *MsgIBCCloseChannel) Reset() { *m = MsgIBCCloseChannel{} } -func (m *MsgIBCCloseChannel) String() string { return proto.CompactTextString(m) } -func (*MsgIBCCloseChannel) ProtoMessage() {} -func (*MsgIBCCloseChannel) Descriptor() ([]byte, []int) { - return fileDescriptor_af0d1c43ea53c4b9, []int{1} -} -func (m *MsgIBCCloseChannel) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgIBCCloseChannel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgIBCCloseChannel.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgIBCCloseChannel) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgIBCCloseChannel.Merge(m, src) -} -func (m *MsgIBCCloseChannel) XXX_Size() int { - return m.Size() -} -func (m *MsgIBCCloseChannel) XXX_DiscardUnknown() { - xxx_messageInfo_MsgIBCCloseChannel.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgIBCCloseChannel proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgIBCSend)(nil), "cosmwasm.wasm.v1.MsgIBCSend") - proto.RegisterType((*MsgIBCCloseChannel)(nil), "cosmwasm.wasm.v1.MsgIBCCloseChannel") -} - -func init() { proto.RegisterFile("cosmwasm/wasm/v1/ibc.proto", fileDescriptor_af0d1c43ea53c4b9) } - -var fileDescriptor_af0d1c43ea53c4b9 = []byte{ - // 299 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4a, 0xce, 0x2f, 0xce, - 0x2d, 0x4f, 0x2c, 0xce, 0xd5, 0x07, 0x13, 0x65, 0x86, 0xfa, 0x99, 0x49, 0xc9, 0x7a, 0x05, 0x45, - 0xf9, 0x25, 0xf9, 0x42, 0x02, 0x30, 0x39, 0x3d, 0x30, 0x51, 0x66, 0x28, 0x25, 0x92, 0x9e, 0x9f, - 0x9e, 0x0f, 0x96, 0xd4, 0x07, 0xb1, 0x20, 0xea, 0x94, 0x1e, 0x31, 0x72, 0x71, 0xf9, 0x16, 0xa7, - 0x7b, 0x3a, 0x39, 0x07, 0xa7, 0xe6, 0xa5, 0x08, 0x19, 0x73, 0xb1, 0x27, 0x67, 0x24, 0xe6, 0xe5, - 0xa5, 0xe6, 0x48, 0x30, 0x29, 0x30, 0x6a, 0x70, 0x3a, 0x49, 0x7e, 0xba, 0x27, 0x2f, 0x5a, 0x99, - 0x98, 0x9b, 0x63, 0xa5, 0x54, 0x9c, 0x5f, 0x5a, 0x94, 0x9c, 0x1a, 0x0f, 0x95, 0x57, 0x0a, 0x82, - 0xa9, 0x14, 0x72, 0xe0, 0xe2, 0x2b, 0xc9, 0xcc, 0x4d, 0xcd, 0x2f, 0x2d, 0x89, 0xcf, 0x48, 0xcd, - 0x4c, 0xcf, 0x28, 0x91, 0x60, 0x51, 0x60, 0xd4, 0x60, 0x41, 0xd6, 0x8b, 0x2a, 0xaf, 0x14, 0xc4, - 0x0b, 0x15, 0xf0, 0x00, 0xf3, 0x85, 0x3c, 0xb9, 0x04, 0x61, 0x2a, 0x40, 0x74, 0x71, 0x49, 0x62, - 0x6e, 0x81, 0x04, 0x2b, 0xd8, 0x10, 0x99, 0x4f, 0xf7, 0xe4, 0x25, 0x50, 0x0d, 0x81, 0x2b, 0x51, - 0x0a, 0x12, 0x80, 0x8a, 0x85, 0xc0, 0x84, 0x84, 0x84, 0xb8, 0x58, 0x52, 0x12, 0x4b, 0x12, 0x25, - 0xd8, 0x14, 0x18, 0x35, 0x78, 0x82, 0xc0, 0x6c, 0x25, 0x4f, 0x2e, 0x21, 0x88, 0x1f, 0x9d, 0x73, - 0xf2, 0x8b, 0x53, 0x9d, 0xa1, 0xce, 0x26, 0xc7, 0xaf, 0x4e, 0x2e, 0x27, 0x1e, 0xca, 0x31, 0x9c, - 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, 0x5a, 0x7a, 0x66, 0x49, 0x46, 0x69, - 0x92, 0x5e, 0x72, 0x7e, 0xae, 0xbe, 0x73, 0x7e, 0x71, 0x6e, 0x38, 0x2c, 0x72, 0x52, 0xf4, 0x2b, - 0x20, 0x91, 0x54, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x0e, 0x7c, 0x63, 0x40, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x4d, 0x60, 0x95, 0x31, 0xc2, 0x01, 0x00, 0x00, -} - -func (m *MsgIBCSend) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgIBCSend) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgIBCSend) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintIbc(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x32 - } - if m.TimeoutTimestamp != 0 { - i = encodeVarintIbc(dAtA, i, uint64(m.TimeoutTimestamp)) - i-- - dAtA[i] = 0x28 - } - if m.TimeoutHeight != 0 { - i = encodeVarintIbc(dAtA, i, uint64(m.TimeoutHeight)) - i-- - dAtA[i] = 0x20 - } - if len(m.Channel) > 0 { - i -= len(m.Channel) - copy(dAtA[i:], m.Channel) - i = encodeVarintIbc(dAtA, i, uint64(len(m.Channel))) - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} - -func (m *MsgIBCCloseChannel) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgIBCCloseChannel) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgIBCCloseChannel) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Channel) > 0 { - i -= len(m.Channel) - copy(dAtA[i:], m.Channel) - i = encodeVarintIbc(dAtA, i, uint64(len(m.Channel))) - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} - -func encodeVarintIbc(dAtA []byte, offset int, v uint64) int { - offset -= sovIbc(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MsgIBCSend) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Channel) - if l > 0 { - n += 1 + l + sovIbc(uint64(l)) - } - if m.TimeoutHeight != 0 { - n += 1 + sovIbc(uint64(m.TimeoutHeight)) - } - if m.TimeoutTimestamp != 0 { - n += 1 + sovIbc(uint64(m.TimeoutTimestamp)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovIbc(uint64(l)) - } - return n -} - -func (m *MsgIBCCloseChannel) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Channel) - if l > 0 { - n += 1 + l + sovIbc(uint64(l)) - } - return n -} - -func sovIbc(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozIbc(x uint64) (n int) { - return sovIbc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgIBCSend) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIbc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgIBCSend: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgIBCSend: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Channel", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIbc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthIbc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthIbc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Channel = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeoutHeight", wireType) - } - m.TimeoutHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIbc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TimeoutHeight |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeoutTimestamp", wireType) - } - m.TimeoutTimestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIbc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TimeoutTimestamp |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIbc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthIbc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthIbc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipIbc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthIbc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgIBCCloseChannel) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIbc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgIBCCloseChannel: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgIBCCloseChannel: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Channel", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIbc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthIbc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthIbc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Channel = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipIbc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthIbc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipIbc(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowIbc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowIbc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowIbc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthIbc - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupIbc - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthIbc - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthIbc = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowIbc = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupIbc = fmt.Errorf("proto: unexpected end of group") -) diff --git a/wasm/types/keys.go b/wasm/types/keys.go deleted file mode 100644 index 4bc044e2..00000000 --- a/wasm/types/keys.go +++ /dev/null @@ -1,108 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) - -const ( - // ModuleName is the name of the contract module - ModuleName = "wasm" - - // StoreKey is the string store representation - StoreKey = ModuleName - - // TStoreKey is the string transient store representation - TStoreKey = "transient_" + ModuleName - - // QuerierRoute is the querier route for the wasm module - QuerierRoute = ModuleName - - // RouterKey is the msg router key for the wasm module - RouterKey = ModuleName -) - -// nolint -var ( - CodeKeyPrefix = []byte{0x01} - ContractKeyPrefix = []byte{0x02} - ContractStorePrefix = []byte{0x03} - SequenceKeyPrefix = []byte{0x04} - ContractCodeHistoryElementPrefix = []byte{0x05} - ContractByCodeIDAndCreatedSecondaryIndexPrefix = []byte{0x06} - PinnedCodeIndexPrefix = []byte{0x07} - TXCounterPrefix = []byte{0x08} - - KeyLastCodeID = append(SequenceKeyPrefix, []byte("lastCodeId")...) - KeyLastInstanceID = append(SequenceKeyPrefix, []byte("lastContractId")...) -) - -// GetCodeKey constructs the key for retreiving the ID for the WASM code -func GetCodeKey(codeID uint64) []byte { - contractIDBz := sdk.Uint64ToBigEndian(codeID) - return append(CodeKeyPrefix, contractIDBz...) -} - -// GetContractAddressKey returns the key for the WASM contract instance -func GetContractAddressKey(addr sdk.AccAddress) []byte { - return append(ContractKeyPrefix, addr...) -} - -// GetContractStorePrefix returns the store prefix for the WASM contract instance -func GetContractStorePrefix(addr sdk.AccAddress) []byte { - return append(ContractStorePrefix, addr...) -} - -// GetContractByCreatedSecondaryIndexKey returns the key for the secondary index: -// `` -func GetContractByCreatedSecondaryIndexKey(contractAddr sdk.AccAddress, c ContractCodeHistoryEntry) []byte { - prefix := GetContractByCodeIDSecondaryIndexPrefix(c.CodeID) - prefixLen := len(prefix) - r := make([]byte, prefixLen+AbsoluteTxPositionLen+len(contractAddr.Bytes())) - copy(r[0:], prefix) - copy(r[prefixLen:], c.Updated.Bytes()) - copy(r[prefixLen+AbsoluteTxPositionLen:], contractAddr) - return r -} - -// GetContractByCodeIDSecondaryIndexPrefix returns the prefix for the second index: `` -func GetContractByCodeIDSecondaryIndexPrefix(codeID uint64) []byte { - prefixLen := len(ContractByCodeIDAndCreatedSecondaryIndexPrefix) - const codeIDLen = 8 - r := make([]byte, prefixLen+codeIDLen) - copy(r[0:], ContractByCodeIDAndCreatedSecondaryIndexPrefix) - copy(r[prefixLen:], sdk.Uint64ToBigEndian(codeID)) - return r -} - -// GetContractCodeHistoryElementKey returns the key a contract code history entry: `` -func GetContractCodeHistoryElementKey(contractAddr sdk.AccAddress, pos uint64) []byte { - prefix := GetContractCodeHistoryElementPrefix(contractAddr) - prefixLen := len(prefix) - r := make([]byte, prefixLen+8) - copy(r[0:], prefix) - copy(r[prefixLen:], sdk.Uint64ToBigEndian(pos)) - return r -} - -// GetContractCodeHistoryElementPrefix returns the key prefix for a contract code history entry: `` -func GetContractCodeHistoryElementPrefix(contractAddr sdk.AccAddress) []byte { - prefixLen := len(ContractCodeHistoryElementPrefix) - r := make([]byte, prefixLen+len(contractAddr.Bytes())) - copy(r[0:], ContractCodeHistoryElementPrefix) - copy(r[prefixLen:], contractAddr) - return r -} - -// GetPinnedCodeIndexPrefix returns the key prefix for a code id pinned into the wasmvm cache -func GetPinnedCodeIndexPrefix(codeID uint64) []byte { - prefixLen := len(PinnedCodeIndexPrefix) - r := make([]byte, prefixLen+8) - copy(r[0:], PinnedCodeIndexPrefix) - copy(r[prefixLen:], sdk.Uint64ToBigEndian(codeID)) - return r -} - -// ParsePinnedCodeIndex converts the serialized code ID back. -func ParsePinnedCodeIndex(s []byte) uint64 { - return sdk.BigEndianToUint64(s) -} diff --git a/wasm/types/params.go b/wasm/types/params.go deleted file mode 100644 index 1a3eede8..00000000 --- a/wasm/types/params.go +++ /dev/null @@ -1,198 +0,0 @@ -package types - -import ( - "encoding/json" - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/gogo/protobuf/jsonpb" - "github.com/pkg/errors" - "gopkg.in/yaml.v2" -) - -const ( - // DefaultParamspace for params keeper - DefaultParamspace = ModuleName - // DefaultMaxWasmCodeSize limit max bytes read to prevent gzip bombs - DefaultMaxWasmCodeSize = 600 * 1024 * 2 -) - -var ParamStoreKeyUploadAccess = []byte("uploadAccess") -var ParamStoreKeyInstantiateAccess = []byte("instantiateAccess") -var ParamStoreKeyMaxWasmCodeSize = []byte("maxWasmCodeSize") - -var AllAccessTypes = []AccessType{ - AccessTypeNobody, - AccessTypeOnlyAddress, - AccessTypeEverybody, -} - -func (a AccessType) With(addr sdk.AccAddress) AccessConfig { - switch a { - case AccessTypeNobody: - return AllowNobody - case AccessTypeOnlyAddress: - if err := sdk.VerifyAddressFormat(addr); err != nil { - panic(err) - } - return AccessConfig{Permission: AccessTypeOnlyAddress, Address: addr.String()} - case AccessTypeEverybody: - return AllowEverybody - } - panic("unsupported access type") -} - -func (a AccessType) String() string { - switch a { - case AccessTypeNobody: - return "Nobody" - case AccessTypeOnlyAddress: - return "OnlyAddress" - case AccessTypeEverybody: - return "Everybody" - } - return "Unspecified" -} - -func (a *AccessType) UnmarshalText(text []byte) error { - for _, v := range AllAccessTypes { - if v.String() == string(text) { - *a = v - return nil - } - } - *a = AccessTypeUnspecified - return nil -} -func (a AccessType) MarshalText() ([]byte, error) { - return []byte(a.String()), nil -} - -func (a *AccessType) MarshalJSONPB(_ *jsonpb.Marshaler) ([]byte, error) { - return json.Marshal(a) -} - -func (a *AccessType) UnmarshalJSONPB(_ *jsonpb.Unmarshaler, data []byte) error { - return json.Unmarshal(data, a) -} - -func (a AccessConfig) Equals(o AccessConfig) bool { - return a.Permission == o.Permission && a.Address == o.Address -} - -var ( - DefaultUploadAccess = AllowEverybody - AllowEverybody = AccessConfig{Permission: AccessTypeEverybody} - AllowNobody = AccessConfig{Permission: AccessTypeNobody} -) - -// ParamKeyTable returns the parameter key table. -func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) -} - -// DefaultParams returns default wasm parameters -func DefaultParams() Params { - return Params{ - CodeUploadAccess: AllowEverybody, - InstantiateDefaultPermission: AccessTypeEverybody, - MaxWasmCodeSize: DefaultMaxWasmCodeSize, - } -} - -func (p Params) String() string { - out, err := yaml.Marshal(p) - if err != nil { - panic(err) - } - return string(out) -} - -// ParamSetPairs returns the parameter set pairs. -func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{ - paramtypes.NewParamSetPair(ParamStoreKeyUploadAccess, &p.CodeUploadAccess, validateAccessConfig), - paramtypes.NewParamSetPair(ParamStoreKeyInstantiateAccess, &p.InstantiateDefaultPermission, validateAccessType), - paramtypes.NewParamSetPair(ParamStoreKeyMaxWasmCodeSize, &p.MaxWasmCodeSize, validateMaxWasmCodeSize), - } -} - -// ValidateBasic performs basic validation on wasm parameters -func (p Params) ValidateBasic() error { - if err := validateAccessType(p.InstantiateDefaultPermission); err != nil { - return errors.Wrap(err, "instantiate default permission") - } - if err := validateAccessConfig(p.CodeUploadAccess); err != nil { - return errors.Wrap(err, "upload access") - } - if err := validateMaxWasmCodeSize(p.MaxWasmCodeSize); err != nil { - return errors.Wrap(err, "max wasm code size") - } - return nil -} - -func validateAccessConfig(i interface{}) error { - v, ok := i.(AccessConfig) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - return v.ValidateBasic() -} - -func validateAccessType(i interface{}) error { - a, ok := i.(AccessType) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - if a == AccessTypeUnspecified { - return sdkerrors.Wrap(ErrEmpty, "type") - } - for _, v := range AllAccessTypes { - if v == a { - return nil - } - } - return sdkerrors.Wrapf(ErrInvalid, "unknown type: %q", a) -} - -func validateMaxWasmCodeSize(i interface{}) error { - a, ok := i.(uint64) - if !ok { - return sdkerrors.Wrapf(ErrInvalid, "type: %T", i) - } - if a == 0 { - return sdkerrors.Wrap(ErrInvalid, "must be greater 0") - } - return nil -} - -func (a AccessConfig) ValidateBasic() error { - switch a.Permission { - case AccessTypeUnspecified: - return sdkerrors.Wrap(ErrEmpty, "type") - case AccessTypeNobody, AccessTypeEverybody: - if len(a.Address) != 0 { - return sdkerrors.Wrap(ErrInvalid, "address not allowed for this type") - } - return nil - case AccessTypeOnlyAddress: - _, err := sdk.AccAddressFromBech32(a.Address) - return err - } - return sdkerrors.Wrapf(ErrInvalid, "unknown type: %q", a.Permission) -} - -func (a AccessConfig) Allowed(actor sdk.AccAddress) bool { - switch a.Permission { - case AccessTypeNobody: - return false - case AccessTypeEverybody: - return true - case AccessTypeOnlyAddress: - return a.Address == actor.String() - default: - panic("unknown type") - } -} diff --git a/wasm/types/proposal.go b/wasm/types/proposal.go deleted file mode 100644 index c3fc543e..00000000 --- a/wasm/types/proposal.go +++ /dev/null @@ -1,432 +0,0 @@ -package types - -import ( - "encoding/base64" - "fmt" - "strings" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" -) - -type ProposalType string - -const ( - ProposalTypeStoreCode ProposalType = "StoreCode" - ProposalTypeInstantiateContract ProposalType = "InstantiateContract" - ProposalTypeMigrateContract ProposalType = "MigrateContract" - ProposalTypeUpdateAdmin ProposalType = "UpdateAdmin" - ProposalTypeClearAdmin ProposalType = "ClearAdmin" - ProposalTypePinCodes ProposalType = "PinCodes" - ProposalTypeUnpinCodes ProposalType = "UnpinCodes" -) - -// DisableAllProposals contains no wasm gov types. -var DisableAllProposals []ProposalType - -// EnableAllProposals contains all wasm gov types as keys. -var EnableAllProposals = []ProposalType{ - ProposalTypeStoreCode, - ProposalTypeInstantiateContract, - ProposalTypeMigrateContract, - ProposalTypeUpdateAdmin, - ProposalTypeClearAdmin, - ProposalTypePinCodes, - ProposalTypeUnpinCodes, -} - -// ConvertToProposals maps each key to a ProposalType and returns a typed list. -// If any string is not a valid type (in this file), then return an error -func ConvertToProposals(keys []string) ([]ProposalType, error) { - valid := make(map[string]bool, len(EnableAllProposals)) - for _, key := range EnableAllProposals { - valid[string(key)] = true - } - - proposals := make([]ProposalType, len(keys)) - for i, key := range keys { - if _, ok := valid[key]; !ok { - return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "'%s' is not a valid ProposalType", key) - } - proposals[i] = ProposalType(key) - } - return proposals, nil -} - -func init() { // register new content types with the sdk - govtypes.RegisterProposalType(string(ProposalTypeStoreCode)) - govtypes.RegisterProposalType(string(ProposalTypeInstantiateContract)) - govtypes.RegisterProposalType(string(ProposalTypeMigrateContract)) - govtypes.RegisterProposalType(string(ProposalTypeUpdateAdmin)) - govtypes.RegisterProposalType(string(ProposalTypeClearAdmin)) - govtypes.RegisterProposalType(string(ProposalTypePinCodes)) - govtypes.RegisterProposalType(string(ProposalTypeUnpinCodes)) - govtypes.RegisterProposalTypeCodec(&StoreCodeProposal{}, "wasm/StoreCodeProposal") - govtypes.RegisterProposalTypeCodec(&InstantiateContractProposal{}, "wasm/InstantiateContractProposal") - govtypes.RegisterProposalTypeCodec(&MigrateContractProposal{}, "wasm/MigrateContractProposal") - govtypes.RegisterProposalTypeCodec(&UpdateAdminProposal{}, "wasm/UpdateAdminProposal") - govtypes.RegisterProposalTypeCodec(&ClearAdminProposal{}, "wasm/ClearAdminProposal") - govtypes.RegisterProposalTypeCodec(&PinCodesProposal{}, "wasm/PinCodesProposal") - govtypes.RegisterProposalTypeCodec(&UnpinCodesProposal{}, "wasm/UnpinCodesProposal") -} - -// ProposalRoute returns the routing key of a parameter change proposal. -func (p StoreCodeProposal) ProposalRoute() string { return RouterKey } - -// GetTitle returns the title of the proposal -func (p *StoreCodeProposal) GetTitle() string { return p.Title } - -// GetDescription returns the human readable description of the proposal -func (p StoreCodeProposal) GetDescription() string { return p.Description } - -// ProposalType returns the type -func (p StoreCodeProposal) ProposalType() string { return string(ProposalTypeStoreCode) } - -// ValidateBasic validates the proposal -func (p StoreCodeProposal) ValidateBasic() error { - if err := validateProposalCommons(p.Title, p.Description); err != nil { - return err - } - if _, err := sdk.AccAddressFromBech32(p.RunAs); err != nil { - return sdkerrors.Wrap(err, "run as") - } - - if err := validateWasmCode(p.WASMByteCode); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "code bytes %s", err.Error()) - } - - if p.InstantiatePermission != nil { - if err := p.InstantiatePermission.ValidateBasic(); err != nil { - return sdkerrors.Wrap(err, "instantiate permission") - } - } - return nil -} - -// String implements the Stringer interface. -func (p StoreCodeProposal) String() string { - return fmt.Sprintf(`Store Code Proposal: - Title: %s - Description: %s - Run as: %s - WasmCode: %X -`, p.Title, p.Description, p.RunAs, p.WASMByteCode) -} - -// MarshalYAML pretty prints the wasm byte code -func (p StoreCodeProposal) MarshalYAML() (interface{}, error) { - return struct { - Title string `yaml:"title"` - Description string `yaml:"description"` - RunAs string `yaml:"run_as"` - WASMByteCode string `yaml:"wasm_byte_code"` - InstantiatePermission *AccessConfig `yaml:"instantiate_permission"` - }{ - Title: p.Title, - Description: p.Description, - RunAs: p.RunAs, - WASMByteCode: base64.StdEncoding.EncodeToString(p.WASMByteCode), - InstantiatePermission: p.InstantiatePermission, - }, nil -} - -// ProposalRoute returns the routing key of a parameter change proposal. -func (p InstantiateContractProposal) ProposalRoute() string { return RouterKey } - -// GetTitle returns the title of the proposal -func (p *InstantiateContractProposal) GetTitle() string { return p.Title } - -// GetDescription returns the human readable description of the proposal -func (p InstantiateContractProposal) GetDescription() string { return p.Description } - -// ProposalType returns the type -func (p InstantiateContractProposal) ProposalType() string { - return string(ProposalTypeInstantiateContract) -} - -// ValidateBasic validates the proposal -func (p InstantiateContractProposal) ValidateBasic() error { - if err := validateProposalCommons(p.Title, p.Description); err != nil { - return err - } - if _, err := sdk.AccAddressFromBech32(p.RunAs); err != nil { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "run as") - } - - if p.CodeID == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "code id is required") - } - - if err := validateLabel(p.Label); err != nil { - return err - } - - if !p.Funds.IsValid() { - return sdkerrors.ErrInvalidCoins - } - - if len(p.Admin) != 0 { - if _, err := sdk.AccAddressFromBech32(p.Admin); err != nil { - return err - } - } - if err := p.Msg.ValidateBasic(); err != nil { - return sdkerrors.Wrap(err, "payload msg") - } - return nil -} - -// String implements the Stringer interface. -func (p InstantiateContractProposal) String() string { - return fmt.Sprintf(`Instantiate Code Proposal: - Title: %s - Description: %s - Run as: %s - Admin: %s - Code id: %d - Label: %s - Msg: %q - Funds: %s -`, p.Title, p.Description, p.RunAs, p.Admin, p.CodeID, p.Label, p.Msg, p.Funds) -} - -// MarshalYAML pretty prints the init message -func (p InstantiateContractProposal) MarshalYAML() (interface{}, error) { - return struct { - Title string `yaml:"title"` - Description string `yaml:"description"` - RunAs string `yaml:"run_as"` - Admin string `yaml:"admin"` - CodeID uint64 `yaml:"code_id"` - Label string `yaml:"label"` - Msg string `yaml:"msg"` - Funds sdk.Coins `yaml:"funds"` - }{ - Title: p.Title, - Description: p.Description, - RunAs: p.RunAs, - Admin: p.Admin, - CodeID: p.CodeID, - Label: p.Label, - Msg: string(p.Msg), - Funds: p.Funds, - }, nil -} - -// ProposalRoute returns the routing key of a parameter change proposal. -func (p MigrateContractProposal) ProposalRoute() string { return RouterKey } - -// GetTitle returns the title of the proposal -func (p *MigrateContractProposal) GetTitle() string { return p.Title } - -// GetDescription returns the human readable description of the proposal -func (p MigrateContractProposal) GetDescription() string { return p.Description } - -// ProposalType returns the type -func (p MigrateContractProposal) ProposalType() string { return string(ProposalTypeMigrateContract) } - -// ValidateBasic validates the proposal -func (p MigrateContractProposal) ValidateBasic() error { - if err := validateProposalCommons(p.Title, p.Description); err != nil { - return err - } - if p.CodeID == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "code_id is required") - } - if _, err := sdk.AccAddressFromBech32(p.Contract); err != nil { - return sdkerrors.Wrap(err, "contract") - } - if _, err := sdk.AccAddressFromBech32(p.RunAs); err != nil { - return sdkerrors.Wrap(err, "run as") - } - if err := p.Msg.ValidateBasic(); err != nil { - return sdkerrors.Wrap(err, "payload msg") - } - return nil -} - -// String implements the Stringer interface. -func (p MigrateContractProposal) String() string { - return fmt.Sprintf(`Migrate Contract Proposal: - Title: %s - Description: %s - Contract: %s - Code id: %d - Run as: %s - Msg %q -`, p.Title, p.Description, p.Contract, p.CodeID, p.RunAs, p.Msg) -} - -// MarshalYAML pretty prints the migrate message -func (p MigrateContractProposal) MarshalYAML() (interface{}, error) { - return struct { - Title string `yaml:"title"` - Description string `yaml:"description"` - Contract string `yaml:"contract"` - CodeID uint64 `yaml:"code_id"` - Msg string `yaml:"msg"` - RunAs string `yaml:"run_as"` - }{ - Title: p.Title, - Description: p.Description, - Contract: p.Contract, - CodeID: p.CodeID, - Msg: string(p.Msg), - RunAs: p.RunAs, - }, nil -} - -// ProposalRoute returns the routing key of a parameter change proposal. -func (p UpdateAdminProposal) ProposalRoute() string { return RouterKey } - -// GetTitle returns the title of the proposal -func (p *UpdateAdminProposal) GetTitle() string { return p.Title } - -// GetDescription returns the human readable description of the proposal -func (p UpdateAdminProposal) GetDescription() string { return p.Description } - -// ProposalType returns the type -func (p UpdateAdminProposal) ProposalType() string { return string(ProposalTypeUpdateAdmin) } - -// ValidateBasic validates the proposal -func (p UpdateAdminProposal) ValidateBasic() error { - if err := validateProposalCommons(p.Title, p.Description); err != nil { - return err - } - if _, err := sdk.AccAddressFromBech32(p.Contract); err != nil { - return sdkerrors.Wrap(err, "contract") - } - if _, err := sdk.AccAddressFromBech32(p.NewAdmin); err != nil { - return sdkerrors.Wrap(err, "new admin") - } - return nil -} - -// String implements the Stringer interface. -func (p UpdateAdminProposal) String() string { - return fmt.Sprintf(`Update Contract Admin Proposal: - Title: %s - Description: %s - Contract: %s - New Admin: %s -`, p.Title, p.Description, p.Contract, p.NewAdmin) -} - -// ProposalRoute returns the routing key of a parameter change proposal. -func (p ClearAdminProposal) ProposalRoute() string { return RouterKey } - -// GetTitle returns the title of the proposal -func (p *ClearAdminProposal) GetTitle() string { return p.Title } - -// GetDescription returns the human readable description of the proposal -func (p ClearAdminProposal) GetDescription() string { return p.Description } - -// ProposalType returns the type -func (p ClearAdminProposal) ProposalType() string { return string(ProposalTypeClearAdmin) } - -// ValidateBasic validates the proposal -func (p ClearAdminProposal) ValidateBasic() error { - if err := validateProposalCommons(p.Title, p.Description); err != nil { - return err - } - if _, err := sdk.AccAddressFromBech32(p.Contract); err != nil { - return sdkerrors.Wrap(err, "contract") - } - return nil -} - -// String implements the Stringer interface. -func (p ClearAdminProposal) String() string { - return fmt.Sprintf(`Clear Contract Admin Proposal: - Title: %s - Description: %s - Contract: %s -`, p.Title, p.Description, p.Contract) -} - -// ProposalRoute returns the routing key of a parameter change proposal. -func (p PinCodesProposal) ProposalRoute() string { return RouterKey } - -// GetTitle returns the title of the proposal -func (p *PinCodesProposal) GetTitle() string { return p.Title } - -// GetDescription returns the human readable description of the proposal -func (p PinCodesProposal) GetDescription() string { return p.Description } - -// ProposalType returns the type -func (p PinCodesProposal) ProposalType() string { return string(ProposalTypePinCodes) } - -// ValidateBasic validates the proposal -func (p PinCodesProposal) ValidateBasic() error { - if err := validateProposalCommons(p.Title, p.Description); err != nil { - return err - } - if len(p.CodeIDs) == 0 { - return sdkerrors.Wrap(ErrEmpty, "code ids") - } - return nil -} - -// String implements the Stringer interface. -func (p PinCodesProposal) String() string { - return fmt.Sprintf(`Pin Wasm Codes Proposal: - Title: %s - Description: %s - Codes: %v -`, p.Title, p.Description, p.CodeIDs) -} - -// ProposalRoute returns the routing key of a parameter change proposal. -func (p UnpinCodesProposal) ProposalRoute() string { return RouterKey } - -// GetTitle returns the title of the proposal -func (p *UnpinCodesProposal) GetTitle() string { return p.Title } - -// GetDescription returns the human readable description of the proposal -func (p UnpinCodesProposal) GetDescription() string { return p.Description } - -// ProposalType returns the type -func (p UnpinCodesProposal) ProposalType() string { return string(ProposalTypeUnpinCodes) } - -// ValidateBasic validates the proposal -func (p UnpinCodesProposal) ValidateBasic() error { - if err := validateProposalCommons(p.Title, p.Description); err != nil { - return err - } - if len(p.CodeIDs) == 0 { - return sdkerrors.Wrap(ErrEmpty, "code ids") - } - return nil -} - -// String implements the Stringer interface. -func (p UnpinCodesProposal) String() string { - return fmt.Sprintf(`Unpin Wasm Codes Proposal: - Title: %s - Description: %s - Codes: %v -`, p.Title, p.Description, p.CodeIDs) -} - -func validateProposalCommons(title, description string) error { - if strings.TrimSpace(title) != title { - return sdkerrors.Wrap(govtypes.ErrInvalidProposalContent, "proposal title must not start/end with white spaces") - } - if len(title) == 0 { - return sdkerrors.Wrap(govtypes.ErrInvalidProposalContent, "proposal title cannot be blank") - } - if len(title) > govtypes.MaxTitleLength { - return sdkerrors.Wrapf(govtypes.ErrInvalidProposalContent, "proposal title is longer than max length of %d", govtypes.MaxTitleLength) - } - if strings.TrimSpace(description) != description { - return sdkerrors.Wrap(govtypes.ErrInvalidProposalContent, "proposal description must not start/end with white spaces") - } - if len(description) == 0 { - return sdkerrors.Wrap(govtypes.ErrInvalidProposalContent, "proposal description cannot be blank") - } - if len(description) > govtypes.MaxDescriptionLength { - return sdkerrors.Wrapf(govtypes.ErrInvalidProposalContent, "proposal description is longer than max length of %d", govtypes.MaxDescriptionLength) - } - return nil -} diff --git a/wasm/types/proposal.pb.go b/wasm/types/proposal.pb.go deleted file mode 100644 index bd7525c3..00000000 --- a/wasm/types/proposal.pb.go +++ /dev/null @@ -1,2827 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmwasm/wasm/v1/proposal.proto - -package types - -import ( - bytes "bytes" - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// StoreCodeProposal gov proposal content type to submit WASM code to the system -type StoreCodeProposal struct { - // Title is a short summary - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - // Description is a human readable text - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // RunAs is the address that is passed to the contract's environment as sender - RunAs string `protobuf:"bytes,3,opt,name=run_as,json=runAs,proto3" json:"run_as,omitempty"` - // WASMByteCode can be raw or gzip compressed - WASMByteCode []byte `protobuf:"bytes,4,opt,name=wasm_byte_code,json=wasmByteCode,proto3" json:"wasm_byte_code,omitempty"` - // InstantiatePermission to apply on contract creation, optional - InstantiatePermission *AccessConfig `protobuf:"bytes,7,opt,name=instantiate_permission,json=instantiatePermission,proto3" json:"instantiate_permission,omitempty"` -} - -func (m *StoreCodeProposal) Reset() { *m = StoreCodeProposal{} } -func (*StoreCodeProposal) ProtoMessage() {} -func (*StoreCodeProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_be6422d717c730cb, []int{0} -} -func (m *StoreCodeProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StoreCodeProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StoreCodeProposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *StoreCodeProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_StoreCodeProposal.Merge(m, src) -} -func (m *StoreCodeProposal) XXX_Size() int { - return m.Size() -} -func (m *StoreCodeProposal) XXX_DiscardUnknown() { - xxx_messageInfo_StoreCodeProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_StoreCodeProposal proto.InternalMessageInfo - -// InstantiateContractProposal gov proposal content type to instantiate a -// contract. -type InstantiateContractProposal struct { - // Title is a short summary - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - // Description is a human readable text - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // RunAs is the address that is passed to the contract's environment as sender - RunAs string `protobuf:"bytes,3,opt,name=run_as,json=runAs,proto3" json:"run_as,omitempty"` - // Admin is an optional address that can execute migrations - Admin string `protobuf:"bytes,4,opt,name=admin,proto3" json:"admin,omitempty"` - // CodeID is the reference to the stored WASM code - CodeID uint64 `protobuf:"varint,5,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` - // Label is optional metadata to be stored with a constract instance. - Label string `protobuf:"bytes,6,opt,name=label,proto3" json:"label,omitempty"` - // Msg json encoded message to be passed to the contract on instantiation - Msg RawContractMessage `protobuf:"bytes,7,opt,name=msg,proto3,casttype=RawContractMessage" json:"msg,omitempty"` - // Funds coins that are transferred to the contract on instantiation - Funds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,8,rep,name=funds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"funds"` -} - -func (m *InstantiateContractProposal) Reset() { *m = InstantiateContractProposal{} } -func (*InstantiateContractProposal) ProtoMessage() {} -func (*InstantiateContractProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_be6422d717c730cb, []int{1} -} -func (m *InstantiateContractProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *InstantiateContractProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_InstantiateContractProposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *InstantiateContractProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_InstantiateContractProposal.Merge(m, src) -} -func (m *InstantiateContractProposal) XXX_Size() int { - return m.Size() -} -func (m *InstantiateContractProposal) XXX_DiscardUnknown() { - xxx_messageInfo_InstantiateContractProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_InstantiateContractProposal proto.InternalMessageInfo - -// MigrateContractProposal gov proposal content type to migrate a contract. -type MigrateContractProposal struct { - // Title is a short summary - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - // Description is a human readable text - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // RunAs is the address that is passed to the contract's environment as sender - RunAs string `protobuf:"bytes,3,opt,name=run_as,json=runAs,proto3" json:"run_as,omitempty"` - // Contract is the address of the smart contract - Contract string `protobuf:"bytes,4,opt,name=contract,proto3" json:"contract,omitempty"` - // CodeID references the new WASM code - CodeID uint64 `protobuf:"varint,5,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` - // Msg json encoded message to be passed to the contract on migration - Msg RawContractMessage `protobuf:"bytes,6,opt,name=msg,proto3,casttype=RawContractMessage" json:"msg,omitempty"` -} - -func (m *MigrateContractProposal) Reset() { *m = MigrateContractProposal{} } -func (*MigrateContractProposal) ProtoMessage() {} -func (*MigrateContractProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_be6422d717c730cb, []int{2} -} -func (m *MigrateContractProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MigrateContractProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MigrateContractProposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MigrateContractProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_MigrateContractProposal.Merge(m, src) -} -func (m *MigrateContractProposal) XXX_Size() int { - return m.Size() -} -func (m *MigrateContractProposal) XXX_DiscardUnknown() { - xxx_messageInfo_MigrateContractProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_MigrateContractProposal proto.InternalMessageInfo - -// UpdateAdminProposal gov proposal content type to set an admin for a contract. -type UpdateAdminProposal struct { - // Title is a short summary - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - // Description is a human readable text - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // NewAdmin address to be set - NewAdmin string `protobuf:"bytes,3,opt,name=new_admin,json=newAdmin,proto3" json:"new_admin,omitempty" yaml:"new_admin"` - // Contract is the address of the smart contract - Contract string `protobuf:"bytes,4,opt,name=contract,proto3" json:"contract,omitempty"` -} - -func (m *UpdateAdminProposal) Reset() { *m = UpdateAdminProposal{} } -func (*UpdateAdminProposal) ProtoMessage() {} -func (*UpdateAdminProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_be6422d717c730cb, []int{3} -} -func (m *UpdateAdminProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateAdminProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateAdminProposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateAdminProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateAdminProposal.Merge(m, src) -} -func (m *UpdateAdminProposal) XXX_Size() int { - return m.Size() -} -func (m *UpdateAdminProposal) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateAdminProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateAdminProposal proto.InternalMessageInfo - -// ClearAdminProposal gov proposal content type to clear the admin of a -// contract. -type ClearAdminProposal struct { - // Title is a short summary - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - // Description is a human readable text - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // Contract is the address of the smart contract - Contract string `protobuf:"bytes,3,opt,name=contract,proto3" json:"contract,omitempty"` -} - -func (m *ClearAdminProposal) Reset() { *m = ClearAdminProposal{} } -func (*ClearAdminProposal) ProtoMessage() {} -func (*ClearAdminProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_be6422d717c730cb, []int{4} -} -func (m *ClearAdminProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ClearAdminProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ClearAdminProposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ClearAdminProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_ClearAdminProposal.Merge(m, src) -} -func (m *ClearAdminProposal) XXX_Size() int { - return m.Size() -} -func (m *ClearAdminProposal) XXX_DiscardUnknown() { - xxx_messageInfo_ClearAdminProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_ClearAdminProposal proto.InternalMessageInfo - -// PinCodesProposal gov proposal content type to pin a set of code ids in the -// wasmvm cache. -type PinCodesProposal struct { - // Title is a short summary - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` - // Description is a human readable text - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` - // CodeIDs references the new WASM codes - CodeIDs []uint64 `protobuf:"varint,3,rep,packed,name=code_ids,json=codeIds,proto3" json:"code_ids,omitempty" yaml:"code_ids"` -} - -func (m *PinCodesProposal) Reset() { *m = PinCodesProposal{} } -func (*PinCodesProposal) ProtoMessage() {} -func (*PinCodesProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_be6422d717c730cb, []int{5} -} -func (m *PinCodesProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PinCodesProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PinCodesProposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PinCodesProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_PinCodesProposal.Merge(m, src) -} -func (m *PinCodesProposal) XXX_Size() int { - return m.Size() -} -func (m *PinCodesProposal) XXX_DiscardUnknown() { - xxx_messageInfo_PinCodesProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_PinCodesProposal proto.InternalMessageInfo - -// UnpinCodesProposal gov proposal content type to unpin a set of code ids in -// the wasmvm cache. -type UnpinCodesProposal struct { - // Title is a short summary - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` - // Description is a human readable text - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` - // CodeIDs references the WASM codes - CodeIDs []uint64 `protobuf:"varint,3,rep,packed,name=code_ids,json=codeIds,proto3" json:"code_ids,omitempty" yaml:"code_ids"` -} - -func (m *UnpinCodesProposal) Reset() { *m = UnpinCodesProposal{} } -func (*UnpinCodesProposal) ProtoMessage() {} -func (*UnpinCodesProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_be6422d717c730cb, []int{6} -} -func (m *UnpinCodesProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UnpinCodesProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UnpinCodesProposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UnpinCodesProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_UnpinCodesProposal.Merge(m, src) -} -func (m *UnpinCodesProposal) XXX_Size() int { - return m.Size() -} -func (m *UnpinCodesProposal) XXX_DiscardUnknown() { - xxx_messageInfo_UnpinCodesProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_UnpinCodesProposal proto.InternalMessageInfo - -func init() { - proto.RegisterType((*StoreCodeProposal)(nil), "cosmwasm.wasm.v1.StoreCodeProposal") - proto.RegisterType((*InstantiateContractProposal)(nil), "cosmwasm.wasm.v1.InstantiateContractProposal") - proto.RegisterType((*MigrateContractProposal)(nil), "cosmwasm.wasm.v1.MigrateContractProposal") - proto.RegisterType((*UpdateAdminProposal)(nil), "cosmwasm.wasm.v1.UpdateAdminProposal") - proto.RegisterType((*ClearAdminProposal)(nil), "cosmwasm.wasm.v1.ClearAdminProposal") - proto.RegisterType((*PinCodesProposal)(nil), "cosmwasm.wasm.v1.PinCodesProposal") - proto.RegisterType((*UnpinCodesProposal)(nil), "cosmwasm.wasm.v1.UnpinCodesProposal") -} - -func init() { proto.RegisterFile("cosmwasm/wasm/v1/proposal.proto", fileDescriptor_be6422d717c730cb) } - -var fileDescriptor_be6422d717c730cb = []byte{ - // 698 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x54, 0xcd, 0x6e, 0xd3, 0x4a, - 0x14, 0x8e, 0x9b, 0xc4, 0x49, 0xa7, 0xd1, 0xbd, 0xb9, 0xbe, 0x69, 0x6f, 0x6e, 0x41, 0x76, 0x64, - 0xa4, 0xca, 0x1b, 0x6c, 0x52, 0x24, 0x04, 0xec, 0xe2, 0xb0, 0x69, 0x45, 0xa5, 0xca, 0x55, 0x55, - 0x89, 0x4d, 0x34, 0xb1, 0xa7, 0xa9, 0x45, 0x3c, 0x63, 0x79, 0x26, 0x0d, 0x79, 0x0b, 0x1e, 0x80, - 0x07, 0x40, 0x6c, 0x10, 0x6f, 0x51, 0xb1, 0xaa, 0xc4, 0xa6, 0x2b, 0x43, 0xdd, 0x37, 0xc8, 0x12, - 0x09, 0x09, 0xcd, 0x8c, 0x13, 0xd2, 0x82, 0x00, 0x89, 0x1f, 0x89, 0xcd, 0xd8, 0x67, 0xce, 0x77, - 0xe6, 0x3b, 0xe7, 0x3b, 0x67, 0x06, 0x18, 0x3e, 0xa1, 0xd1, 0x18, 0xd2, 0xc8, 0x11, 0xcb, 0x71, - 0xdb, 0x89, 0x13, 0x12, 0x13, 0x0a, 0x87, 0x76, 0x9c, 0x10, 0x46, 0xb4, 0xfa, 0x0c, 0x60, 0x8b, - 0xe5, 0xb8, 0xbd, 0xde, 0x18, 0x90, 0x01, 0x11, 0x4e, 0x87, 0xff, 0x49, 0xdc, 0xba, 0xce, 0x71, - 0x84, 0x3a, 0x7d, 0x48, 0x91, 0x73, 0xdc, 0xee, 0x23, 0x06, 0xdb, 0x8e, 0x4f, 0x42, 0x9c, 0xfb, - 0xaf, 0x7f, 0x46, 0xc4, 0x26, 0x31, 0xa2, 0xd2, 0x6b, 0x7e, 0x50, 0xc0, 0x3f, 0x7b, 0x8c, 0x24, - 0xa8, 0x4b, 0x02, 0xb4, 0x9b, 0x67, 0xa0, 0x35, 0x40, 0x99, 0x85, 0x6c, 0x88, 0x9a, 0x4a, 0x4b, - 0xb1, 0x96, 0x3d, 0x69, 0x68, 0x2d, 0xb0, 0x12, 0x20, 0xea, 0x27, 0x61, 0xcc, 0x42, 0x82, 0x9b, - 0x4b, 0xc2, 0xb7, 0xb8, 0xa5, 0xad, 0x02, 0x35, 0x19, 0xe1, 0x1e, 0xa4, 0xcd, 0xa2, 0x0c, 0x4c, - 0x46, 0xb8, 0x43, 0xb5, 0x3b, 0xe0, 0x2f, 0xce, 0xdd, 0xeb, 0x4f, 0x18, 0xea, 0xf9, 0x24, 0x40, - 0xcd, 0x52, 0x4b, 0xb1, 0x6a, 0x6e, 0x3d, 0x4b, 0x8d, 0xda, 0x41, 0x67, 0x6f, 0xc7, 0x9d, 0x30, - 0x91, 0x80, 0x57, 0xe3, 0xb8, 0x99, 0xa5, 0xed, 0x83, 0xb5, 0x10, 0x53, 0x06, 0x31, 0x0b, 0x21, - 0x43, 0xbd, 0x18, 0x25, 0x51, 0x48, 0x29, 0xe7, 0xae, 0xb4, 0x14, 0x6b, 0x65, 0x53, 0xb7, 0xaf, - 0x6a, 0x64, 0x77, 0x7c, 0x1f, 0x51, 0xda, 0x25, 0xf8, 0x30, 0x1c, 0x78, 0xab, 0x0b, 0xd1, 0xbb, - 0xf3, 0xe0, 0xed, 0x52, 0xb5, 0x5c, 0x57, 0xb7, 0x4b, 0x55, 0xb5, 0x5e, 0x31, 0x5f, 0x2f, 0x81, - 0x6b, 0x5b, 0x9f, 0x50, 0x5d, 0x82, 0x59, 0x02, 0x7d, 0xf6, 0xab, 0x94, 0x68, 0x80, 0x32, 0x0c, - 0xa2, 0x10, 0x0b, 0x01, 0x96, 0x3d, 0x69, 0x68, 0x37, 0x40, 0x85, 0xab, 0xd2, 0x0b, 0x83, 0x66, - 0xb9, 0xa5, 0x58, 0x25, 0x17, 0x64, 0xa9, 0xa1, 0x72, 0x09, 0xb6, 0x1e, 0x78, 0x2a, 0x77, 0x6d, - 0x05, 0x3c, 0x74, 0x08, 0xfb, 0x68, 0xd8, 0x54, 0x65, 0xa8, 0x30, 0x34, 0x0b, 0x14, 0x23, 0x3a, - 0x10, 0x7a, 0xd4, 0xdc, 0xb5, 0xf7, 0xa9, 0xa1, 0x79, 0x70, 0x3c, 0xab, 0x62, 0x07, 0x51, 0x0a, - 0x07, 0xc8, 0xe3, 0x10, 0x0d, 0x82, 0xf2, 0xe1, 0x08, 0x07, 0xb4, 0x59, 0x6d, 0x15, 0xad, 0x95, - 0xcd, 0xff, 0x6d, 0x39, 0x37, 0x36, 0x9f, 0x1b, 0x3b, 0x9f, 0x1b, 0xbb, 0x4b, 0x42, 0xec, 0xde, - 0x3a, 0x49, 0x8d, 0xc2, 0x8b, 0xb7, 0x86, 0x35, 0x08, 0xd9, 0xd1, 0xa8, 0x6f, 0xfb, 0x24, 0x72, - 0xf2, 0x21, 0x93, 0x9f, 0x9b, 0x34, 0x78, 0x9c, 0x4f, 0x11, 0x0f, 0xa0, 0x9e, 0x3c, 0xd9, 0x7c, - 0xa3, 0x80, 0xff, 0x76, 0xc2, 0x41, 0xf2, 0x1b, 0x84, 0x5c, 0x07, 0x55, 0x3f, 0xa7, 0xc8, 0xb5, - 0x9c, 0xdb, 0xdf, 0x27, 0x67, 0x2e, 0x9c, 0xfa, 0x4d, 0xe1, 0xcc, 0x67, 0x0a, 0xf8, 0x77, 0x3f, - 0x0e, 0x20, 0x43, 0x1d, 0xde, 0xad, 0x1f, 0xae, 0xa8, 0x0d, 0x96, 0x31, 0x1a, 0xf7, 0xe4, 0x1c, - 0x88, 0xa2, 0xdc, 0xc6, 0x34, 0x35, 0xea, 0x13, 0x18, 0x0d, 0xef, 0x9b, 0x73, 0x97, 0xe9, 0x55, - 0x31, 0x1a, 0x0b, 0xca, 0xaf, 0x55, 0x6b, 0x1e, 0x01, 0xad, 0x3b, 0x44, 0x30, 0xf9, 0x39, 0xc9, - 0x2d, 0x32, 0x15, 0xaf, 0x30, 0xbd, 0x54, 0x40, 0x7d, 0x37, 0xc4, 0x5c, 0x48, 0x3a, 0x27, 0xda, - 0xb8, 0x44, 0xe4, 0xd6, 0xa7, 0xa9, 0x51, 0x93, 0x95, 0x88, 0x6d, 0x73, 0x46, 0x7d, 0xf7, 0x0b, - 0xd4, 0xee, 0xda, 0x34, 0x35, 0x34, 0x89, 0x5e, 0x70, 0x9a, 0x97, 0x53, 0xba, 0xc7, 0x53, 0x12, - 0xed, 0xe4, 0x33, 0x50, 0xb4, 0x4a, 0xae, 0x9e, 0xa5, 0x46, 0x45, 0xf6, 0x93, 0x4e, 0x53, 0xe3, - 0x6f, 0x79, 0xc2, 0x0c, 0x64, 0x7a, 0x15, 0xd9, 0x63, 0x6a, 0xbe, 0x52, 0x80, 0xb6, 0x8f, 0xe3, - 0x3f, 0x29, 0x67, 0xf7, 0xe1, 0xc9, 0xb9, 0x5e, 0x38, 0x3b, 0xd7, 0x0b, 0xcf, 0x33, 0x5d, 0x39, - 0xc9, 0x74, 0xe5, 0x34, 0xd3, 0x95, 0x77, 0x99, 0xae, 0x3c, 0xbd, 0xd0, 0x0b, 0xa7, 0x17, 0x7a, - 0xe1, 0xec, 0x42, 0x2f, 0x3c, 0xda, 0x58, 0xb8, 0x9b, 0x5d, 0x42, 0xa3, 0x83, 0xd9, 0x03, 0x1f, - 0x38, 0x4f, 0xe4, 0x43, 0x2f, 0xee, 0x67, 0x5f, 0x15, 0xcf, 0xfc, 0xed, 0x8f, 0x01, 0x00, 0x00, - 0xff, 0xff, 0x9a, 0x01, 0xce, 0x1b, 0x6f, 0x06, 0x00, 0x00, -} - -func (this *StoreCodeProposal) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*StoreCodeProposal) - if !ok { - that2, ok := that.(StoreCodeProposal) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Title != that1.Title { - return false - } - if this.Description != that1.Description { - return false - } - if this.RunAs != that1.RunAs { - return false - } - if !bytes.Equal(this.WASMByteCode, that1.WASMByteCode) { - return false - } - if !this.InstantiatePermission.Equal(that1.InstantiatePermission) { - return false - } - return true -} -func (this *InstantiateContractProposal) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*InstantiateContractProposal) - if !ok { - that2, ok := that.(InstantiateContractProposal) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Title != that1.Title { - return false - } - if this.Description != that1.Description { - return false - } - if this.RunAs != that1.RunAs { - return false - } - if this.Admin != that1.Admin { - return false - } - if this.CodeID != that1.CodeID { - return false - } - if this.Label != that1.Label { - return false - } - if !bytes.Equal(this.Msg, that1.Msg) { - return false - } - if len(this.Funds) != len(that1.Funds) { - return false - } - for i := range this.Funds { - if !this.Funds[i].Equal(&that1.Funds[i]) { - return false - } - } - return true -} -func (this *MigrateContractProposal) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*MigrateContractProposal) - if !ok { - that2, ok := that.(MigrateContractProposal) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Title != that1.Title { - return false - } - if this.Description != that1.Description { - return false - } - if this.RunAs != that1.RunAs { - return false - } - if this.Contract != that1.Contract { - return false - } - if this.CodeID != that1.CodeID { - return false - } - if !bytes.Equal(this.Msg, that1.Msg) { - return false - } - return true -} -func (this *UpdateAdminProposal) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*UpdateAdminProposal) - if !ok { - that2, ok := that.(UpdateAdminProposal) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Title != that1.Title { - return false - } - if this.Description != that1.Description { - return false - } - if this.NewAdmin != that1.NewAdmin { - return false - } - if this.Contract != that1.Contract { - return false - } - return true -} -func (this *ClearAdminProposal) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ClearAdminProposal) - if !ok { - that2, ok := that.(ClearAdminProposal) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Title != that1.Title { - return false - } - if this.Description != that1.Description { - return false - } - if this.Contract != that1.Contract { - return false - } - return true -} -func (this *PinCodesProposal) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*PinCodesProposal) - if !ok { - that2, ok := that.(PinCodesProposal) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Title != that1.Title { - return false - } - if this.Description != that1.Description { - return false - } - if len(this.CodeIDs) != len(that1.CodeIDs) { - return false - } - for i := range this.CodeIDs { - if this.CodeIDs[i] != that1.CodeIDs[i] { - return false - } - } - return true -} -func (this *UnpinCodesProposal) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*UnpinCodesProposal) - if !ok { - that2, ok := that.(UnpinCodesProposal) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Title != that1.Title { - return false - } - if this.Description != that1.Description { - return false - } - if len(this.CodeIDs) != len(that1.CodeIDs) { - return false - } - for i := range this.CodeIDs { - if this.CodeIDs[i] != that1.CodeIDs[i] { - return false - } - } - return true -} -func (m *StoreCodeProposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *StoreCodeProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StoreCodeProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.InstantiatePermission != nil { - { - size, err := m.InstantiatePermission.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProposal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - if len(m.WASMByteCode) > 0 { - i -= len(m.WASMByteCode) - copy(dAtA[i:], m.WASMByteCode) - i = encodeVarintProposal(dAtA, i, uint64(len(m.WASMByteCode))) - i-- - dAtA[i] = 0x22 - } - if len(m.RunAs) > 0 { - i -= len(m.RunAs) - copy(dAtA[i:], m.RunAs) - i = encodeVarintProposal(dAtA, i, uint64(len(m.RunAs))) - i-- - dAtA[i] = 0x1a - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *InstantiateContractProposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *InstantiateContractProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *InstantiateContractProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Funds) > 0 { - for iNdEx := len(m.Funds) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Funds[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProposal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - } - if len(m.Msg) > 0 { - i -= len(m.Msg) - copy(dAtA[i:], m.Msg) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Msg))) - i-- - dAtA[i] = 0x3a - } - if len(m.Label) > 0 { - i -= len(m.Label) - copy(dAtA[i:], m.Label) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Label))) - i-- - dAtA[i] = 0x32 - } - if m.CodeID != 0 { - i = encodeVarintProposal(dAtA, i, uint64(m.CodeID)) - i-- - dAtA[i] = 0x28 - } - if len(m.Admin) > 0 { - i -= len(m.Admin) - copy(dAtA[i:], m.Admin) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Admin))) - i-- - dAtA[i] = 0x22 - } - if len(m.RunAs) > 0 { - i -= len(m.RunAs) - copy(dAtA[i:], m.RunAs) - i = encodeVarintProposal(dAtA, i, uint64(len(m.RunAs))) - i-- - dAtA[i] = 0x1a - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MigrateContractProposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MigrateContractProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MigrateContractProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Msg) > 0 { - i -= len(m.Msg) - copy(dAtA[i:], m.Msg) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Msg))) - i-- - dAtA[i] = 0x32 - } - if m.CodeID != 0 { - i = encodeVarintProposal(dAtA, i, uint64(m.CodeID)) - i-- - dAtA[i] = 0x28 - } - if len(m.Contract) > 0 { - i -= len(m.Contract) - copy(dAtA[i:], m.Contract) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Contract))) - i-- - dAtA[i] = 0x22 - } - if len(m.RunAs) > 0 { - i -= len(m.RunAs) - copy(dAtA[i:], m.RunAs) - i = encodeVarintProposal(dAtA, i, uint64(len(m.RunAs))) - i-- - dAtA[i] = 0x1a - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UpdateAdminProposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateAdminProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateAdminProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Contract) > 0 { - i -= len(m.Contract) - copy(dAtA[i:], m.Contract) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Contract))) - i-- - dAtA[i] = 0x22 - } - if len(m.NewAdmin) > 0 { - i -= len(m.NewAdmin) - copy(dAtA[i:], m.NewAdmin) - i = encodeVarintProposal(dAtA, i, uint64(len(m.NewAdmin))) - i-- - dAtA[i] = 0x1a - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ClearAdminProposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ClearAdminProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ClearAdminProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Contract) > 0 { - i -= len(m.Contract) - copy(dAtA[i:], m.Contract) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Contract))) - i-- - dAtA[i] = 0x1a - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *PinCodesProposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PinCodesProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PinCodesProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.CodeIDs) > 0 { - dAtA3 := make([]byte, len(m.CodeIDs)*10) - var j2 int - for _, num := range m.CodeIDs { - for num >= 1<<7 { - dAtA3[j2] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j2++ - } - dAtA3[j2] = uint8(num) - j2++ - } - i -= j2 - copy(dAtA[i:], dAtA3[:j2]) - i = encodeVarintProposal(dAtA, i, uint64(j2)) - i-- - dAtA[i] = 0x1a - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UnpinCodesProposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UnpinCodesProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UnpinCodesProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.CodeIDs) > 0 { - dAtA5 := make([]byte, len(m.CodeIDs)*10) - var j4 int - for _, num := range m.CodeIDs { - for num >= 1<<7 { - dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j4++ - } - dAtA5[j4] = uint8(num) - j4++ - } - i -= j4 - copy(dAtA[i:], dAtA5[:j4]) - i = encodeVarintProposal(dAtA, i, uint64(j4)) - i-- - dAtA[i] = 0x1a - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintProposal(dAtA []byte, offset int, v uint64) int { - offset -= sovProposal(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *StoreCodeProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.RunAs) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.WASMByteCode) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - if m.InstantiatePermission != nil { - l = m.InstantiatePermission.Size() - n += 1 + l + sovProposal(uint64(l)) - } - return n -} - -func (m *InstantiateContractProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.RunAs) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Admin) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - if m.CodeID != 0 { - n += 1 + sovProposal(uint64(m.CodeID)) - } - l = len(m.Label) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Msg) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - if len(m.Funds) > 0 { - for _, e := range m.Funds { - l = e.Size() - n += 1 + l + sovProposal(uint64(l)) - } - } - return n -} - -func (m *MigrateContractProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.RunAs) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Contract) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - if m.CodeID != 0 { - n += 1 + sovProposal(uint64(m.CodeID)) - } - l = len(m.Msg) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - return n -} - -func (m *UpdateAdminProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.NewAdmin) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Contract) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - return n -} - -func (m *ClearAdminProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Contract) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - return n -} - -func (m *PinCodesProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - if len(m.CodeIDs) > 0 { - l = 0 - for _, e := range m.CodeIDs { - l += sovProposal(uint64(e)) - } - n += 1 + sovProposal(uint64(l)) + l - } - return n -} - -func (m *UnpinCodesProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - if len(m.CodeIDs) > 0 { - l = 0 - for _, e := range m.CodeIDs { - l += sovProposal(uint64(e)) - } - n += 1 + sovProposal(uint64(l)) + l - } - return n -} - -func sovProposal(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozProposal(x uint64) (n int) { - return sovProposal(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *StoreCodeProposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StoreCodeProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StoreCodeProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RunAs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RunAs = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WASMByteCode", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.WASMByteCode = append(m.WASMByteCode[:0], dAtA[iNdEx:postIndex]...) - if m.WASMByteCode == nil { - m.WASMByteCode = []byte{} - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InstantiatePermission", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.InstantiatePermission == nil { - m.InstantiatePermission = &AccessConfig{} - } - if err := m.InstantiatePermission.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProposal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProposal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *InstantiateContractProposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: InstantiateContractProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: InstantiateContractProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RunAs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RunAs = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Admin = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CodeID", wireType) - } - m.CodeID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CodeID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Label = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Msg = append(m.Msg[:0], dAtA[iNdEx:postIndex]...) - if m.Msg == nil { - m.Msg = []byte{} - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Funds", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Funds = append(m.Funds, types.Coin{}) - if err := m.Funds[len(m.Funds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProposal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProposal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MigrateContractProposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MigrateContractProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MigrateContractProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RunAs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RunAs = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Contract", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Contract = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CodeID", wireType) - } - m.CodeID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CodeID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Msg = append(m.Msg[:0], dAtA[iNdEx:postIndex]...) - if m.Msg == nil { - m.Msg = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProposal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProposal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateAdminProposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: UpdateAdminProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateAdminProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NewAdmin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NewAdmin = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Contract", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Contract = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProposal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProposal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ClearAdminProposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ClearAdminProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ClearAdminProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Contract", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Contract = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProposal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProposal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PinCodesProposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PinCodesProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PinCodesProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.CodeIDs = append(m.CodeIDs, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.CodeIDs) == 0 { - m.CodeIDs = make([]uint64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.CodeIDs = append(m.CodeIDs, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field CodeIDs", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipProposal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProposal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UnpinCodesProposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: UnpinCodesProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UnpinCodesProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.CodeIDs = append(m.CodeIDs, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.CodeIDs) == 0 { - m.CodeIDs = make([]uint64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.CodeIDs = append(m.CodeIDs, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field CodeIDs", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipProposal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProposal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipProposal(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProposal - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProposal - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProposal - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthProposal - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupProposal - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthProposal - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthProposal = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowProposal = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupProposal = fmt.Errorf("proto: unexpected end of group") -) diff --git a/wasm/types/query.pb.go b/wasm/types/query.pb.go deleted file mode 100644 index a6f0f8e7..00000000 --- a/wasm/types/query.pb.go +++ /dev/null @@ -1,4613 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmwasm/wasm/v1/query.proto - -package types - -import ( - bytes "bytes" - context "context" - fmt "fmt" - query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" - github_com_tendermint_tendermint_libs_bytes "github.com/tendermint/tendermint/libs/bytes" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// QueryContractInfoRequest is the request type for the Query/ContractInfo RPC -// method -type QueryContractInfoRequest struct { - // address is the address of the contract to query - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` -} - -func (m *QueryContractInfoRequest) Reset() { *m = QueryContractInfoRequest{} } -func (m *QueryContractInfoRequest) String() string { return proto.CompactTextString(m) } -func (*QueryContractInfoRequest) ProtoMessage() {} -func (*QueryContractInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9677c207036b9f2b, []int{0} -} -func (m *QueryContractInfoRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryContractInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryContractInfoRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryContractInfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryContractInfoRequest.Merge(m, src) -} -func (m *QueryContractInfoRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryContractInfoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryContractInfoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryContractInfoRequest proto.InternalMessageInfo - -// QueryContractInfoResponse is the response type for the Query/ContractInfo RPC -// method -type QueryContractInfoResponse struct { - // address is the address of the contract - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - ContractInfo `protobuf:"bytes,2,opt,name=contract_info,json=contractInfo,proto3,embedded=contract_info" json:""` -} - -func (m *QueryContractInfoResponse) Reset() { *m = QueryContractInfoResponse{} } -func (m *QueryContractInfoResponse) String() string { return proto.CompactTextString(m) } -func (*QueryContractInfoResponse) ProtoMessage() {} -func (*QueryContractInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9677c207036b9f2b, []int{1} -} -func (m *QueryContractInfoResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryContractInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryContractInfoResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryContractInfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryContractInfoResponse.Merge(m, src) -} -func (m *QueryContractInfoResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryContractInfoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryContractInfoResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryContractInfoResponse proto.InternalMessageInfo - -// QueryContractHistoryRequest is the request type for the Query/ContractHistory -// RPC method -type QueryContractHistoryRequest struct { - // address is the address of the contract to query - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryContractHistoryRequest) Reset() { *m = QueryContractHistoryRequest{} } -func (m *QueryContractHistoryRequest) String() string { return proto.CompactTextString(m) } -func (*QueryContractHistoryRequest) ProtoMessage() {} -func (*QueryContractHistoryRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9677c207036b9f2b, []int{2} -} -func (m *QueryContractHistoryRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryContractHistoryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryContractHistoryRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryContractHistoryRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryContractHistoryRequest.Merge(m, src) -} -func (m *QueryContractHistoryRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryContractHistoryRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryContractHistoryRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryContractHistoryRequest proto.InternalMessageInfo - -// QueryContractHistoryResponse is the response type for the -// Query/ContractHistory RPC method -type QueryContractHistoryResponse struct { - Entries []ContractCodeHistoryEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries"` - // pagination defines the pagination in the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryContractHistoryResponse) Reset() { *m = QueryContractHistoryResponse{} } -func (m *QueryContractHistoryResponse) String() string { return proto.CompactTextString(m) } -func (*QueryContractHistoryResponse) ProtoMessage() {} -func (*QueryContractHistoryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9677c207036b9f2b, []int{3} -} -func (m *QueryContractHistoryResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryContractHistoryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryContractHistoryResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryContractHistoryResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryContractHistoryResponse.Merge(m, src) -} -func (m *QueryContractHistoryResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryContractHistoryResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryContractHistoryResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryContractHistoryResponse proto.InternalMessageInfo - -// QueryContractsByCodeRequest is the request type for the Query/ContractsByCode -// RPC method -type QueryContractsByCodeRequest struct { - CodeId uint64 `protobuf:"varint,1,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryContractsByCodeRequest) Reset() { *m = QueryContractsByCodeRequest{} } -func (m *QueryContractsByCodeRequest) String() string { return proto.CompactTextString(m) } -func (*QueryContractsByCodeRequest) ProtoMessage() {} -func (*QueryContractsByCodeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9677c207036b9f2b, []int{4} -} -func (m *QueryContractsByCodeRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryContractsByCodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryContractsByCodeRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryContractsByCodeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryContractsByCodeRequest.Merge(m, src) -} -func (m *QueryContractsByCodeRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryContractsByCodeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryContractsByCodeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryContractsByCodeRequest proto.InternalMessageInfo - -// QueryContractsByCodeResponse is the response type for the -// Query/ContractsByCode RPC method -type QueryContractsByCodeResponse struct { - // contracts are a set of contract addresses - Contracts []string `protobuf:"bytes,1,rep,name=contracts,proto3" json:"contracts,omitempty"` - // pagination defines the pagination in the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryContractsByCodeResponse) Reset() { *m = QueryContractsByCodeResponse{} } -func (m *QueryContractsByCodeResponse) String() string { return proto.CompactTextString(m) } -func (*QueryContractsByCodeResponse) ProtoMessage() {} -func (*QueryContractsByCodeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9677c207036b9f2b, []int{5} -} -func (m *QueryContractsByCodeResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryContractsByCodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryContractsByCodeResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryContractsByCodeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryContractsByCodeResponse.Merge(m, src) -} -func (m *QueryContractsByCodeResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryContractsByCodeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryContractsByCodeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryContractsByCodeResponse proto.InternalMessageInfo - -// QueryAllContractStateRequest is the request type for the -// Query/AllContractState RPC method -type QueryAllContractStateRequest struct { - // address is the address of the contract - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllContractStateRequest) Reset() { *m = QueryAllContractStateRequest{} } -func (m *QueryAllContractStateRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllContractStateRequest) ProtoMessage() {} -func (*QueryAllContractStateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9677c207036b9f2b, []int{6} -} -func (m *QueryAllContractStateRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllContractStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllContractStateRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAllContractStateRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllContractStateRequest.Merge(m, src) -} -func (m *QueryAllContractStateRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllContractStateRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllContractStateRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllContractStateRequest proto.InternalMessageInfo - -// QueryAllContractStateResponse is the response type for the -// Query/AllContractState RPC method -type QueryAllContractStateResponse struct { - Models []Model `protobuf:"bytes,1,rep,name=models,proto3" json:"models"` - // pagination defines the pagination in the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllContractStateResponse) Reset() { *m = QueryAllContractStateResponse{} } -func (m *QueryAllContractStateResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllContractStateResponse) ProtoMessage() {} -func (*QueryAllContractStateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9677c207036b9f2b, []int{7} -} -func (m *QueryAllContractStateResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllContractStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllContractStateResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAllContractStateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllContractStateResponse.Merge(m, src) -} -func (m *QueryAllContractStateResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllContractStateResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllContractStateResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllContractStateResponse proto.InternalMessageInfo - -// QueryRawContractStateRequest is the request type for the -// Query/RawContractState RPC method -type QueryRawContractStateRequest struct { - // address is the address of the contract - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - QueryData []byte `protobuf:"bytes,2,opt,name=query_data,json=queryData,proto3" json:"query_data,omitempty"` -} - -func (m *QueryRawContractStateRequest) Reset() { *m = QueryRawContractStateRequest{} } -func (m *QueryRawContractStateRequest) String() string { return proto.CompactTextString(m) } -func (*QueryRawContractStateRequest) ProtoMessage() {} -func (*QueryRawContractStateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9677c207036b9f2b, []int{8} -} -func (m *QueryRawContractStateRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryRawContractStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryRawContractStateRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryRawContractStateRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryRawContractStateRequest.Merge(m, src) -} -func (m *QueryRawContractStateRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryRawContractStateRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryRawContractStateRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryRawContractStateRequest proto.InternalMessageInfo - -// QueryRawContractStateResponse is the response type for the -// Query/RawContractState RPC method -type QueryRawContractStateResponse struct { - // Data contains the raw store data - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` -} - -func (m *QueryRawContractStateResponse) Reset() { *m = QueryRawContractStateResponse{} } -func (m *QueryRawContractStateResponse) String() string { return proto.CompactTextString(m) } -func (*QueryRawContractStateResponse) ProtoMessage() {} -func (*QueryRawContractStateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9677c207036b9f2b, []int{9} -} -func (m *QueryRawContractStateResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryRawContractStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryRawContractStateResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryRawContractStateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryRawContractStateResponse.Merge(m, src) -} -func (m *QueryRawContractStateResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryRawContractStateResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryRawContractStateResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryRawContractStateResponse proto.InternalMessageInfo - -// QuerySmartContractStateRequest is the request type for the -// Query/SmartContractState RPC method -type QuerySmartContractStateRequest struct { - // address is the address of the contract - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // QueryData contains the query data passed to the contract - QueryData RawContractMessage `protobuf:"bytes,2,opt,name=query_data,json=queryData,proto3,casttype=RawContractMessage" json:"query_data,omitempty"` -} - -func (m *QuerySmartContractStateRequest) Reset() { *m = QuerySmartContractStateRequest{} } -func (m *QuerySmartContractStateRequest) String() string { return proto.CompactTextString(m) } -func (*QuerySmartContractStateRequest) ProtoMessage() {} -func (*QuerySmartContractStateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9677c207036b9f2b, []int{10} -} -func (m *QuerySmartContractStateRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySmartContractStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySmartContractStateRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QuerySmartContractStateRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySmartContractStateRequest.Merge(m, src) -} -func (m *QuerySmartContractStateRequest) XXX_Size() int { - return m.Size() -} -func (m *QuerySmartContractStateRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySmartContractStateRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySmartContractStateRequest proto.InternalMessageInfo - -// QuerySmartContractStateResponse is the response type for the -// Query/SmartContractState RPC method -type QuerySmartContractStateResponse struct { - // Data contains the json data returned from the smart contract - Data RawContractMessage `protobuf:"bytes,1,opt,name=data,proto3,casttype=RawContractMessage" json:"data,omitempty"` -} - -func (m *QuerySmartContractStateResponse) Reset() { *m = QuerySmartContractStateResponse{} } -func (m *QuerySmartContractStateResponse) String() string { return proto.CompactTextString(m) } -func (*QuerySmartContractStateResponse) ProtoMessage() {} -func (*QuerySmartContractStateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9677c207036b9f2b, []int{11} -} -func (m *QuerySmartContractStateResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySmartContractStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySmartContractStateResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QuerySmartContractStateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySmartContractStateResponse.Merge(m, src) -} -func (m *QuerySmartContractStateResponse) XXX_Size() int { - return m.Size() -} -func (m *QuerySmartContractStateResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySmartContractStateResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySmartContractStateResponse proto.InternalMessageInfo - -// QueryCodeRequest is the request type for the Query/Code RPC method -type QueryCodeRequest struct { - CodeId uint64 `protobuf:"varint,1,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` -} - -func (m *QueryCodeRequest) Reset() { *m = QueryCodeRequest{} } -func (m *QueryCodeRequest) String() string { return proto.CompactTextString(m) } -func (*QueryCodeRequest) ProtoMessage() {} -func (*QueryCodeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9677c207036b9f2b, []int{12} -} -func (m *QueryCodeRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryCodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryCodeRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryCodeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryCodeRequest.Merge(m, src) -} -func (m *QueryCodeRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryCodeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryCodeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryCodeRequest proto.InternalMessageInfo - -// CodeInfoResponse contains code meta data from CodeInfo -type CodeInfoResponse struct { - CodeID uint64 `protobuf:"varint,1,opt,name=code_id,json=codeId,proto3" json:"id"` - Creator string `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator,omitempty"` - DataHash github_com_tendermint_tendermint_libs_bytes.HexBytes `protobuf:"bytes,3,opt,name=data_hash,json=dataHash,proto3,casttype=github.com/tendermint/tendermint/libs/bytes.HexBytes" json:"data_hash,omitempty"` -} - -func (m *CodeInfoResponse) Reset() { *m = CodeInfoResponse{} } -func (m *CodeInfoResponse) String() string { return proto.CompactTextString(m) } -func (*CodeInfoResponse) ProtoMessage() {} -func (*CodeInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9677c207036b9f2b, []int{13} -} -func (m *CodeInfoResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CodeInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CodeInfoResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CodeInfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CodeInfoResponse.Merge(m, src) -} -func (m *CodeInfoResponse) XXX_Size() int { - return m.Size() -} -func (m *CodeInfoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CodeInfoResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CodeInfoResponse proto.InternalMessageInfo - -// QueryCodeResponse is the response type for the Query/Code RPC method -type QueryCodeResponse struct { - *CodeInfoResponse `protobuf:"bytes,1,opt,name=code_info,json=codeInfo,proto3,embedded=code_info" json:""` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data"` -} - -func (m *QueryCodeResponse) Reset() { *m = QueryCodeResponse{} } -func (m *QueryCodeResponse) String() string { return proto.CompactTextString(m) } -func (*QueryCodeResponse) ProtoMessage() {} -func (*QueryCodeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9677c207036b9f2b, []int{14} -} -func (m *QueryCodeResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryCodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryCodeResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryCodeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryCodeResponse.Merge(m, src) -} -func (m *QueryCodeResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryCodeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryCodeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryCodeResponse proto.InternalMessageInfo - -// QueryCodesRequest is the request type for the Query/Codes RPC method -type QueryCodesRequest struct { - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryCodesRequest) Reset() { *m = QueryCodesRequest{} } -func (m *QueryCodesRequest) String() string { return proto.CompactTextString(m) } -func (*QueryCodesRequest) ProtoMessage() {} -func (*QueryCodesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9677c207036b9f2b, []int{15} -} -func (m *QueryCodesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryCodesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryCodesRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryCodesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryCodesRequest.Merge(m, src) -} -func (m *QueryCodesRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryCodesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryCodesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryCodesRequest proto.InternalMessageInfo - -// QueryCodesResponse is the response type for the Query/Codes RPC method -type QueryCodesResponse struct { - CodeInfos []CodeInfoResponse `protobuf:"bytes,1,rep,name=code_infos,json=codeInfos,proto3" json:"code_infos"` - // pagination defines the pagination in the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryCodesResponse) Reset() { *m = QueryCodesResponse{} } -func (m *QueryCodesResponse) String() string { return proto.CompactTextString(m) } -func (*QueryCodesResponse) ProtoMessage() {} -func (*QueryCodesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9677c207036b9f2b, []int{16} -} -func (m *QueryCodesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryCodesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryCodesResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryCodesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryCodesResponse.Merge(m, src) -} -func (m *QueryCodesResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryCodesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryCodesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryCodesResponse proto.InternalMessageInfo - -// QueryPinnedCodesRequest is the request type for the Query/PinnedCodes -// RPC method -type QueryPinnedCodesRequest struct { - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryPinnedCodesRequest) Reset() { *m = QueryPinnedCodesRequest{} } -func (m *QueryPinnedCodesRequest) String() string { return proto.CompactTextString(m) } -func (*QueryPinnedCodesRequest) ProtoMessage() {} -func (*QueryPinnedCodesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9677c207036b9f2b, []int{17} -} -func (m *QueryPinnedCodesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryPinnedCodesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryPinnedCodesRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryPinnedCodesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryPinnedCodesRequest.Merge(m, src) -} -func (m *QueryPinnedCodesRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryPinnedCodesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryPinnedCodesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryPinnedCodesRequest proto.InternalMessageInfo - -// QueryPinnedCodesResponse is the response type for the -// Query/PinnedCodes RPC method -type QueryPinnedCodesResponse struct { - CodeIDs []uint64 `protobuf:"varint,1,rep,packed,name=code_ids,json=codeIds,proto3" json:"code_ids,omitempty"` - // pagination defines the pagination in the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryPinnedCodesResponse) Reset() { *m = QueryPinnedCodesResponse{} } -func (m *QueryPinnedCodesResponse) String() string { return proto.CompactTextString(m) } -func (*QueryPinnedCodesResponse) ProtoMessage() {} -func (*QueryPinnedCodesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9677c207036b9f2b, []int{18} -} -func (m *QueryPinnedCodesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryPinnedCodesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryPinnedCodesResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryPinnedCodesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryPinnedCodesResponse.Merge(m, src) -} -func (m *QueryPinnedCodesResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryPinnedCodesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryPinnedCodesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryPinnedCodesResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*QueryContractInfoRequest)(nil), "cosmwasm.wasm.v1.QueryContractInfoRequest") - proto.RegisterType((*QueryContractInfoResponse)(nil), "cosmwasm.wasm.v1.QueryContractInfoResponse") - proto.RegisterType((*QueryContractHistoryRequest)(nil), "cosmwasm.wasm.v1.QueryContractHistoryRequest") - proto.RegisterType((*QueryContractHistoryResponse)(nil), "cosmwasm.wasm.v1.QueryContractHistoryResponse") - proto.RegisterType((*QueryContractsByCodeRequest)(nil), "cosmwasm.wasm.v1.QueryContractsByCodeRequest") - proto.RegisterType((*QueryContractsByCodeResponse)(nil), "cosmwasm.wasm.v1.QueryContractsByCodeResponse") - proto.RegisterType((*QueryAllContractStateRequest)(nil), "cosmwasm.wasm.v1.QueryAllContractStateRequest") - proto.RegisterType((*QueryAllContractStateResponse)(nil), "cosmwasm.wasm.v1.QueryAllContractStateResponse") - proto.RegisterType((*QueryRawContractStateRequest)(nil), "cosmwasm.wasm.v1.QueryRawContractStateRequest") - proto.RegisterType((*QueryRawContractStateResponse)(nil), "cosmwasm.wasm.v1.QueryRawContractStateResponse") - proto.RegisterType((*QuerySmartContractStateRequest)(nil), "cosmwasm.wasm.v1.QuerySmartContractStateRequest") - proto.RegisterType((*QuerySmartContractStateResponse)(nil), "cosmwasm.wasm.v1.QuerySmartContractStateResponse") - proto.RegisterType((*QueryCodeRequest)(nil), "cosmwasm.wasm.v1.QueryCodeRequest") - proto.RegisterType((*CodeInfoResponse)(nil), "cosmwasm.wasm.v1.CodeInfoResponse") - proto.RegisterType((*QueryCodeResponse)(nil), "cosmwasm.wasm.v1.QueryCodeResponse") - proto.RegisterType((*QueryCodesRequest)(nil), "cosmwasm.wasm.v1.QueryCodesRequest") - proto.RegisterType((*QueryCodesResponse)(nil), "cosmwasm.wasm.v1.QueryCodesResponse") - proto.RegisterType((*QueryPinnedCodesRequest)(nil), "cosmwasm.wasm.v1.QueryPinnedCodesRequest") - proto.RegisterType((*QueryPinnedCodesResponse)(nil), "cosmwasm.wasm.v1.QueryPinnedCodesResponse") -} - -func init() { proto.RegisterFile("cosmwasm/wasm/v1/query.proto", fileDescriptor_9677c207036b9f2b) } - -var fileDescriptor_9677c207036b9f2b = []byte{ - // 1142 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x97, 0x4d, 0x6f, 0x1b, 0x45, - 0x18, 0xc7, 0x3d, 0xa9, 0xe3, 0x97, 0x49, 0x50, 0xcd, 0x08, 0x35, 0xc6, 0xa4, 0xbb, 0xd1, 0x52, - 0x85, 0xd4, 0x0d, 0xbb, 0x75, 0x9a, 0x22, 0xc4, 0x0d, 0xa7, 0xd0, 0x24, 0x52, 0xa4, 0x76, 0x2b, - 0x54, 0x09, 0x0e, 0xd1, 0xd8, 0x3b, 0xb5, 0x57, 0xb2, 0x77, 0x9c, 0x9d, 0x49, 0x52, 0x2b, 0x0a, - 0xa0, 0x4a, 0xdc, 0x10, 0x20, 0x21, 0xce, 0x70, 0x40, 0x05, 0x8e, 0x88, 0x2f, 0xc0, 0x31, 0xc7, - 0x48, 0x5c, 0x38, 0x59, 0xe0, 0x70, 0x40, 0xf9, 0x02, 0x48, 0x3d, 0xa1, 0x9d, 0x9d, 0xb5, 0xd7, - 0x2f, 0x6b, 0x3b, 0x91, 0xd5, 0x4b, 0xb4, 0x9b, 0x79, 0x5e, 0x7e, 0xcf, 0x7f, 0x9f, 0x99, 0x67, - 0x0c, 0x17, 0xcb, 0x94, 0xd5, 0x0f, 0x31, 0xab, 0x1b, 0xe2, 0xcf, 0x41, 0xc1, 0xd8, 0xdb, 0x27, - 0x6e, 0x53, 0x6f, 0xb8, 0x94, 0x53, 0x94, 0x09, 0x56, 0x75, 0xf1, 0xe7, 0xa0, 0x90, 0x7b, 0xad, - 0x42, 0x2b, 0x54, 0x2c, 0x1a, 0xde, 0x93, 0x6f, 0x97, 0x1b, 0x8c, 0xc2, 0x9b, 0x0d, 0xc2, 0x82, - 0xd5, 0x0a, 0xa5, 0x95, 0x1a, 0x31, 0x70, 0xc3, 0x36, 0xb0, 0xe3, 0x50, 0x8e, 0xb9, 0x4d, 0x9d, - 0x60, 0x35, 0xef, 0xf9, 0x52, 0x66, 0x94, 0x30, 0x23, 0x7e, 0x72, 0xe3, 0xa0, 0x50, 0x22, 0x1c, - 0x17, 0x8c, 0x06, 0xae, 0xd8, 0x8e, 0x30, 0xf6, 0x6d, 0xb5, 0x75, 0x98, 0x7d, 0xe8, 0x59, 0x6c, - 0x50, 0x87, 0xbb, 0xb8, 0xcc, 0xb7, 0x9c, 0x27, 0xd4, 0x24, 0x7b, 0xfb, 0x84, 0x71, 0x94, 0x85, - 0x49, 0x6c, 0x59, 0x2e, 0x61, 0x2c, 0x0b, 0x96, 0xc0, 0x4a, 0xda, 0x0c, 0x5e, 0xb5, 0xaf, 0x00, - 0x7c, 0x7d, 0x88, 0x1b, 0x6b, 0x50, 0x87, 0x91, 0x68, 0x3f, 0xf4, 0x10, 0xbe, 0x52, 0x96, 0x1e, - 0xbb, 0xb6, 0xf3, 0x84, 0x66, 0x67, 0x96, 0xc0, 0xca, 0xdc, 0x9a, 0xa2, 0xf7, 0xab, 0xa2, 0x87, - 0x03, 0x17, 0xe7, 0x4f, 0x5a, 0x6a, 0xec, 0xb4, 0xa5, 0x82, 0xf3, 0x96, 0x1a, 0x33, 0xe7, 0xcb, - 0xa1, 0xb5, 0xf7, 0xe2, 0xff, 0xfe, 0xa0, 0x02, 0xed, 0x33, 0xf8, 0x46, 0x0f, 0xcf, 0xa6, 0xcd, - 0x38, 0x75, 0x9b, 0x63, 0x2b, 0x41, 0x1f, 0x42, 0xd8, 0xd5, 0x44, 0xe2, 0x2c, 0xeb, 0xbe, 0x80, - 0xba, 0x27, 0xa0, 0xee, 0x7f, 0x3d, 0x29, 0xa0, 0xfe, 0x00, 0x57, 0x88, 0x8c, 0x6a, 0x86, 0x3c, - 0xb5, 0xdf, 0x00, 0x5c, 0x1c, 0x4e, 0x20, 0x45, 0xd9, 0x86, 0x49, 0xe2, 0x70, 0xd7, 0x26, 0x1e, - 0xc2, 0x95, 0x95, 0xb9, 0xb5, 0x7c, 0x74, 0xd1, 0x1b, 0xd4, 0x22, 0xd2, 0xff, 0x03, 0x87, 0xbb, - 0xcd, 0x62, 0xdc, 0x13, 0xc0, 0x0c, 0x02, 0xa0, 0xfb, 0x43, 0xa0, 0xdf, 0x1a, 0x0b, 0xed, 0x83, - 0xf4, 0x50, 0x7f, 0xda, 0x27, 0x1b, 0x2b, 0x36, 0xbd, 0xdc, 0x81, 0x6c, 0x0b, 0x30, 0x59, 0xa6, - 0x16, 0xd9, 0xb5, 0x2d, 0x21, 0x5b, 0xdc, 0x4c, 0x78, 0xaf, 0x5b, 0xd6, 0xd4, 0x54, 0xfb, 0xa2, - 0x5f, 0xb5, 0x0e, 0x80, 0x54, 0x6d, 0x11, 0xa6, 0x83, 0xaf, 0xed, 0xeb, 0x96, 0x36, 0xbb, 0xff, - 0x98, 0x9e, 0x0e, 0x9f, 0x07, 0x1c, 0xef, 0xd7, 0x6a, 0x01, 0xca, 0x23, 0x8e, 0x39, 0x79, 0x79, - 0x0d, 0xf4, 0x3d, 0x80, 0xd7, 0x23, 0x10, 0xa4, 0x16, 0x77, 0x61, 0xa2, 0x4e, 0x2d, 0x52, 0x0b, - 0x1a, 0x68, 0x61, 0xb0, 0x81, 0x76, 0xbc, 0x75, 0xd9, 0x2d, 0xd2, 0x78, 0x7a, 0x22, 0x3d, 0x96, - 0x1a, 0x99, 0xf8, 0xf0, 0x82, 0x1a, 0x5d, 0x87, 0x50, 0xe4, 0xd8, 0xb5, 0x30, 0xc7, 0x02, 0x61, - 0xde, 0x4c, 0x8b, 0xff, 0xdc, 0xc3, 0x1c, 0x6b, 0x77, 0x64, 0xe5, 0x83, 0x81, 0x65, 0xe5, 0x08, - 0xc6, 0x85, 0x27, 0x10, 0x9e, 0xe2, 0x59, 0xdb, 0x83, 0x8a, 0x70, 0x7a, 0x54, 0xc7, 0x2e, 0xbf, - 0x20, 0xcf, 0xdd, 0x41, 0x9e, 0xe2, 0xb5, 0x17, 0x2d, 0x15, 0x85, 0x08, 0x76, 0x08, 0x63, 0x9e, - 0x12, 0x21, 0xce, 0x1d, 0xa8, 0x46, 0xa6, 0x94, 0xa4, 0xf9, 0x30, 0x69, 0x64, 0x4c, 0xbf, 0x82, - 0x5b, 0x30, 0x23, 0x7b, 0x7f, 0xfc, 0x8e, 0xd3, 0x7e, 0x07, 0x30, 0xe3, 0x19, 0xf6, 0x1c, 0xb4, - 0x37, 0xfb, 0xac, 0x8b, 0x99, 0x76, 0x4b, 0x4d, 0x08, 0xb3, 0x7b, 0xe7, 0x2d, 0x75, 0xc6, 0xb6, - 0x3a, 0x3b, 0x36, 0x0b, 0x93, 0x65, 0x97, 0x60, 0x4e, 0x5d, 0x51, 0x6f, 0xda, 0x0c, 0x5e, 0xd1, - 0x47, 0x30, 0xed, 0xe1, 0xec, 0x56, 0x31, 0xab, 0x66, 0xaf, 0x08, 0xee, 0x77, 0x5f, 0xb4, 0xd4, - 0xf5, 0x8a, 0xcd, 0xab, 0xfb, 0x25, 0xbd, 0x4c, 0xeb, 0x06, 0x27, 0x8e, 0x45, 0xdc, 0xba, 0xed, - 0xf0, 0xf0, 0x63, 0xcd, 0x2e, 0x31, 0xa3, 0xd4, 0xe4, 0x84, 0xe9, 0x9b, 0xe4, 0x69, 0xd1, 0x7b, - 0x30, 0x53, 0x5e, 0xa8, 0x4d, 0xcc, 0xaa, 0xfe, 0xb9, 0xbc, 0x1d, 0x4f, 0xc5, 0x33, 0xb3, 0xdb, - 0xf1, 0xd4, 0x6c, 0x26, 0xa1, 0x3d, 0x03, 0xf0, 0xd5, 0x50, 0xc1, 0xb2, 0x86, 0x2d, 0x6f, 0x87, - 0x7b, 0x35, 0x78, 0xe3, 0x00, 0x88, 0xee, 0xd4, 0x86, 0x9d, 0x8c, 0xbd, 0xa5, 0x17, 0x53, 0x9d, - 0x71, 0x90, 0x2a, 0xcb, 0x35, 0xb4, 0x28, 0xc5, 0xf7, 0x3f, 0x68, 0xea, 0xbc, 0xa5, 0x8a, 0x77, - 0x5f, 0x6e, 0x39, 0x28, 0x3e, 0x09, 0x31, 0xb0, 0x40, 0xf5, 0xde, 0x3d, 0x0c, 0x2e, 0xbd, 0x87, - 0x9f, 0x03, 0x88, 0xc2, 0xd1, 0x65, 0x89, 0xf7, 0x21, 0xec, 0x94, 0x18, 0x6c, 0xde, 0x49, 0x6a, - 0xf4, 0xf7, 0x71, 0x3a, 0xa8, 0x6f, 0x8a, 0x5b, 0x19, 0xc3, 0x05, 0xc1, 0xf9, 0xc0, 0x76, 0x1c, - 0x62, 0x8d, 0xd0, 0xe2, 0xf2, 0xe7, 0xd9, 0xd7, 0x40, 0xde, 0x2c, 0x7a, 0x72, 0x74, 0xb6, 0x49, - 0x4a, 0x36, 0xae, 0xaf, 0x47, 0xbc, 0x78, 0xd5, 0xab, 0xb5, 0xdd, 0x52, 0x93, 0x7e, 0xf7, 0x32, - 0x33, 0xe9, 0x37, 0xee, 0xf4, 0x8a, 0x5e, 0xfb, 0x0f, 0xc2, 0x59, 0x41, 0x84, 0xbe, 0x03, 0x70, - 0x3e, 0x7c, 0xc1, 0x40, 0x43, 0x66, 0x71, 0xd4, 0xad, 0x28, 0x77, 0x6b, 0x22, 0x5b, 0x3f, 0xbf, - 0xb6, 0xfa, 0xec, 0x8f, 0x7f, 0xbe, 0x9d, 0x59, 0x46, 0x37, 0x8c, 0x81, 0xfb, 0x5c, 0x30, 0xc6, - 0x8c, 0x23, 0x79, 0x2c, 0x1d, 0xa3, 0xe7, 0x00, 0x5e, 0xed, 0xbb, 0x3f, 0xa0, 0xb7, 0xc7, 0xa4, - 0xeb, 0xbd, 0xe9, 0xe4, 0xf4, 0x49, 0xcd, 0x25, 0xe0, 0xba, 0x00, 0xd4, 0xd1, 0xea, 0x24, 0x80, - 0x46, 0x55, 0x42, 0xfd, 0x18, 0x02, 0x95, 0x23, 0x7b, 0x2c, 0x68, 0xef, 0xdd, 0x62, 0x2c, 0x68, - 0xdf, 0x4d, 0x40, 0x5b, 0x13, 0xa0, 0xab, 0x28, 0x3f, 0x0c, 0xd4, 0x22, 0xc6, 0x91, 0x6c, 0xa8, - 0x63, 0xa3, 0x7b, 0x3f, 0xf8, 0x09, 0xc0, 0x4c, 0xff, 0x38, 0x45, 0x51, 0x89, 0x23, 0x46, 0x7f, - 0xce, 0x98, 0xd8, 0x7e, 0x12, 0xd2, 0x01, 0x49, 0x99, 0x80, 0xfa, 0x05, 0xc0, 0x4c, 0xff, 0xf8, - 0x8b, 0x24, 0x8d, 0x18, 0xc0, 0x91, 0xa4, 0x51, 0x73, 0x35, 0xf4, 0xf1, 0x47, 0x00, 0xba, 0xf8, - 0xd0, 0x38, 0xea, 0x8e, 0xcb, 0x63, 0xf4, 0x2b, 0x80, 0x68, 0x70, 0x04, 0xa2, 0xdb, 0x11, 0xd9, - 0x23, 0x07, 0x74, 0xae, 0x70, 0x01, 0x0f, 0x49, 0xfc, 0x8e, 0x20, 0xbe, 0x8d, 0xf4, 0x91, 0x92, - 0x7a, 0xfe, 0xbd, 0xcc, 0x4d, 0x18, 0x17, 0x4d, 0xaa, 0x45, 0x76, 0x5d, 0xb7, 0x33, 0xdf, 0x1c, - 0x69, 0x23, 0x41, 0x56, 0x04, 0x88, 0x86, 0x96, 0xc6, 0xb5, 0x23, 0x72, 0xe1, 0xac, 0x38, 0xfc, - 0xd0, 0xa8, 0xb8, 0xc1, 0xf1, 0x9b, 0xbb, 0x31, 0xda, 0x48, 0x66, 0x57, 0x44, 0xf6, 0x2c, 0xba, - 0x36, 0x3c, 0x3b, 0xfa, 0x12, 0xc0, 0xb9, 0xd0, 0xb9, 0x8b, 0x6e, 0x46, 0x44, 0x1d, 0x3c, 0xff, - 0x73, 0xf9, 0x49, 0x4c, 0x25, 0xc6, 0xb2, 0xc0, 0x58, 0x42, 0xca, 0x70, 0x0c, 0x66, 0x34, 0x84, - 0x53, 0x71, 0xf3, 0xe4, 0x6f, 0x25, 0xf6, 0x73, 0x5b, 0x89, 0x9d, 0xb4, 0x15, 0x70, 0xda, 0x56, - 0xc0, 0x5f, 0x6d, 0x05, 0x7c, 0x73, 0xa6, 0xc4, 0x4e, 0xcf, 0x94, 0xd8, 0x9f, 0x67, 0x4a, 0xec, - 0xe3, 0xe5, 0xd0, 0x6d, 0x63, 0x83, 0xb2, 0xfa, 0xe3, 0x20, 0x96, 0x65, 0x3c, 0xf5, 0x63, 0x8a, - 0x9f, 0xbf, 0xa5, 0x84, 0xf8, 0xd5, 0x7a, 0xe7, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe5, 0x33, - 0xf7, 0x66, 0x65, 0x0f, 0x00, 0x00, -} - -func (this *QueryContractInfoResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryContractInfoResponse) - if !ok { - that2, ok := that.(QueryContractInfoResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Address != that1.Address { - return false - } - if !this.ContractInfo.Equal(&that1.ContractInfo) { - return false - } - return true -} -func (this *CodeInfoResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*CodeInfoResponse) - if !ok { - that2, ok := that.(CodeInfoResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.CodeID != that1.CodeID { - return false - } - if this.Creator != that1.Creator { - return false - } - if !bytes.Equal(this.DataHash, that1.DataHash) { - return false - } - return true -} -func (this *QueryCodeResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryCodeResponse) - if !ok { - that2, ok := that.(QueryCodeResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.CodeInfoResponse.Equal(that1.CodeInfoResponse) { - return false - } - if !bytes.Equal(this.Data, that1.Data) { - return false - } - return true -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type QueryClient interface { - // ContractInfo gets the contract meta data - ContractInfo(ctx context.Context, in *QueryContractInfoRequest, opts ...grpc.CallOption) (*QueryContractInfoResponse, error) - // ContractHistory gets the contract code history - ContractHistory(ctx context.Context, in *QueryContractHistoryRequest, opts ...grpc.CallOption) (*QueryContractHistoryResponse, error) - // ContractsByCode lists all smart contracts for a code id - ContractsByCode(ctx context.Context, in *QueryContractsByCodeRequest, opts ...grpc.CallOption) (*QueryContractsByCodeResponse, error) - // AllContractState gets all raw store data for a single contract - AllContractState(ctx context.Context, in *QueryAllContractStateRequest, opts ...grpc.CallOption) (*QueryAllContractStateResponse, error) - // RawContractState gets single key from the raw store data of a contract - RawContractState(ctx context.Context, in *QueryRawContractStateRequest, opts ...grpc.CallOption) (*QueryRawContractStateResponse, error) - // SmartContractState get smart query result from the contract - SmartContractState(ctx context.Context, in *QuerySmartContractStateRequest, opts ...grpc.CallOption) (*QuerySmartContractStateResponse, error) - // Code gets the binary code and metadata for a singe wasm code - Code(ctx context.Context, in *QueryCodeRequest, opts ...grpc.CallOption) (*QueryCodeResponse, error) - // Codes gets the metadata for all stored wasm codes - Codes(ctx context.Context, in *QueryCodesRequest, opts ...grpc.CallOption) (*QueryCodesResponse, error) - // PinnedCodes gets the pinned code ids - PinnedCodes(ctx context.Context, in *QueryPinnedCodesRequest, opts ...grpc.CallOption) (*QueryPinnedCodesResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) ContractInfo(ctx context.Context, in *QueryContractInfoRequest, opts ...grpc.CallOption) (*QueryContractInfoResponse, error) { - out := new(QueryContractInfoResponse) - err := c.cc.Invoke(ctx, "/cosmwasm.wasm.v1.Query/ContractInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) ContractHistory(ctx context.Context, in *QueryContractHistoryRequest, opts ...grpc.CallOption) (*QueryContractHistoryResponse, error) { - out := new(QueryContractHistoryResponse) - err := c.cc.Invoke(ctx, "/cosmwasm.wasm.v1.Query/ContractHistory", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) ContractsByCode(ctx context.Context, in *QueryContractsByCodeRequest, opts ...grpc.CallOption) (*QueryContractsByCodeResponse, error) { - out := new(QueryContractsByCodeResponse) - err := c.cc.Invoke(ctx, "/cosmwasm.wasm.v1.Query/ContractsByCode", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) AllContractState(ctx context.Context, in *QueryAllContractStateRequest, opts ...grpc.CallOption) (*QueryAllContractStateResponse, error) { - out := new(QueryAllContractStateResponse) - err := c.cc.Invoke(ctx, "/cosmwasm.wasm.v1.Query/AllContractState", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) RawContractState(ctx context.Context, in *QueryRawContractStateRequest, opts ...grpc.CallOption) (*QueryRawContractStateResponse, error) { - out := new(QueryRawContractStateResponse) - err := c.cc.Invoke(ctx, "/cosmwasm.wasm.v1.Query/RawContractState", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) SmartContractState(ctx context.Context, in *QuerySmartContractStateRequest, opts ...grpc.CallOption) (*QuerySmartContractStateResponse, error) { - out := new(QuerySmartContractStateResponse) - err := c.cc.Invoke(ctx, "/cosmwasm.wasm.v1.Query/SmartContractState", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Code(ctx context.Context, in *QueryCodeRequest, opts ...grpc.CallOption) (*QueryCodeResponse, error) { - out := new(QueryCodeResponse) - err := c.cc.Invoke(ctx, "/cosmwasm.wasm.v1.Query/Code", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Codes(ctx context.Context, in *QueryCodesRequest, opts ...grpc.CallOption) (*QueryCodesResponse, error) { - out := new(QueryCodesResponse) - err := c.cc.Invoke(ctx, "/cosmwasm.wasm.v1.Query/Codes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) PinnedCodes(ctx context.Context, in *QueryPinnedCodesRequest, opts ...grpc.CallOption) (*QueryPinnedCodesResponse, error) { - out := new(QueryPinnedCodesResponse) - err := c.cc.Invoke(ctx, "/cosmwasm.wasm.v1.Query/PinnedCodes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // ContractInfo gets the contract meta data - ContractInfo(context.Context, *QueryContractInfoRequest) (*QueryContractInfoResponse, error) - // ContractHistory gets the contract code history - ContractHistory(context.Context, *QueryContractHistoryRequest) (*QueryContractHistoryResponse, error) - // ContractsByCode lists all smart contracts for a code id - ContractsByCode(context.Context, *QueryContractsByCodeRequest) (*QueryContractsByCodeResponse, error) - // AllContractState gets all raw store data for a single contract - AllContractState(context.Context, *QueryAllContractStateRequest) (*QueryAllContractStateResponse, error) - // RawContractState gets single key from the raw store data of a contract - RawContractState(context.Context, *QueryRawContractStateRequest) (*QueryRawContractStateResponse, error) - // SmartContractState get smart query result from the contract - SmartContractState(context.Context, *QuerySmartContractStateRequest) (*QuerySmartContractStateResponse, error) - // Code gets the binary code and metadata for a singe wasm code - Code(context.Context, *QueryCodeRequest) (*QueryCodeResponse, error) - // Codes gets the metadata for all stored wasm codes - Codes(context.Context, *QueryCodesRequest) (*QueryCodesResponse, error) - // PinnedCodes gets the pinned code ids - PinnedCodes(context.Context, *QueryPinnedCodesRequest) (*QueryPinnedCodesResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) ContractInfo(ctx context.Context, req *QueryContractInfoRequest) (*QueryContractInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ContractInfo not implemented") -} -func (*UnimplementedQueryServer) ContractHistory(ctx context.Context, req *QueryContractHistoryRequest) (*QueryContractHistoryResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ContractHistory not implemented") -} -func (*UnimplementedQueryServer) ContractsByCode(ctx context.Context, req *QueryContractsByCodeRequest) (*QueryContractsByCodeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ContractsByCode not implemented") -} -func (*UnimplementedQueryServer) AllContractState(ctx context.Context, req *QueryAllContractStateRequest) (*QueryAllContractStateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AllContractState not implemented") -} -func (*UnimplementedQueryServer) RawContractState(ctx context.Context, req *QueryRawContractStateRequest) (*QueryRawContractStateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RawContractState not implemented") -} -func (*UnimplementedQueryServer) SmartContractState(ctx context.Context, req *QuerySmartContractStateRequest) (*QuerySmartContractStateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SmartContractState not implemented") -} -func (*UnimplementedQueryServer) Code(ctx context.Context, req *QueryCodeRequest) (*QueryCodeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Code not implemented") -} -func (*UnimplementedQueryServer) Codes(ctx context.Context, req *QueryCodesRequest) (*QueryCodesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Codes not implemented") -} -func (*UnimplementedQueryServer) PinnedCodes(ctx context.Context, req *QueryPinnedCodesRequest) (*QueryPinnedCodesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PinnedCodes not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -func _Query_ContractInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryContractInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).ContractInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmwasm.wasm.v1.Query/ContractInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ContractInfo(ctx, req.(*QueryContractInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_ContractHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryContractHistoryRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).ContractHistory(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmwasm.wasm.v1.Query/ContractHistory", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ContractHistory(ctx, req.(*QueryContractHistoryRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_ContractsByCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryContractsByCodeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).ContractsByCode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmwasm.wasm.v1.Query/ContractsByCode", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ContractsByCode(ctx, req.(*QueryContractsByCodeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_AllContractState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllContractStateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AllContractState(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmwasm.wasm.v1.Query/AllContractState", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AllContractState(ctx, req.(*QueryAllContractStateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_RawContractState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryRawContractStateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).RawContractState(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmwasm.wasm.v1.Query/RawContractState", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).RawContractState(ctx, req.(*QueryRawContractStateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_SmartContractState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QuerySmartContractStateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).SmartContractState(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmwasm.wasm.v1.Query/SmartContractState", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).SmartContractState(ctx, req.(*QuerySmartContractStateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Code_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryCodeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Code(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmwasm.wasm.v1.Query/Code", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Code(ctx, req.(*QueryCodeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Codes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryCodesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Codes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmwasm.wasm.v1.Query/Codes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Codes(ctx, req.(*QueryCodesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_PinnedCodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryPinnedCodesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).PinnedCodes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmwasm.wasm.v1.Query/PinnedCodes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).PinnedCodes(ctx, req.(*QueryPinnedCodesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmwasm.wasm.v1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ContractInfo", - Handler: _Query_ContractInfo_Handler, - }, - { - MethodName: "ContractHistory", - Handler: _Query_ContractHistory_Handler, - }, - { - MethodName: "ContractsByCode", - Handler: _Query_ContractsByCode_Handler, - }, - { - MethodName: "AllContractState", - Handler: _Query_AllContractState_Handler, - }, - { - MethodName: "RawContractState", - Handler: _Query_RawContractState_Handler, - }, - { - MethodName: "SmartContractState", - Handler: _Query_SmartContractState_Handler, - }, - { - MethodName: "Code", - Handler: _Query_Code_Handler, - }, - { - MethodName: "Codes", - Handler: _Query_Codes_Handler, - }, - { - MethodName: "PinnedCodes", - Handler: _Query_PinnedCodes_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmwasm/wasm/v1/query.proto", -} - -func (m *QueryContractInfoRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryContractInfoRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryContractInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryContractInfoResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryContractInfoResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryContractInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.ContractInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryContractHistoryRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryContractHistoryRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryContractHistoryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryContractHistoryResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryContractHistoryResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryContractHistoryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Entries) > 0 { - for iNdEx := len(m.Entries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Entries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryContractsByCodeRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryContractsByCodeRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryContractsByCodeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.CodeId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.CodeId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryContractsByCodeResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryContractsByCodeResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryContractsByCodeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Contracts) > 0 { - for iNdEx := len(m.Contracts) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Contracts[iNdEx]) - copy(dAtA[i:], m.Contracts[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Contracts[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryAllContractStateRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAllContractStateRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllContractStateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAllContractStateResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAllContractStateResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllContractStateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Models) > 0 { - for iNdEx := len(m.Models) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Models[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryRawContractStateRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryRawContractStateRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryRawContractStateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.QueryData) > 0 { - i -= len(m.QueryData) - copy(dAtA[i:], m.QueryData) - i = encodeVarintQuery(dAtA, i, uint64(len(m.QueryData))) - i-- - dAtA[i] = 0x12 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryRawContractStateResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryRawContractStateResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryRawContractStateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QuerySmartContractStateRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QuerySmartContractStateRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySmartContractStateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.QueryData) > 0 { - i -= len(m.QueryData) - copy(dAtA[i:], m.QueryData) - i = encodeVarintQuery(dAtA, i, uint64(len(m.QueryData))) - i-- - dAtA[i] = 0x12 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QuerySmartContractStateResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QuerySmartContractStateResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySmartContractStateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryCodeRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryCodeRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryCodeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.CodeId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.CodeId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *CodeInfoResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CodeInfoResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CodeInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.DataHash) > 0 { - i -= len(m.DataHash) - copy(dAtA[i:], m.DataHash) - i = encodeVarintQuery(dAtA, i, uint64(len(m.DataHash))) - i-- - dAtA[i] = 0x1a - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0x12 - } - if m.CodeID != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.CodeID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryCodeResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryCodeResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryCodeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x12 - } - if m.CodeInfoResponse != nil { - { - size, err := m.CodeInfoResponse.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryCodesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryCodesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryCodesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryCodesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryCodesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryCodesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.CodeInfos) > 0 { - for iNdEx := len(m.CodeInfos) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.CodeInfos[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryPinnedCodesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryPinnedCodesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryPinnedCodesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} - -func (m *QueryPinnedCodesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryPinnedCodesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryPinnedCodesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.CodeIDs) > 0 { - dAtA14 := make([]byte, len(m.CodeIDs)*10) - var j13 int - for _, num := range m.CodeIDs { - for num >= 1<<7 { - dAtA14[j13] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j13++ - } - dAtA14[j13] = uint8(num) - j13++ - } - i -= j13 - copy(dAtA[i:], dAtA14[:j13]) - i = encodeVarintQuery(dAtA, i, uint64(j13)) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *QueryContractInfoRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryContractInfoResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = m.ContractInfo.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryContractHistoryRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryContractHistoryResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Entries) > 0 { - for _, e := range m.Entries { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryContractsByCodeRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CodeId != 0 { - n += 1 + sovQuery(uint64(m.CodeId)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryContractsByCodeResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Contracts) > 0 { - for _, s := range m.Contracts { - l = len(s) - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllContractStateRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllContractStateResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Models) > 0 { - for _, e := range m.Models { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryRawContractStateRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.QueryData) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryRawContractStateResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Data) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QuerySmartContractStateRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.QueryData) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QuerySmartContractStateResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Data) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryCodeRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CodeId != 0 { - n += 1 + sovQuery(uint64(m.CodeId)) - } - return n -} - -func (m *CodeInfoResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CodeID != 0 { - n += 1 + sovQuery(uint64(m.CodeID)) - } - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.DataHash) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryCodeResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CodeInfoResponse != nil { - l = m.CodeInfoResponse.Size() - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryCodesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryCodesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.CodeInfos) > 0 { - for _, e := range m.CodeInfos { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryPinnedCodesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryPinnedCodesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.CodeIDs) > 0 { - l = 0 - for _, e := range m.CodeIDs { - l += sovQuery(uint64(e)) - } - n += 1 + sovQuery(uint64(l)) + l - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *QueryContractInfoRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryContractInfoRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryContractInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryContractInfoResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryContractInfoResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryContractInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ContractInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryContractHistoryRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryContractHistoryRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryContractHistoryRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryContractHistoryResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryContractHistoryResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryContractHistoryResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Entries = append(m.Entries, ContractCodeHistoryEntry{}) - if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryContractsByCodeRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryContractsByCodeRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryContractsByCodeRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CodeId", wireType) - } - m.CodeId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CodeId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryContractsByCodeResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryContractsByCodeResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryContractsByCodeResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Contracts", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Contracts = append(m.Contracts, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllContractStateRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAllContractStateRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllContractStateRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllContractStateResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAllContractStateResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllContractStateResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Models", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Models = append(m.Models, Model{}) - if err := m.Models[len(m.Models)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryRawContractStateRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryRawContractStateRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryRawContractStateRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QueryData", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.QueryData = append(m.QueryData[:0], dAtA[iNdEx:postIndex]...) - if m.QueryData == nil { - m.QueryData = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryRawContractStateResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryRawContractStateResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryRawContractStateResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QuerySmartContractStateRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QuerySmartContractStateRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySmartContractStateRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QueryData", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.QueryData = append(m.QueryData[:0], dAtA[iNdEx:postIndex]...) - if m.QueryData == nil { - m.QueryData = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QuerySmartContractStateResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QuerySmartContractStateResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySmartContractStateResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryCodeRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryCodeRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryCodeRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CodeId", wireType) - } - m.CodeId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CodeId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CodeInfoResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CodeInfoResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CodeInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CodeID", wireType) - } - m.CodeID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CodeID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DataHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DataHash = append(m.DataHash[:0], dAtA[iNdEx:postIndex]...) - if m.DataHash == nil { - m.DataHash = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryCodeResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryCodeResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryCodeResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CodeInfoResponse", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CodeInfoResponse == nil { - m.CodeInfoResponse = &CodeInfoResponse{} - } - if err := m.CodeInfoResponse.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryCodesRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryCodesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryCodesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryCodesResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryCodesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryCodesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CodeInfos", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CodeInfos = append(m.CodeInfos, CodeInfoResponse{}) - if err := m.CodeInfos[len(m.CodeInfos)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryPinnedCodesRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryPinnedCodesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryPinnedCodesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryPinnedCodesResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryPinnedCodesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryPinnedCodesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.CodeIDs = append(m.CodeIDs, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.CodeIDs) == 0 { - m.CodeIDs = make([]uint64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.CodeIDs = append(m.CodeIDs, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field CodeIDs", wireType) - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipQuery(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthQuery - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupQuery - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") -) diff --git a/wasm/types/query.pb.gw.go b/wasm/types/query.pb.gw.go deleted file mode 100644 index 5d555f61..00000000 --- a/wasm/types/query.pb.gw.go +++ /dev/null @@ -1,1030 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: cosmwasm/wasm/v1/query.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage - -func request_Query_ContractInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryContractInfoRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - msg, err := client.ContractInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_ContractInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryContractInfoRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - msg, err := server.ContractInfo(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_ContractHistory_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_ContractHistory_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryContractHistoryRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ContractHistory_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ContractHistory(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_ContractHistory_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryContractHistoryRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ContractHistory_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ContractHistory(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_ContractsByCode_0 = &utilities.DoubleArray{Encoding: map[string]int{"code_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_ContractsByCode_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryContractsByCodeRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["code_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "code_id") - } - - protoReq.CodeId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "code_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ContractsByCode_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ContractsByCode(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_ContractsByCode_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryContractsByCodeRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["code_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "code_id") - } - - protoReq.CodeId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "code_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ContractsByCode_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ContractsByCode(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_AllContractState_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_AllContractState_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllContractStateRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AllContractState_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AllContractState(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_AllContractState_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllContractStateRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AllContractState_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AllContractState(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_RawContractState_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRawContractStateRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - val, ok = pathParams["query_data"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "query_data") - } - - protoReq.QueryData, err = runtime.Bytes(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "query_data", err) - } - - msg, err := client.RawContractState(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_RawContractState_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRawContractStateRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - val, ok = pathParams["query_data"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "query_data") - } - - protoReq.QueryData, err = runtime.Bytes(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "query_data", err) - } - - msg, err := server.RawContractState(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_SmartContractState_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySmartContractStateRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - val, ok = pathParams["query_data"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "query_data") - } - - protoReq.QueryData, err = runtime.Bytes(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "query_data", err) - } - - msg, err := client.SmartContractState(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_SmartContractState_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySmartContractStateRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - val, ok = pathParams["query_data"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "query_data") - } - - protoReq.QueryData, err = runtime.Bytes(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "query_data", err) - } - - msg, err := server.SmartContractState(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Code_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryCodeRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["code_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "code_id") - } - - protoReq.CodeId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "code_id", err) - } - - msg, err := client.Code(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Code_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryCodeRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["code_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "code_id") - } - - protoReq.CodeId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "code_id", err) - } - - msg, err := server.Code(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_Codes_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Codes_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryCodesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Codes_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Codes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Codes_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryCodesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Codes_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Codes(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_PinnedCodes_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_PinnedCodes_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryPinnedCodesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_PinnedCodes_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.PinnedCodes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_PinnedCodes_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryPinnedCodesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_PinnedCodes_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.PinnedCodes(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_ContractInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_ContractInfo_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ContractInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ContractHistory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_ContractHistory_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ContractHistory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ContractsByCode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_ContractsByCode_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ContractsByCode_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AllContractState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_AllContractState_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AllContractState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_RawContractState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_RawContractState_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_RawContractState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_SmartContractState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_SmartContractState_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_SmartContractState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Code_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Code_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Code_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Codes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Codes_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Codes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_PinnedCodes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_PinnedCodes_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_PinnedCodes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_ContractInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_ContractInfo_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ContractInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ContractHistory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_ContractHistory_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ContractHistory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ContractsByCode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_ContractsByCode_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ContractsByCode_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AllContractState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_AllContractState_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AllContractState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_RawContractState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_RawContractState_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_RawContractState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_SmartContractState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_SmartContractState_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_SmartContractState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Code_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Code_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Code_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Codes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Codes_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Codes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_PinnedCodes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_PinnedCodes_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_PinnedCodes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_ContractInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmwasm", "wasm", "v1", "contract", "address"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_ContractHistory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmwasm", "wasm", "v1", "contract", "address", "history"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_ContractsByCode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmwasm", "wasm", "v1", "code", "code_id", "contracts"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_AllContractState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmwasm", "wasm", "v1", "contract", "address", "state"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_RawContractState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"wasm", "v1", "contract", "address", "raw", "query_data"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_SmartContractState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"wasm", "v1", "contract", "address", "smart", "query_data"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_Code_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmwasm", "wasm", "v1", "code", "code_id"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_Codes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmwasm", "wasm", "v1", "code"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_PinnedCodes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmwasm", "wasm", "v1", "codes", "pinned"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_Query_ContractInfo_0 = runtime.ForwardResponseMessage - - forward_Query_ContractHistory_0 = runtime.ForwardResponseMessage - - forward_Query_ContractsByCode_0 = runtime.ForwardResponseMessage - - forward_Query_AllContractState_0 = runtime.ForwardResponseMessage - - forward_Query_RawContractState_0 = runtime.ForwardResponseMessage - - forward_Query_SmartContractState_0 = runtime.ForwardResponseMessage - - forward_Query_Code_0 = runtime.ForwardResponseMessage - - forward_Query_Codes_0 = runtime.ForwardResponseMessage - - forward_Query_PinnedCodes_0 = runtime.ForwardResponseMessage -) diff --git a/wasm/types/tx.go b/wasm/types/tx.go deleted file mode 100644 index 3461bd4d..00000000 --- a/wasm/types/tx.go +++ /dev/null @@ -1,319 +0,0 @@ -package types - -import ( - "encoding/json" - "errors" - "strings" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -// RawContractMessage defines a json message that is sent or returned by a wasm contract. -// This type can hold any type of bytes. Until validateBasic is called there should not be -// any assumptions made that the data is valid syntax or semantic. -type RawContractMessage []byte - -func (r RawContractMessage) MarshalJSON() ([]byte, error) { - return json.RawMessage(r).MarshalJSON() -} - -func (r *RawContractMessage) UnmarshalJSON(b []byte) error { - if r == nil { - return errors.New("unmarshalJSON on nil pointer") - } - *r = append((*r)[0:0], b...) - return nil -} - -func (r *RawContractMessage) ValidateBasic() error { - if r == nil { - return ErrEmpty - } - if !json.Valid(*r) { - return ErrInvalid - } - return nil -} - -// Bytes returns raw bytes type -func (r RawContractMessage) Bytes() []byte { - return r -} - -func (msg MsgStoreCode) Route() string { - return RouterKey -} - -func (msg MsgStoreCode) Type() string { - return "store-code" -} - -func (msg MsgStoreCode) ValidateBasic() error { - if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { - return err - } - - if err := validateWasmCode(msg.WASMByteCode); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "code bytes %s", err.Error()) - } - - if msg.InstantiatePermission != nil { - if err := msg.InstantiatePermission.ValidateBasic(); err != nil { - return sdkerrors.Wrap(err, "instantiate permission") - } - } - return nil -} - -func (msg MsgStoreCode) GetSignBytes() []byte { - return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) - -} - -func (msg MsgStoreCode) GetSigners() []sdk.AccAddress { - senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) - if err != nil { // should never happen as valid basic rejects invalid addresses - panic(err.Error()) - } - return []sdk.AccAddress{senderAddr} -} - -func (msg MsgInstantiateContract) Route() string { - return RouterKey -} - -func (msg MsgInstantiateContract) Type() string { - return "instantiate" -} - -func (msg MsgInstantiateContract) ValidateBasic() error { - if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { - return sdkerrors.Wrap(err, "sender") - } - - if msg.CodeID == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "code id is required") - } - - if err := validateLabel(msg.Label); err != nil { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "label is required") - - } - - if !msg.Funds.IsValid() { - return sdkerrors.ErrInvalidCoins - } - - if len(msg.Admin) != 0 { - if _, err := sdk.AccAddressFromBech32(msg.Admin); err != nil { - return sdkerrors.Wrap(err, "admin") - } - } - if err := msg.Msg.ValidateBasic(); err != nil { - return sdkerrors.Wrap(err, "payload msg") - } - return nil -} - -func (msg MsgInstantiateContract) GetSignBytes() []byte { - return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) - -} - -func (msg MsgInstantiateContract) GetSigners() []sdk.AccAddress { - senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) - if err != nil { // should never happen as valid basic rejects invalid addresses - panic(err.Error()) - } - return []sdk.AccAddress{senderAddr} -} - -func (msg MsgExecuteContract) Route() string { - return RouterKey -} - -func (msg MsgExecuteContract) Type() string { - return "execute" -} - -func (msg MsgExecuteContract) ValidateBasic() error { - if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { - return sdkerrors.Wrap(err, "sender") - } - if _, err := sdk.AccAddressFromBech32(msg.Contract); err != nil { - return sdkerrors.Wrap(err, "contract") - } - - if !msg.Funds.IsValid() { - return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, "sentFunds") - } - if err := msg.Msg.ValidateBasic(); err != nil { - return sdkerrors.Wrap(err, "payload msg") - } - return nil -} - -func (msg MsgExecuteContract) GetSignBytes() []byte { - return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) - -} - -func (msg MsgExecuteContract) GetSigners() []sdk.AccAddress { - senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) - if err != nil { // should never happen as valid basic rejects invalid addresses - panic(err.Error()) - } - return []sdk.AccAddress{senderAddr} - -} - -func (msg MsgMigrateContract) Route() string { - return RouterKey -} - -func (msg MsgMigrateContract) Type() string { - return "migrate" -} - -func (msg MsgMigrateContract) ValidateBasic() error { - if msg.CodeID == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "code id is required") - } - if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { - return sdkerrors.Wrap(err, "sender") - } - if _, err := sdk.AccAddressFromBech32(msg.Contract); err != nil { - return sdkerrors.Wrap(err, "contract") - } - - if err := msg.Msg.ValidateBasic(); err != nil { - return sdkerrors.Wrap(err, "payload msg") - } - - return nil -} - -func (msg MsgMigrateContract) GetSignBytes() []byte { - return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) - -} - -func (msg MsgMigrateContract) GetSigners() []sdk.AccAddress { - senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) - if err != nil { // should never happen as valid basic rejects invalid addresses - panic(err.Error()) - } - return []sdk.AccAddress{senderAddr} - -} - -func (msg MsgUpdateAdmin) Route() string { - return RouterKey -} - -func (msg MsgUpdateAdmin) Type() string { - return "update-contract-admin" -} - -func (msg MsgUpdateAdmin) ValidateBasic() error { - if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { - return sdkerrors.Wrap(err, "sender") - } - if _, err := sdk.AccAddressFromBech32(msg.Contract); err != nil { - return sdkerrors.Wrap(err, "contract") - } - if _, err := sdk.AccAddressFromBech32(msg.NewAdmin); err != nil { - return sdkerrors.Wrap(err, "new admin") - } - if strings.EqualFold(msg.Sender, msg.NewAdmin) { - return sdkerrors.Wrap(ErrInvalidMsg, "new admin is the same as the old") - } - return nil -} - -func (msg MsgUpdateAdmin) GetSignBytes() []byte { - return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) - -} - -func (msg MsgUpdateAdmin) GetSigners() []sdk.AccAddress { - senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) - if err != nil { // should never happen as valid basic rejects invalid addresses - panic(err.Error()) - } - return []sdk.AccAddress{senderAddr} - -} - -func (msg MsgClearAdmin) Route() string { - return RouterKey -} - -func (msg MsgClearAdmin) Type() string { - return "clear-contract-admin" -} - -func (msg MsgClearAdmin) ValidateBasic() error { - if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { - return sdkerrors.Wrap(err, "sender") - } - if _, err := sdk.AccAddressFromBech32(msg.Contract); err != nil { - return sdkerrors.Wrap(err, "contract") - } - return nil -} - -func (msg MsgClearAdmin) GetSignBytes() []byte { - return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) - -} - -func (msg MsgClearAdmin) GetSigners() []sdk.AccAddress { - senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) - if err != nil { // should never happen as valid basic rejects invalid addresses - panic(err.Error()) - } - return []sdk.AccAddress{senderAddr} - -} - -func (msg MsgIBCSend) Route() string { - return RouterKey -} - -func (msg MsgIBCSend) Type() string { - return "wasm-ibc-send" -} - -func (msg MsgIBCSend) ValidateBasic() error { - return nil -} - -func (msg MsgIBCSend) GetSignBytes() []byte { - return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) -} - -func (msg MsgIBCSend) GetSigners() []sdk.AccAddress { - return nil -} - -func (msg MsgIBCCloseChannel) Route() string { - return RouterKey -} - -func (msg MsgIBCCloseChannel) Type() string { - return "wasm-ibc-close" -} - -func (msg MsgIBCCloseChannel) ValidateBasic() error { - return nil -} - -func (msg MsgIBCCloseChannel) GetSignBytes() []byte { - return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) -} - -func (msg MsgIBCCloseChannel) GetSigners() []sdk.AccAddress { - return nil -} diff --git a/wasm/types/tx.pb.go b/wasm/types/tx.pb.go deleted file mode 100644 index dd82a4ae..00000000 --- a/wasm/types/tx.pb.go +++ /dev/null @@ -1,3117 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmwasm/wasm/v1/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// MsgStoreCode submit Wasm code to the system -type MsgStoreCode struct { - // Sender is the that actor that signed the messages - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - // WASMByteCode can be raw or gzip compressed - WASMByteCode []byte `protobuf:"bytes,2,opt,name=wasm_byte_code,json=wasmByteCode,proto3" json:"wasm_byte_code,omitempty"` - // InstantiatePermission access control to apply on contract creation, - // optional - InstantiatePermission *AccessConfig `protobuf:"bytes,5,opt,name=instantiate_permission,json=instantiatePermission,proto3" json:"instantiate_permission,omitempty"` -} - -func (m *MsgStoreCode) Reset() { *m = MsgStoreCode{} } -func (m *MsgStoreCode) String() string { return proto.CompactTextString(m) } -func (*MsgStoreCode) ProtoMessage() {} -func (*MsgStoreCode) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{0} -} -func (m *MsgStoreCode) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgStoreCode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgStoreCode.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgStoreCode) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgStoreCode.Merge(m, src) -} -func (m *MsgStoreCode) XXX_Size() int { - return m.Size() -} -func (m *MsgStoreCode) XXX_DiscardUnknown() { - xxx_messageInfo_MsgStoreCode.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgStoreCode proto.InternalMessageInfo - -// MsgStoreCodeResponse returns store result data. -type MsgStoreCodeResponse struct { - // CodeID is the reference to the stored WASM code - CodeID uint64 `protobuf:"varint,1,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` -} - -func (m *MsgStoreCodeResponse) Reset() { *m = MsgStoreCodeResponse{} } -func (m *MsgStoreCodeResponse) String() string { return proto.CompactTextString(m) } -func (*MsgStoreCodeResponse) ProtoMessage() {} -func (*MsgStoreCodeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{1} -} -func (m *MsgStoreCodeResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgStoreCodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgStoreCodeResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgStoreCodeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgStoreCodeResponse.Merge(m, src) -} -func (m *MsgStoreCodeResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgStoreCodeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgStoreCodeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgStoreCodeResponse proto.InternalMessageInfo - -// MsgInstantiateContract create a new smart contract instance for the given -// code id. -type MsgInstantiateContract struct { - // Sender is the that actor that signed the messages - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - // Admin is an optional address that can execute migrations - Admin string `protobuf:"bytes,2,opt,name=admin,proto3" json:"admin,omitempty"` - // CodeID is the reference to the stored WASM code - CodeID uint64 `protobuf:"varint,3,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` - // Label is optional metadata to be stored with a contract instance. - Label string `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"` - // Msg json encoded message to be passed to the contract on instantiation - Msg RawContractMessage `protobuf:"bytes,5,opt,name=msg,proto3,casttype=RawContractMessage" json:"msg,omitempty"` - // Funds coins that are transferred to the contract on instantiation - Funds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,6,rep,name=funds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"funds"` -} - -func (m *MsgInstantiateContract) Reset() { *m = MsgInstantiateContract{} } -func (m *MsgInstantiateContract) String() string { return proto.CompactTextString(m) } -func (*MsgInstantiateContract) ProtoMessage() {} -func (*MsgInstantiateContract) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{2} -} -func (m *MsgInstantiateContract) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgInstantiateContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgInstantiateContract.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgInstantiateContract) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgInstantiateContract.Merge(m, src) -} -func (m *MsgInstantiateContract) XXX_Size() int { - return m.Size() -} -func (m *MsgInstantiateContract) XXX_DiscardUnknown() { - xxx_messageInfo_MsgInstantiateContract.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgInstantiateContract proto.InternalMessageInfo - -// MsgInstantiateContractResponse return instantiation result data -type MsgInstantiateContractResponse struct { - // Address is the bech32 address of the new contract instance. - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // Data contains base64-encoded bytes to returned from the contract - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` -} - -func (m *MsgInstantiateContractResponse) Reset() { *m = MsgInstantiateContractResponse{} } -func (m *MsgInstantiateContractResponse) String() string { return proto.CompactTextString(m) } -func (*MsgInstantiateContractResponse) ProtoMessage() {} -func (*MsgInstantiateContractResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{3} -} -func (m *MsgInstantiateContractResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgInstantiateContractResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgInstantiateContractResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgInstantiateContractResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgInstantiateContractResponse.Merge(m, src) -} -func (m *MsgInstantiateContractResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgInstantiateContractResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgInstantiateContractResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgInstantiateContractResponse proto.InternalMessageInfo - -// MsgExecuteContract submits the given message data to a smart contract -type MsgExecuteContract struct { - // Sender is the that actor that signed the messages - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - // Contract is the address of the smart contract - Contract string `protobuf:"bytes,2,opt,name=contract,proto3" json:"contract,omitempty"` - // Msg json encoded message to be passed to the contract - Msg RawContractMessage `protobuf:"bytes,3,opt,name=msg,proto3,casttype=RawContractMessage" json:"msg,omitempty"` - // Funds coins that are transferred to the contract on execution - Funds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,5,rep,name=funds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"funds"` -} - -func (m *MsgExecuteContract) Reset() { *m = MsgExecuteContract{} } -func (m *MsgExecuteContract) String() string { return proto.CompactTextString(m) } -func (*MsgExecuteContract) ProtoMessage() {} -func (*MsgExecuteContract) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{4} -} -func (m *MsgExecuteContract) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgExecuteContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgExecuteContract.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgExecuteContract) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgExecuteContract.Merge(m, src) -} -func (m *MsgExecuteContract) XXX_Size() int { - return m.Size() -} -func (m *MsgExecuteContract) XXX_DiscardUnknown() { - xxx_messageInfo_MsgExecuteContract.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgExecuteContract proto.InternalMessageInfo - -// MsgExecuteContractResponse returns execution result data. -type MsgExecuteContractResponse struct { - // Data contains base64-encoded bytes to returned from the contract - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` -} - -func (m *MsgExecuteContractResponse) Reset() { *m = MsgExecuteContractResponse{} } -func (m *MsgExecuteContractResponse) String() string { return proto.CompactTextString(m) } -func (*MsgExecuteContractResponse) ProtoMessage() {} -func (*MsgExecuteContractResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{5} -} -func (m *MsgExecuteContractResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgExecuteContractResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgExecuteContractResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgExecuteContractResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgExecuteContractResponse.Merge(m, src) -} -func (m *MsgExecuteContractResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgExecuteContractResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgExecuteContractResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgExecuteContractResponse proto.InternalMessageInfo - -// MsgMigrateContract runs a code upgrade/ downgrade for a smart contract -type MsgMigrateContract struct { - // Sender is the that actor that signed the messages - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - // Contract is the address of the smart contract - Contract string `protobuf:"bytes,2,opt,name=contract,proto3" json:"contract,omitempty"` - // CodeID references the new WASM code - CodeID uint64 `protobuf:"varint,3,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` - // Msg json encoded message to be passed to the contract on migration - Msg RawContractMessage `protobuf:"bytes,4,opt,name=msg,proto3,casttype=RawContractMessage" json:"msg,omitempty"` -} - -func (m *MsgMigrateContract) Reset() { *m = MsgMigrateContract{} } -func (m *MsgMigrateContract) String() string { return proto.CompactTextString(m) } -func (*MsgMigrateContract) ProtoMessage() {} -func (*MsgMigrateContract) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{6} -} -func (m *MsgMigrateContract) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgMigrateContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgMigrateContract.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgMigrateContract) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgMigrateContract.Merge(m, src) -} -func (m *MsgMigrateContract) XXX_Size() int { - return m.Size() -} -func (m *MsgMigrateContract) XXX_DiscardUnknown() { - xxx_messageInfo_MsgMigrateContract.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgMigrateContract proto.InternalMessageInfo - -// MsgMigrateContractResponse returns contract migration result data. -type MsgMigrateContractResponse struct { - // Data contains same raw bytes returned as data from the wasm contract. - // (May be empty) - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` -} - -func (m *MsgMigrateContractResponse) Reset() { *m = MsgMigrateContractResponse{} } -func (m *MsgMigrateContractResponse) String() string { return proto.CompactTextString(m) } -func (*MsgMigrateContractResponse) ProtoMessage() {} -func (*MsgMigrateContractResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{7} -} -func (m *MsgMigrateContractResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgMigrateContractResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgMigrateContractResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgMigrateContractResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgMigrateContractResponse.Merge(m, src) -} -func (m *MsgMigrateContractResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgMigrateContractResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgMigrateContractResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgMigrateContractResponse proto.InternalMessageInfo - -// MsgUpdateAdmin sets a new admin for a smart contract -type MsgUpdateAdmin struct { - // Sender is the that actor that signed the messages - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - // NewAdmin address to be set - NewAdmin string `protobuf:"bytes,2,opt,name=new_admin,json=newAdmin,proto3" json:"new_admin,omitempty"` - // Contract is the address of the smart contract - Contract string `protobuf:"bytes,3,opt,name=contract,proto3" json:"contract,omitempty"` -} - -func (m *MsgUpdateAdmin) Reset() { *m = MsgUpdateAdmin{} } -func (m *MsgUpdateAdmin) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateAdmin) ProtoMessage() {} -func (*MsgUpdateAdmin) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{8} -} -func (m *MsgUpdateAdmin) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateAdmin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateAdmin.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgUpdateAdmin) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateAdmin.Merge(m, src) -} -func (m *MsgUpdateAdmin) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateAdmin) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateAdmin.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateAdmin proto.InternalMessageInfo - -// MsgUpdateAdminResponse returns empty data -type MsgUpdateAdminResponse struct { -} - -func (m *MsgUpdateAdminResponse) Reset() { *m = MsgUpdateAdminResponse{} } -func (m *MsgUpdateAdminResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateAdminResponse) ProtoMessage() {} -func (*MsgUpdateAdminResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{9} -} -func (m *MsgUpdateAdminResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateAdminResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateAdminResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgUpdateAdminResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateAdminResponse.Merge(m, src) -} -func (m *MsgUpdateAdminResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateAdminResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateAdminResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateAdminResponse proto.InternalMessageInfo - -// MsgClearAdmin removes any admin stored for a smart contract -type MsgClearAdmin struct { - // Sender is the that actor that signed the messages - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - // Contract is the address of the smart contract - Contract string `protobuf:"bytes,3,opt,name=contract,proto3" json:"contract,omitempty"` -} - -func (m *MsgClearAdmin) Reset() { *m = MsgClearAdmin{} } -func (m *MsgClearAdmin) String() string { return proto.CompactTextString(m) } -func (*MsgClearAdmin) ProtoMessage() {} -func (*MsgClearAdmin) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{10} -} -func (m *MsgClearAdmin) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgClearAdmin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgClearAdmin.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgClearAdmin) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgClearAdmin.Merge(m, src) -} -func (m *MsgClearAdmin) XXX_Size() int { - return m.Size() -} -func (m *MsgClearAdmin) XXX_DiscardUnknown() { - xxx_messageInfo_MsgClearAdmin.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgClearAdmin proto.InternalMessageInfo - -// MsgClearAdminResponse returns empty data -type MsgClearAdminResponse struct { -} - -func (m *MsgClearAdminResponse) Reset() { *m = MsgClearAdminResponse{} } -func (m *MsgClearAdminResponse) String() string { return proto.CompactTextString(m) } -func (*MsgClearAdminResponse) ProtoMessage() {} -func (*MsgClearAdminResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{11} -} -func (m *MsgClearAdminResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgClearAdminResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgClearAdminResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgClearAdminResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgClearAdminResponse.Merge(m, src) -} -func (m *MsgClearAdminResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgClearAdminResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgClearAdminResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgClearAdminResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgStoreCode)(nil), "cosmwasm.wasm.v1.MsgStoreCode") - proto.RegisterType((*MsgStoreCodeResponse)(nil), "cosmwasm.wasm.v1.MsgStoreCodeResponse") - proto.RegisterType((*MsgInstantiateContract)(nil), "cosmwasm.wasm.v1.MsgInstantiateContract") - proto.RegisterType((*MsgInstantiateContractResponse)(nil), "cosmwasm.wasm.v1.MsgInstantiateContractResponse") - proto.RegisterType((*MsgExecuteContract)(nil), "cosmwasm.wasm.v1.MsgExecuteContract") - proto.RegisterType((*MsgExecuteContractResponse)(nil), "cosmwasm.wasm.v1.MsgExecuteContractResponse") - proto.RegisterType((*MsgMigrateContract)(nil), "cosmwasm.wasm.v1.MsgMigrateContract") - proto.RegisterType((*MsgMigrateContractResponse)(nil), "cosmwasm.wasm.v1.MsgMigrateContractResponse") - proto.RegisterType((*MsgUpdateAdmin)(nil), "cosmwasm.wasm.v1.MsgUpdateAdmin") - proto.RegisterType((*MsgUpdateAdminResponse)(nil), "cosmwasm.wasm.v1.MsgUpdateAdminResponse") - proto.RegisterType((*MsgClearAdmin)(nil), "cosmwasm.wasm.v1.MsgClearAdmin") - proto.RegisterType((*MsgClearAdminResponse)(nil), "cosmwasm.wasm.v1.MsgClearAdminResponse") -} - -func init() { proto.RegisterFile("cosmwasm/wasm/v1/tx.proto", fileDescriptor_4f74d82755520264) } - -var fileDescriptor_4f74d82755520264 = []byte{ - // 759 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcd, 0x6e, 0xd3, 0x4a, - 0x14, 0x8e, 0x1b, 0x27, 0x4d, 0x4e, 0x73, 0x7b, 0x23, 0xdf, 0x36, 0x37, 0xf5, 0xbd, 0x72, 0xa2, - 0x80, 0x8a, 0x17, 0x60, 0x37, 0x45, 0x62, 0xc3, 0xaa, 0x49, 0x59, 0xb4, 0x92, 0x11, 0x72, 0x55, - 0x2a, 0xd8, 0x44, 0x13, 0x7b, 0x6a, 0x2c, 0x1a, 0x4f, 0xf0, 0x71, 0x9b, 0xf6, 0x25, 0x10, 0x3b, - 0xde, 0x81, 0xb7, 0x60, 0xd7, 0x15, 0xea, 0x06, 0x89, 0x55, 0x80, 0xf4, 0x2d, 0x58, 0x21, 0xff, - 0xa5, 0x6e, 0xea, 0xa4, 0x41, 0x88, 0x4d, 0x32, 0xc7, 0xf3, 0x7d, 0xe7, 0xcc, 0xf9, 0xf4, 0xcd, - 0x19, 0x58, 0x33, 0x18, 0xf6, 0x06, 0x04, 0x7b, 0x6a, 0xf0, 0x73, 0xd2, 0x54, 0xbd, 0x53, 0xa5, - 0xef, 0x32, 0x8f, 0x09, 0xe5, 0x78, 0x4b, 0x09, 0x7e, 0x4e, 0x9a, 0xa2, 0xe4, 0x7f, 0x61, 0xa8, - 0x76, 0x09, 0x52, 0xf5, 0xa4, 0xd9, 0xa5, 0x1e, 0x69, 0xaa, 0x06, 0xb3, 0x9d, 0x90, 0x21, 0xae, - 0x58, 0xcc, 0x62, 0xc1, 0x52, 0xf5, 0x57, 0xd1, 0xd7, 0xff, 0x6f, 0x96, 0x38, 0xeb, 0x53, 0x0c, - 0x77, 0x1b, 0x1f, 0x39, 0x28, 0x69, 0x68, 0xed, 0x79, 0xcc, 0xa5, 0x6d, 0x66, 0x52, 0xa1, 0x02, - 0x79, 0xa4, 0x8e, 0x49, 0xdd, 0x2a, 0x57, 0xe7, 0xe4, 0xa2, 0x1e, 0x45, 0xc2, 0x23, 0x58, 0xf6, - 0xf9, 0x9d, 0xee, 0x99, 0x47, 0x3b, 0x06, 0x33, 0x69, 0x75, 0xa1, 0xce, 0xc9, 0xa5, 0x56, 0x79, - 0x34, 0xac, 0x95, 0x0e, 0xb6, 0xf6, 0xb4, 0xd6, 0x99, 0x17, 0x64, 0xd0, 0x4b, 0x3e, 0x2e, 0x8e, - 0x84, 0x7d, 0xa8, 0xd8, 0x0e, 0x7a, 0xc4, 0xf1, 0x6c, 0xe2, 0xd1, 0x4e, 0x9f, 0xba, 0x3d, 0x1b, - 0xd1, 0x66, 0x4e, 0x35, 0x57, 0xe7, 0xe4, 0xa5, 0x4d, 0x49, 0x99, 0xec, 0x53, 0xd9, 0x32, 0x0c, - 0x8a, 0xd8, 0x66, 0xce, 0xa1, 0x6d, 0xe9, 0xab, 0x09, 0xf6, 0xb3, 0x31, 0x79, 0x97, 0x2f, 0x64, - 0xcb, 0xfc, 0x2e, 0x5f, 0xe0, 0xcb, 0xb9, 0xc6, 0x63, 0x58, 0x49, 0xb6, 0xa0, 0x53, 0xec, 0x33, - 0x07, 0xa9, 0x70, 0x07, 0x16, 0xfd, 0x83, 0x76, 0x6c, 0x33, 0xe8, 0x85, 0x6f, 0xc1, 0x68, 0x58, - 0xcb, 0xfb, 0x90, 0x9d, 0x6d, 0x3d, 0xef, 0x6f, 0xed, 0x98, 0x8d, 0xb7, 0x0b, 0x50, 0xd1, 0xd0, - 0xda, 0xb9, 0xaa, 0xd2, 0x66, 0x8e, 0xe7, 0x12, 0xc3, 0x9b, 0x2a, 0xc5, 0x0a, 0xe4, 0x88, 0xd9, - 0xb3, 0x9d, 0x40, 0x81, 0xa2, 0x1e, 0x06, 0xc9, 0x6a, 0xd9, 0x69, 0xd5, 0x7c, 0xea, 0x11, 0xe9, - 0xd2, 0xa3, 0x2a, 0x1f, 0x52, 0x83, 0x40, 0x90, 0x21, 0xdb, 0x43, 0x2b, 0x10, 0xa4, 0xd4, 0xaa, - 0xfc, 0x18, 0xd6, 0x04, 0x9d, 0x0c, 0xe2, 0x63, 0x68, 0x14, 0x91, 0x58, 0x54, 0xf7, 0x21, 0x02, - 0x81, 0xdc, 0xe1, 0xb1, 0x63, 0x62, 0x35, 0x5f, 0xcf, 0xca, 0x4b, 0x9b, 0x6b, 0x4a, 0x68, 0x09, - 0xc5, 0xb7, 0x84, 0x12, 0x59, 0x42, 0x69, 0x33, 0xdb, 0x69, 0x6d, 0x9c, 0x0f, 0x6b, 0x99, 0x0f, - 0x5f, 0x6b, 0xb2, 0x65, 0x7b, 0xaf, 0x8e, 0xbb, 0x8a, 0xc1, 0x7a, 0x6a, 0xe4, 0x9f, 0xf0, 0xef, - 0x01, 0x9a, 0xaf, 0x23, 0x2b, 0xf8, 0x04, 0xd4, 0xc3, 0xcc, 0x8d, 0xa7, 0x20, 0xa5, 0xeb, 0x31, - 0xd6, 0xb5, 0x0a, 0x8b, 0xc4, 0x34, 0x5d, 0x8a, 0x18, 0x09, 0x13, 0x87, 0x82, 0x00, 0xbc, 0x49, - 0x3c, 0x12, 0x5a, 0x43, 0x0f, 0xd6, 0x8d, 0xcf, 0x1c, 0x08, 0x1a, 0x5a, 0x4f, 0x4e, 0xa9, 0x71, - 0x3c, 0x87, 0xb8, 0x22, 0x14, 0x8c, 0x08, 0x13, 0xe9, 0x3b, 0x8e, 0x63, 0x9d, 0xb2, 0xbf, 0xa0, - 0x53, 0xee, 0x8f, 0xe9, 0xb4, 0x01, 0xe2, 0xcd, 0xb6, 0xc6, 0x1a, 0xc5, 0x4a, 0x70, 0x09, 0x25, - 0xde, 0x87, 0x4a, 0x68, 0xb6, 0xe5, 0x92, 0xdf, 0x54, 0x62, 0x2e, 0xb3, 0x45, 0x72, 0xf1, 0xb7, - 0xca, 0x15, 0xf5, 0x32, 0x71, 0xb0, 0x99, 0xbd, 0x10, 0x58, 0xd6, 0xd0, 0xda, 0xef, 0x9b, 0xc4, - 0xa3, 0x5b, 0x81, 0xff, 0xa7, 0xb5, 0xf1, 0x1f, 0x14, 0x1d, 0x3a, 0xe8, 0x24, 0x6f, 0x4c, 0xc1, - 0xa1, 0x83, 0x90, 0x94, 0xec, 0x31, 0x7b, 0xbd, 0xc7, 0x46, 0x35, 0xb8, 0x98, 0x89, 0x12, 0xf1, - 0x81, 0x1a, 0x6d, 0xf8, 0x4b, 0x43, 0xab, 0x7d, 0x44, 0x89, 0x3b, 0xbb, 0xf6, 0xac, 0xf4, 0xff, - 0xc2, 0xea, 0xb5, 0x24, 0x71, 0xf6, 0xcd, 0x4f, 0x3c, 0x64, 0x35, 0xb4, 0x84, 0x3d, 0x28, 0x5e, - 0x8d, 0xc5, 0x94, 0x31, 0x95, 0x9c, 0x39, 0xe2, 0xfa, 0xec, 0xfd, 0xb1, 0x96, 0x6f, 0xe0, 0x9f, - 0xb4, 0x51, 0x23, 0xa7, 0xd2, 0x53, 0x90, 0xe2, 0xc6, 0xbc, 0xc8, 0x71, 0x49, 0x0a, 0x7f, 0x4f, - 0x5e, 0xbe, 0xbb, 0xa9, 0x49, 0x26, 0x50, 0xe2, 0xfd, 0x79, 0x50, 0xc9, 0x32, 0x93, 0xce, 0x4e, - 0x2f, 0x33, 0x81, 0x9a, 0x52, 0x66, 0x9a, 0x19, 0x5f, 0xc0, 0x52, 0xd2, 0x75, 0xf5, 0x54, 0x72, - 0x02, 0x21, 0xca, 0xb7, 0x21, 0xc6, 0xa9, 0x9f, 0x03, 0x24, 0x3c, 0x55, 0x4b, 0xe5, 0x5d, 0x01, - 0xc4, 0x7b, 0xb7, 0x00, 0xe2, 0xbc, 0xad, 0xed, 0xf3, 0xef, 0x52, 0xe6, 0x7c, 0x24, 0x71, 0x17, - 0x23, 0x89, 0xfb, 0x36, 0x92, 0xb8, 0x77, 0x97, 0x52, 0xe6, 0xe2, 0x52, 0xca, 0x7c, 0xb9, 0x94, - 0x32, 0x2f, 0xd7, 0x13, 0x83, 0xa7, 0xcd, 0xb0, 0x77, 0x10, 0x3f, 0xd5, 0xa6, 0x7a, 0x1a, 0x3e, - 0xd9, 0xc1, 0xf0, 0xe9, 0xe6, 0x83, 0x07, 0xfb, 0xe1, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x56, - 0xd2, 0x4b, 0x17, 0x33, 0x08, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - // StoreCode to submit Wasm code to the system - StoreCode(ctx context.Context, in *MsgStoreCode, opts ...grpc.CallOption) (*MsgStoreCodeResponse, error) - // Instantiate creates a new smart contract instance for the given code id. - InstantiateContract(ctx context.Context, in *MsgInstantiateContract, opts ...grpc.CallOption) (*MsgInstantiateContractResponse, error) - // Execute submits the given message data to a smart contract - ExecuteContract(ctx context.Context, in *MsgExecuteContract, opts ...grpc.CallOption) (*MsgExecuteContractResponse, error) - // Migrate runs a code upgrade/ downgrade for a smart contract - MigrateContract(ctx context.Context, in *MsgMigrateContract, opts ...grpc.CallOption) (*MsgMigrateContractResponse, error) - // UpdateAdmin sets a new admin for a smart contract - UpdateAdmin(ctx context.Context, in *MsgUpdateAdmin, opts ...grpc.CallOption) (*MsgUpdateAdminResponse, error) - // ClearAdmin removes any admin stored for a smart contract - ClearAdmin(ctx context.Context, in *MsgClearAdmin, opts ...grpc.CallOption) (*MsgClearAdminResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) StoreCode(ctx context.Context, in *MsgStoreCode, opts ...grpc.CallOption) (*MsgStoreCodeResponse, error) { - out := new(MsgStoreCodeResponse) - err := c.cc.Invoke(ctx, "/cosmwasm.wasm.v1.Msg/StoreCode", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) InstantiateContract(ctx context.Context, in *MsgInstantiateContract, opts ...grpc.CallOption) (*MsgInstantiateContractResponse, error) { - out := new(MsgInstantiateContractResponse) - err := c.cc.Invoke(ctx, "/cosmwasm.wasm.v1.Msg/InstantiateContract", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) ExecuteContract(ctx context.Context, in *MsgExecuteContract, opts ...grpc.CallOption) (*MsgExecuteContractResponse, error) { - out := new(MsgExecuteContractResponse) - err := c.cc.Invoke(ctx, "/cosmwasm.wasm.v1.Msg/ExecuteContract", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) MigrateContract(ctx context.Context, in *MsgMigrateContract, opts ...grpc.CallOption) (*MsgMigrateContractResponse, error) { - out := new(MsgMigrateContractResponse) - err := c.cc.Invoke(ctx, "/cosmwasm.wasm.v1.Msg/MigrateContract", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UpdateAdmin(ctx context.Context, in *MsgUpdateAdmin, opts ...grpc.CallOption) (*MsgUpdateAdminResponse, error) { - out := new(MsgUpdateAdminResponse) - err := c.cc.Invoke(ctx, "/cosmwasm.wasm.v1.Msg/UpdateAdmin", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) ClearAdmin(ctx context.Context, in *MsgClearAdmin, opts ...grpc.CallOption) (*MsgClearAdminResponse, error) { - out := new(MsgClearAdminResponse) - err := c.cc.Invoke(ctx, "/cosmwasm.wasm.v1.Msg/ClearAdmin", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // StoreCode to submit Wasm code to the system - StoreCode(context.Context, *MsgStoreCode) (*MsgStoreCodeResponse, error) - // Instantiate creates a new smart contract instance for the given code id. - InstantiateContract(context.Context, *MsgInstantiateContract) (*MsgInstantiateContractResponse, error) - // Execute submits the given message data to a smart contract - ExecuteContract(context.Context, *MsgExecuteContract) (*MsgExecuteContractResponse, error) - // Migrate runs a code upgrade/ downgrade for a smart contract - MigrateContract(context.Context, *MsgMigrateContract) (*MsgMigrateContractResponse, error) - // UpdateAdmin sets a new admin for a smart contract - UpdateAdmin(context.Context, *MsgUpdateAdmin) (*MsgUpdateAdminResponse, error) - // ClearAdmin removes any admin stored for a smart contract - ClearAdmin(context.Context, *MsgClearAdmin) (*MsgClearAdminResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) StoreCode(ctx context.Context, req *MsgStoreCode) (*MsgStoreCodeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method StoreCode not implemented") -} -func (*UnimplementedMsgServer) InstantiateContract(ctx context.Context, req *MsgInstantiateContract) (*MsgInstantiateContractResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method InstantiateContract not implemented") -} -func (*UnimplementedMsgServer) ExecuteContract(ctx context.Context, req *MsgExecuteContract) (*MsgExecuteContractResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ExecuteContract not implemented") -} -func (*UnimplementedMsgServer) MigrateContract(ctx context.Context, req *MsgMigrateContract) (*MsgMigrateContractResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MigrateContract not implemented") -} -func (*UnimplementedMsgServer) UpdateAdmin(ctx context.Context, req *MsgUpdateAdmin) (*MsgUpdateAdminResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateAdmin not implemented") -} -func (*UnimplementedMsgServer) ClearAdmin(ctx context.Context, req *MsgClearAdmin) (*MsgClearAdminResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ClearAdmin not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_StoreCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgStoreCode) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).StoreCode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmwasm.wasm.v1.Msg/StoreCode", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).StoreCode(ctx, req.(*MsgStoreCode)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_InstantiateContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgInstantiateContract) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).InstantiateContract(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmwasm.wasm.v1.Msg/InstantiateContract", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).InstantiateContract(ctx, req.(*MsgInstantiateContract)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_ExecuteContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgExecuteContract) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).ExecuteContract(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmwasm.wasm.v1.Msg/ExecuteContract", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ExecuteContract(ctx, req.(*MsgExecuteContract)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_MigrateContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgMigrateContract) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).MigrateContract(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmwasm.wasm.v1.Msg/MigrateContract", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).MigrateContract(ctx, req.(*MsgMigrateContract)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UpdateAdmin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateAdmin) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateAdmin(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmwasm.wasm.v1.Msg/UpdateAdmin", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateAdmin(ctx, req.(*MsgUpdateAdmin)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_ClearAdmin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgClearAdmin) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).ClearAdmin(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmwasm.wasm.v1.Msg/ClearAdmin", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ClearAdmin(ctx, req.(*MsgClearAdmin)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmwasm.wasm.v1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "StoreCode", - Handler: _Msg_StoreCode_Handler, - }, - { - MethodName: "InstantiateContract", - Handler: _Msg_InstantiateContract_Handler, - }, - { - MethodName: "ExecuteContract", - Handler: _Msg_ExecuteContract_Handler, - }, - { - MethodName: "MigrateContract", - Handler: _Msg_MigrateContract_Handler, - }, - { - MethodName: "UpdateAdmin", - Handler: _Msg_UpdateAdmin_Handler, - }, - { - MethodName: "ClearAdmin", - Handler: _Msg_ClearAdmin_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmwasm/wasm/v1/tx.proto", -} - -func (m *MsgStoreCode) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgStoreCode) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgStoreCode) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.InstantiatePermission != nil { - { - size, err := m.InstantiatePermission.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if len(m.WASMByteCode) > 0 { - i -= len(m.WASMByteCode) - copy(dAtA[i:], m.WASMByteCode) - i = encodeVarintTx(dAtA, i, uint64(len(m.WASMByteCode))) - i-- - dAtA[i] = 0x12 - } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgStoreCodeResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgStoreCodeResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgStoreCodeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.CodeID != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.CodeID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgInstantiateContract) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgInstantiateContract) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgInstantiateContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Funds) > 0 { - for iNdEx := len(m.Funds) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Funds[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } - if len(m.Msg) > 0 { - i -= len(m.Msg) - copy(dAtA[i:], m.Msg) - i = encodeVarintTx(dAtA, i, uint64(len(m.Msg))) - i-- - dAtA[i] = 0x2a - } - if len(m.Label) > 0 { - i -= len(m.Label) - copy(dAtA[i:], m.Label) - i = encodeVarintTx(dAtA, i, uint64(len(m.Label))) - i-- - dAtA[i] = 0x22 - } - if m.CodeID != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.CodeID)) - i-- - dAtA[i] = 0x18 - } - if len(m.Admin) > 0 { - i -= len(m.Admin) - copy(dAtA[i:], m.Admin) - i = encodeVarintTx(dAtA, i, uint64(len(m.Admin))) - i-- - dAtA[i] = 0x12 - } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgInstantiateContractResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgInstantiateContractResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgInstantiateContractResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintTx(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x12 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgExecuteContract) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgExecuteContract) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgExecuteContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Funds) > 0 { - for iNdEx := len(m.Funds) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Funds[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.Msg) > 0 { - i -= len(m.Msg) - copy(dAtA[i:], m.Msg) - i = encodeVarintTx(dAtA, i, uint64(len(m.Msg))) - i-- - dAtA[i] = 0x1a - } - if len(m.Contract) > 0 { - i -= len(m.Contract) - copy(dAtA[i:], m.Contract) - i = encodeVarintTx(dAtA, i, uint64(len(m.Contract))) - i-- - dAtA[i] = 0x12 - } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgExecuteContractResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgExecuteContractResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgExecuteContractResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintTx(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgMigrateContract) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgMigrateContract) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgMigrateContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Msg) > 0 { - i -= len(m.Msg) - copy(dAtA[i:], m.Msg) - i = encodeVarintTx(dAtA, i, uint64(len(m.Msg))) - i-- - dAtA[i] = 0x22 - } - if m.CodeID != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.CodeID)) - i-- - dAtA[i] = 0x18 - } - if len(m.Contract) > 0 { - i -= len(m.Contract) - copy(dAtA[i:], m.Contract) - i = encodeVarintTx(dAtA, i, uint64(len(m.Contract))) - i-- - dAtA[i] = 0x12 - } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgMigrateContractResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgMigrateContractResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgMigrateContractResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintTx(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateAdmin) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgUpdateAdmin) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateAdmin) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Contract) > 0 { - i -= len(m.Contract) - copy(dAtA[i:], m.Contract) - i = encodeVarintTx(dAtA, i, uint64(len(m.Contract))) - i-- - dAtA[i] = 0x1a - } - if len(m.NewAdmin) > 0 { - i -= len(m.NewAdmin) - copy(dAtA[i:], m.NewAdmin) - i = encodeVarintTx(dAtA, i, uint64(len(m.NewAdmin))) - i-- - dAtA[i] = 0x12 - } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateAdminResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgUpdateAdminResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateAdminResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgClearAdmin) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgClearAdmin) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgClearAdmin) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Contract) > 0 { - i -= len(m.Contract) - copy(dAtA[i:], m.Contract) - i = encodeVarintTx(dAtA, i, uint64(len(m.Contract))) - i-- - dAtA[i] = 0x1a - } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgClearAdminResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgClearAdminResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgClearAdminResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MsgStoreCode) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.WASMByteCode) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.InstantiatePermission != nil { - l = m.InstantiatePermission.Size() - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgStoreCodeResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CodeID != 0 { - n += 1 + sovTx(uint64(m.CodeID)) - } - return n -} - -func (m *MsgInstantiateContract) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Admin) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.CodeID != 0 { - n += 1 + sovTx(uint64(m.CodeID)) - } - l = len(m.Label) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Msg) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.Funds) > 0 { - for _, e := range m.Funds { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgInstantiateContractResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgExecuteContract) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Contract) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Msg) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.Funds) > 0 { - for _, e := range m.Funds { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgExecuteContractResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Data) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgMigrateContract) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Contract) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.CodeID != 0 { - n += 1 + sovTx(uint64(m.CodeID)) - } - l = len(m.Msg) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgMigrateContractResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Data) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgUpdateAdmin) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.NewAdmin) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Contract) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgUpdateAdminResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgClearAdmin) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Contract) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgClearAdminResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgStoreCode) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgStoreCode: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgStoreCode: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Sender = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WASMByteCode", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.WASMByteCode = append(m.WASMByteCode[:0], dAtA[iNdEx:postIndex]...) - if m.WASMByteCode == nil { - m.WASMByteCode = []byte{} - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InstantiatePermission", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.InstantiatePermission == nil { - m.InstantiatePermission = &AccessConfig{} - } - if err := m.InstantiatePermission.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgStoreCodeResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgStoreCodeResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgStoreCodeResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CodeID", wireType) - } - m.CodeID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CodeID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgInstantiateContract: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgInstantiateContract: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Sender = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Admin = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CodeID", wireType) - } - m.CodeID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CodeID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Label = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Msg = append(m.Msg[:0], dAtA[iNdEx:postIndex]...) - if m.Msg == nil { - m.Msg = []byte{} - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Funds", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Funds = append(m.Funds, types.Coin{}) - if err := m.Funds[len(m.Funds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgInstantiateContractResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgInstantiateContractResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgInstantiateContractResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgExecuteContract) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgExecuteContract: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgExecuteContract: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Sender = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Contract", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Contract = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Msg = append(m.Msg[:0], dAtA[iNdEx:postIndex]...) - if m.Msg == nil { - m.Msg = []byte{} - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Funds", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Funds = append(m.Funds, types.Coin{}) - if err := m.Funds[len(m.Funds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgExecuteContractResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgExecuteContractResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgExecuteContractResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgMigrateContract) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgMigrateContract: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgMigrateContract: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Sender = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Contract", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Contract = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CodeID", wireType) - } - m.CodeID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CodeID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Msg = append(m.Msg[:0], dAtA[iNdEx:postIndex]...) - if m.Msg == nil { - m.Msg = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgMigrateContractResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgMigrateContractResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgMigrateContractResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateAdmin) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateAdmin: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateAdmin: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Sender = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NewAdmin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NewAdmin = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Contract", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Contract = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateAdminResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateAdminResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateAdminResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgClearAdmin) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgClearAdmin: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgClearAdmin: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Sender = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Contract", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Contract = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgClearAdminResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgClearAdminResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgClearAdminResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTx(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTx - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTx - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTx - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTx - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTx - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTx - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") -) diff --git a/wasm/types/types.go b/wasm/types/types.go deleted file mode 100644 index 55adab2f..00000000 --- a/wasm/types/types.go +++ /dev/null @@ -1,269 +0,0 @@ -package types - -import ( - "fmt" - "reflect" - - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/gogo/protobuf/proto" -) - -const ( - defaultMemoryCacheSize uint32 = 100 // in MiB - defaultSmartQueryGasLimit uint64 = 3_000_000 - defaultContractDebugMode = false -) - -func (m Model) ValidateBasic() error { - if len(m.Key) == 0 { - return sdkerrors.Wrap(ErrEmpty, "key") - } - return nil -} - -func (c CodeInfo) ValidateBasic() error { - if len(c.CodeHash) == 0 { - return sdkerrors.Wrap(ErrEmpty, "code hash") - } - if _, err := sdk.AccAddressFromBech32(c.Creator); err != nil { - return sdkerrors.Wrap(err, "creator") - } - if err := c.InstantiateConfig.ValidateBasic(); err != nil { - return sdkerrors.Wrap(err, "instantiate config") - } - return nil -} - -// NewCodeInfo fills a new CodeInfo struct -func NewCodeInfo(codeHash []byte, creator sdk.AccAddress, instantiatePermission AccessConfig) CodeInfo { - return CodeInfo{ - CodeHash: codeHash, - Creator: creator.String(), - InstantiateConfig: instantiatePermission, - } -} - -var AllCodeHistoryTypes = []ContractCodeHistoryOperationType{ContractCodeHistoryOperationTypeGenesis, ContractCodeHistoryOperationTypeInit, ContractCodeHistoryOperationTypeMigrate} - -// NewContractInfo creates a new instance of a given WASM contract info -func NewContractInfo(codeID uint64, creator, admin sdk.AccAddress, label string, createdAt *AbsoluteTxPosition) ContractInfo { - var adminAddr string - if !admin.Empty() { - adminAddr = admin.String() - } - return ContractInfo{ - CodeID: codeID, - Creator: creator.String(), - Admin: adminAddr, - Label: label, - Created: createdAt, - } -} - -// validatable is an optional interface that can be implemented by an ContractInfoExtension to enable validation -type validatable interface { - ValidateBasic() error -} - -// ValidateBasic does syntax checks on the data. If an extension is set and has the `ValidateBasic() error` method, then -// the method is called as well. It is recommend to implement `ValidateBasic` so that the data is verified in the setter -// but also in the genesis import process. -func (c *ContractInfo) ValidateBasic() error { - if c.CodeID == 0 { - return sdkerrors.Wrap(ErrEmpty, "code id") - } - if _, err := sdk.AccAddressFromBech32(c.Creator); err != nil { - return sdkerrors.Wrap(err, "creator") - } - if len(c.Admin) != 0 { - if _, err := sdk.AccAddressFromBech32(c.Admin); err != nil { - return sdkerrors.Wrap(err, "admin") - } - } - if err := validateLabel(c.Label); err != nil { - return sdkerrors.Wrap(err, "label") - } - if c.Extension == nil { - return nil - } - - e, ok := c.Extension.GetCachedValue().(validatable) - if !ok { - return nil - } - if err := e.ValidateBasic(); err != nil { - return sdkerrors.Wrap(err, "extension") - } - return nil -} - -// SetExtension set new extension data. Calls `ValidateBasic() error` on non nil values when method is implemented by -// the extension. -func (c *ContractInfo) SetExtension(ext ContractInfoExtension) error { - if ext == nil { - c.Extension = nil - return nil - } - if e, ok := ext.(validatable); ok { - if err := e.ValidateBasic(); err != nil { - return err - } - } - any, err := codectypes.NewAnyWithValue(ext) - if err != nil { - return sdkerrors.Wrap(sdkerrors.ErrPackAny, err.Error()) - } - - c.Extension = any - return nil -} - -// ReadExtension copies the extension value to the pointer passed as argument so that there is no need to cast -// For example with a custom extension of type `MyContractDetails` it will look as following: -// var d MyContractDetails -// if err := info.ReadExtension(&d); err != nil { -// return nil, sdkerrors.Wrap(err, "extension") -// } -func (c *ContractInfo) ReadExtension(e ContractInfoExtension) error { - rv := reflect.ValueOf(e) - if rv.Kind() != reflect.Ptr || rv.IsNil() { - return sdkerrors.Wrap(sdkerrors.ErrInvalidType, "not a pointer") - } - if c.Extension == nil { - return nil - } - - cached := c.Extension.GetCachedValue() - elem := reflect.ValueOf(cached).Elem() - if !elem.Type().AssignableTo(rv.Elem().Type()) { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "extension is of type %s but argument of %s", elem.Type(), rv.Elem().Type()) - } - rv.Elem().Set(elem) - return nil -} - -func (c ContractInfo) InitialHistory(initMsg []byte) ContractCodeHistoryEntry { - return ContractCodeHistoryEntry{ - Operation: ContractCodeHistoryOperationTypeInit, - CodeID: c.CodeID, - Updated: c.Created, - Msg: initMsg, - } -} - -func (c *ContractInfo) AddMigration(ctx sdk.Context, codeID uint64, msg []byte) ContractCodeHistoryEntry { - h := ContractCodeHistoryEntry{ - Operation: ContractCodeHistoryOperationTypeMigrate, - CodeID: codeID, - Updated: NewAbsoluteTxPosition(ctx), - Msg: msg, - } - c.CodeID = codeID - return h -} - -// ResetFromGenesis resets contracts timestamp and history. -func (c *ContractInfo) ResetFromGenesis(ctx sdk.Context) ContractCodeHistoryEntry { - c.Created = NewAbsoluteTxPosition(ctx) - return ContractCodeHistoryEntry{ - Operation: ContractCodeHistoryOperationTypeGenesis, - CodeID: c.CodeID, - Updated: c.Created, - } -} - -// AdminAddr convert into sdk.AccAddress or nil when not set -func (c *ContractInfo) AdminAddr() sdk.AccAddress { - if c.Admin == "" { - return nil - } - admin, err := sdk.AccAddressFromBech32(c.Admin) - if err != nil { // should never happen - panic(err.Error()) - } - return admin -} - -// ContractInfoExtension defines the extension point for custom data to be stored with a contract info -type ContractInfoExtension interface { - proto.Message - String() string -} - -var _ codectypes.UnpackInterfacesMessage = &ContractInfo{} - -// UnpackInterfaces implements codectypes.UnpackInterfaces -func (c *ContractInfo) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { - var details ContractInfoExtension - if err := unpacker.UnpackAny(c.Extension, &details); err != nil { - return err - } - return codectypes.UnpackInterfaces(details, unpacker) -} - -// NewAbsoluteTxPosition gets a block position from the context -func NewAbsoluteTxPosition(ctx sdk.Context) *AbsoluteTxPosition { - // we must safely handle nil gas meters - var index uint64 - meter := ctx.BlockGasMeter() - if meter != nil { - index = meter.GasConsumed() - } - height := ctx.BlockHeight() - if height < 0 { - panic(fmt.Sprintf("unsupported height: %d", height)) - } - return &AbsoluteTxPosition{ - BlockHeight: uint64(height), - TxIndex: index, - } -} - -// LessThan can be used to sort -func (a *AbsoluteTxPosition) LessThan(b *AbsoluteTxPosition) bool { - if a == nil { - return true - } - if b == nil { - return false - } - return a.BlockHeight < b.BlockHeight || (a.BlockHeight == b.BlockHeight && a.TxIndex < b.TxIndex) -} - -// AbsoluteTxPositionLen number of elements in byte representation -const AbsoluteTxPositionLen = 16 - -// Bytes encodes the object into a 16 byte representation with big endian block height and tx index. -func (a *AbsoluteTxPosition) Bytes() []byte { - if a == nil { - panic("object must not be nil") - } - r := make([]byte, AbsoluteTxPositionLen) - copy(r[0:], sdk.Uint64ToBigEndian(a.BlockHeight)) - copy(r[8:], sdk.Uint64ToBigEndian(a.TxIndex)) - return r -} - -// WasmConfig is the extra config required for wasm -type WasmConfig struct { - // SimulationGasLimit is the max gas to be used in a tx simulation call. - // When not set the consensus max block gas is used instead - SimulationGasLimit *uint64 - // SimulationGasLimit is the max gas to be used in a smart query contract call - SmartQueryGasLimit uint64 - // MemoryCacheSize in MiB not bytes - MemoryCacheSize uint32 - // ContractDebugMode log what contract print - ContractDebugMode bool -} - -// DefaultWasmConfig returns the default settings for WasmConfig -func DefaultWasmConfig() WasmConfig { - return WasmConfig{ - SmartQueryGasLimit: defaultSmartQueryGasLimit, - MemoryCacheSize: defaultMemoryCacheSize, - ContractDebugMode: defaultContractDebugMode, - } -} diff --git a/wasm/types/types.pb.go b/wasm/types/types.pb.go deleted file mode 100644 index 93f1a612..00000000 --- a/wasm/types/types.pb.go +++ /dev/null @@ -1,2452 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmwasm/wasm/v1/types.proto - -package types - -import ( - bytes "bytes" - fmt "fmt" - types "github.com/cosmos/cosmos-sdk/codec/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/regen-network/cosmos-proto" - github_com_tendermint_tendermint_libs_bytes "github.com/tendermint/tendermint/libs/bytes" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// AccessType permission types -type AccessType int32 - -const ( - // AccessTypeUnspecified placeholder for empty value - AccessTypeUnspecified AccessType = 0 - // AccessTypeNobody forbidden - AccessTypeNobody AccessType = 1 - // AccessTypeOnlyAddress restricted to an address - AccessTypeOnlyAddress AccessType = 2 - // AccessTypeEverybody unrestricted - AccessTypeEverybody AccessType = 3 -) - -var AccessType_name = map[int32]string{ - 0: "ACCESS_TYPE_UNSPECIFIED", - 1: "ACCESS_TYPE_NOBODY", - 2: "ACCESS_TYPE_ONLY_ADDRESS", - 3: "ACCESS_TYPE_EVERYBODY", -} - -var AccessType_value = map[string]int32{ - "ACCESS_TYPE_UNSPECIFIED": 0, - "ACCESS_TYPE_NOBODY": 1, - "ACCESS_TYPE_ONLY_ADDRESS": 2, - "ACCESS_TYPE_EVERYBODY": 3, -} - -func (AccessType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_e6155d98fa173e02, []int{0} -} - -// ContractCodeHistoryOperationType actions that caused a code change -type ContractCodeHistoryOperationType int32 - -const ( - // ContractCodeHistoryOperationTypeUnspecified placeholder for empty value - ContractCodeHistoryOperationTypeUnspecified ContractCodeHistoryOperationType = 0 - // ContractCodeHistoryOperationTypeInit on chain contract instantiation - ContractCodeHistoryOperationTypeInit ContractCodeHistoryOperationType = 1 - // ContractCodeHistoryOperationTypeMigrate code migration - ContractCodeHistoryOperationTypeMigrate ContractCodeHistoryOperationType = 2 - // ContractCodeHistoryOperationTypeGenesis based on genesis data - ContractCodeHistoryOperationTypeGenesis ContractCodeHistoryOperationType = 3 -) - -var ContractCodeHistoryOperationType_name = map[int32]string{ - 0: "CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED", - 1: "CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT", - 2: "CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE", - 3: "CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS", -} - -var ContractCodeHistoryOperationType_value = map[string]int32{ - "CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED": 0, - "CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT": 1, - "CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE": 2, - "CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS": 3, -} - -func (x ContractCodeHistoryOperationType) String() string { - return proto.EnumName(ContractCodeHistoryOperationType_name, int32(x)) -} - -func (ContractCodeHistoryOperationType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_e6155d98fa173e02, []int{1} -} - -// AccessTypeParam -type AccessTypeParam struct { - Value AccessType `protobuf:"varint,1,opt,name=value,proto3,enum=cosmwasm.wasm.v1.AccessType" json:"value,omitempty" yaml:"value"` -} - -func (m *AccessTypeParam) Reset() { *m = AccessTypeParam{} } -func (m *AccessTypeParam) String() string { return proto.CompactTextString(m) } -func (*AccessTypeParam) ProtoMessage() {} -func (*AccessTypeParam) Descriptor() ([]byte, []int) { - return fileDescriptor_e6155d98fa173e02, []int{0} -} -func (m *AccessTypeParam) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AccessTypeParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AccessTypeParam.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AccessTypeParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_AccessTypeParam.Merge(m, src) -} -func (m *AccessTypeParam) XXX_Size() int { - return m.Size() -} -func (m *AccessTypeParam) XXX_DiscardUnknown() { - xxx_messageInfo_AccessTypeParam.DiscardUnknown(m) -} - -var xxx_messageInfo_AccessTypeParam proto.InternalMessageInfo - -// AccessConfig access control type. -type AccessConfig struct { - Permission AccessType `protobuf:"varint,1,opt,name=permission,proto3,enum=cosmwasm.wasm.v1.AccessType" json:"permission,omitempty" yaml:"permission"` - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty" yaml:"address"` -} - -func (m *AccessConfig) Reset() { *m = AccessConfig{} } -func (m *AccessConfig) String() string { return proto.CompactTextString(m) } -func (*AccessConfig) ProtoMessage() {} -func (*AccessConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_e6155d98fa173e02, []int{1} -} -func (m *AccessConfig) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AccessConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AccessConfig.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AccessConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_AccessConfig.Merge(m, src) -} -func (m *AccessConfig) XXX_Size() int { - return m.Size() -} -func (m *AccessConfig) XXX_DiscardUnknown() { - xxx_messageInfo_AccessConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_AccessConfig proto.InternalMessageInfo - -// Params defines the set of wasm parameters. -type Params struct { - CodeUploadAccess AccessConfig `protobuf:"bytes,1,opt,name=code_upload_access,json=codeUploadAccess,proto3" json:"code_upload_access" yaml:"code_upload_access"` - InstantiateDefaultPermission AccessType `protobuf:"varint,2,opt,name=instantiate_default_permission,json=instantiateDefaultPermission,proto3,enum=cosmwasm.wasm.v1.AccessType" json:"instantiate_default_permission,omitempty" yaml:"instantiate_default_permission"` - MaxWasmCodeSize uint64 `protobuf:"varint,3,opt,name=max_wasm_code_size,json=maxWasmCodeSize,proto3" json:"max_wasm_code_size,omitempty" yaml:"max_wasm_code_size"` -} - -func (m *Params) Reset() { *m = Params{} } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_e6155d98fa173e02, []int{2} -} -func (m *Params) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Params.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) -} -func (m *Params) XXX_Size() int { - return m.Size() -} -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) -} - -var xxx_messageInfo_Params proto.InternalMessageInfo - -// CodeInfo is data for the uploaded contract WASM code -type CodeInfo struct { - // CodeHash is the unique identifier created by wasmvm - CodeHash []byte `protobuf:"bytes,1,opt,name=code_hash,json=codeHash,proto3" json:"code_hash,omitempty"` - // Creator address who initially stored the code - Creator string `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator,omitempty"` - // InstantiateConfig access control to apply on contract creation, optional - InstantiateConfig AccessConfig `protobuf:"bytes,5,opt,name=instantiate_config,json=instantiateConfig,proto3" json:"instantiate_config"` -} - -func (m *CodeInfo) Reset() { *m = CodeInfo{} } -func (m *CodeInfo) String() string { return proto.CompactTextString(m) } -func (*CodeInfo) ProtoMessage() {} -func (*CodeInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_e6155d98fa173e02, []int{3} -} -func (m *CodeInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CodeInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CodeInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_CodeInfo.Merge(m, src) -} -func (m *CodeInfo) XXX_Size() int { - return m.Size() -} -func (m *CodeInfo) XXX_DiscardUnknown() { - xxx_messageInfo_CodeInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_CodeInfo proto.InternalMessageInfo - -// ContractInfo stores a WASM contract instance -type ContractInfo struct { - // CodeID is the reference to the stored Wasm code - CodeID uint64 `protobuf:"varint,1,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` - // Creator address who initially instantiated the contract - Creator string `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator,omitempty"` - // Admin is an optional address that can execute migrations - Admin string `protobuf:"bytes,3,opt,name=admin,proto3" json:"admin,omitempty"` - // Label is optional metadata to be stored with a contract instance. - Label string `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"` - // Created Tx position when the contract was instantiated. - // This data should kept internal and not be exposed via query results. Just - // use for sorting - Created *AbsoluteTxPosition `protobuf:"bytes,5,opt,name=created,proto3" json:"created,omitempty"` - IBCPortID string `protobuf:"bytes,6,opt,name=ibc_port_id,json=ibcPortId,proto3" json:"ibc_port_id,omitempty"` - // Extension is an extension point to store custom metadata within the - // persistence model. - Extension *types.Any `protobuf:"bytes,7,opt,name=extension,proto3" json:"extension,omitempty"` -} - -func (m *ContractInfo) Reset() { *m = ContractInfo{} } -func (m *ContractInfo) String() string { return proto.CompactTextString(m) } -func (*ContractInfo) ProtoMessage() {} -func (*ContractInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_e6155d98fa173e02, []int{4} -} -func (m *ContractInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ContractInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ContractInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ContractInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ContractInfo.Merge(m, src) -} -func (m *ContractInfo) XXX_Size() int { - return m.Size() -} -func (m *ContractInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ContractInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_ContractInfo proto.InternalMessageInfo - -// ContractCodeHistoryEntry metadata to a contract. -type ContractCodeHistoryEntry struct { - Operation ContractCodeHistoryOperationType `protobuf:"varint,1,opt,name=operation,proto3,enum=cosmwasm.wasm.v1.ContractCodeHistoryOperationType" json:"operation,omitempty"` - // CodeID is the reference to the stored WASM code - CodeID uint64 `protobuf:"varint,2,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` - // Updated Tx position when the operation was executed. - Updated *AbsoluteTxPosition `protobuf:"bytes,3,opt,name=updated,proto3" json:"updated,omitempty"` - Msg RawContractMessage `protobuf:"bytes,4,opt,name=msg,proto3,casttype=RawContractMessage" json:"msg,omitempty"` -} - -func (m *ContractCodeHistoryEntry) Reset() { *m = ContractCodeHistoryEntry{} } -func (m *ContractCodeHistoryEntry) String() string { return proto.CompactTextString(m) } -func (*ContractCodeHistoryEntry) ProtoMessage() {} -func (*ContractCodeHistoryEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_e6155d98fa173e02, []int{5} -} -func (m *ContractCodeHistoryEntry) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ContractCodeHistoryEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ContractCodeHistoryEntry.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ContractCodeHistoryEntry) XXX_Merge(src proto.Message) { - xxx_messageInfo_ContractCodeHistoryEntry.Merge(m, src) -} -func (m *ContractCodeHistoryEntry) XXX_Size() int { - return m.Size() -} -func (m *ContractCodeHistoryEntry) XXX_DiscardUnknown() { - xxx_messageInfo_ContractCodeHistoryEntry.DiscardUnknown(m) -} - -var xxx_messageInfo_ContractCodeHistoryEntry proto.InternalMessageInfo - -// AbsoluteTxPosition is a unique transaction position that allows for global -// ordering of transactions. -type AbsoluteTxPosition struct { - // BlockHeight is the block the contract was created at - BlockHeight uint64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` - // TxIndex is a monotonic counter within the block (actual transaction index, - // or gas consumed) - TxIndex uint64 `protobuf:"varint,2,opt,name=tx_index,json=txIndex,proto3" json:"tx_index,omitempty"` -} - -func (m *AbsoluteTxPosition) Reset() { *m = AbsoluteTxPosition{} } -func (m *AbsoluteTxPosition) String() string { return proto.CompactTextString(m) } -func (*AbsoluteTxPosition) ProtoMessage() {} -func (*AbsoluteTxPosition) Descriptor() ([]byte, []int) { - return fileDescriptor_e6155d98fa173e02, []int{6} -} -func (m *AbsoluteTxPosition) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AbsoluteTxPosition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AbsoluteTxPosition.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AbsoluteTxPosition) XXX_Merge(src proto.Message) { - xxx_messageInfo_AbsoluteTxPosition.Merge(m, src) -} -func (m *AbsoluteTxPosition) XXX_Size() int { - return m.Size() -} -func (m *AbsoluteTxPosition) XXX_DiscardUnknown() { - xxx_messageInfo_AbsoluteTxPosition.DiscardUnknown(m) -} - -var xxx_messageInfo_AbsoluteTxPosition proto.InternalMessageInfo - -// Model is a struct that holds a KV pair -type Model struct { - // hex-encode key to read it better (this is often ascii) - Key github_com_tendermint_tendermint_libs_bytes.HexBytes `protobuf:"bytes,1,opt,name=key,proto3,casttype=github.com/tendermint/tendermint/libs/bytes.HexBytes" json:"key,omitempty"` - // base64-encode raw value - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *Model) Reset() { *m = Model{} } -func (m *Model) String() string { return proto.CompactTextString(m) } -func (*Model) ProtoMessage() {} -func (*Model) Descriptor() ([]byte, []int) { - return fileDescriptor_e6155d98fa173e02, []int{7} -} -func (m *Model) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Model) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Model.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Model) XXX_Merge(src proto.Message) { - xxx_messageInfo_Model.Merge(m, src) -} -func (m *Model) XXX_Size() int { - return m.Size() -} -func (m *Model) XXX_DiscardUnknown() { - xxx_messageInfo_Model.DiscardUnknown(m) -} - -var xxx_messageInfo_Model proto.InternalMessageInfo - -func init() { - proto.RegisterEnum("cosmwasm.wasm.v1.AccessType", AccessType_name, AccessType_value) - proto.RegisterEnum("cosmwasm.wasm.v1.ContractCodeHistoryOperationType", ContractCodeHistoryOperationType_name, ContractCodeHistoryOperationType_value) - proto.RegisterType((*AccessTypeParam)(nil), "cosmwasm.wasm.v1.AccessTypeParam") - proto.RegisterType((*AccessConfig)(nil), "cosmwasm.wasm.v1.AccessConfig") - proto.RegisterType((*Params)(nil), "cosmwasm.wasm.v1.Params") - proto.RegisterType((*CodeInfo)(nil), "cosmwasm.wasm.v1.CodeInfo") - proto.RegisterType((*ContractInfo)(nil), "cosmwasm.wasm.v1.ContractInfo") - proto.RegisterType((*ContractCodeHistoryEntry)(nil), "cosmwasm.wasm.v1.ContractCodeHistoryEntry") - proto.RegisterType((*AbsoluteTxPosition)(nil), "cosmwasm.wasm.v1.AbsoluteTxPosition") - proto.RegisterType((*Model)(nil), "cosmwasm.wasm.v1.Model") -} - -func init() { proto.RegisterFile("cosmwasm/wasm/v1/types.proto", fileDescriptor_e6155d98fa173e02) } - -var fileDescriptor_e6155d98fa173e02 = []byte{ - // 1164 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0xcb, 0x6f, 0x1b, 0xc5, - 0x1f, 0xf7, 0xda, 0xce, 0xc3, 0xd3, 0xfc, 0x5a, 0x77, 0x7e, 0x09, 0x75, 0x4c, 0xb1, 0xdd, 0xa5, - 0x40, 0xfa, 0xb2, 0x69, 0x40, 0x80, 0x7a, 0xa8, 0xe4, 0xc7, 0xd2, 0x6c, 0x44, 0x6c, 0x6b, 0xec, - 0x52, 0x05, 0xa9, 0x5a, 0x8d, 0x77, 0x27, 0xce, 0xa8, 0xbb, 0x3b, 0xd6, 0xce, 0x38, 0xf5, 0xf6, - 0x2f, 0x40, 0x91, 0x90, 0xb8, 0xc1, 0x25, 0x12, 0x02, 0x84, 0xfa, 0x07, 0x70, 0xe5, 0x5e, 0x71, - 0xea, 0x11, 0x09, 0xc9, 0x82, 0xf4, 0x02, 0xd7, 0x1c, 0xcb, 0x05, 0xed, 0x4c, 0x2c, 0xaf, 0x9a, - 0xb6, 0x31, 0x97, 0xd5, 0x7c, 0x1f, 0x9f, 0xcf, 0xf7, 0x35, 0xf3, 0xd5, 0x82, 0x8b, 0x36, 0xe3, - 0xde, 0x43, 0xcc, 0xbd, 0x8a, 0xfc, 0xec, 0xdd, 0xac, 0x88, 0x70, 0x40, 0x78, 0x79, 0x10, 0x30, - 0xc1, 0x60, 0x76, 0x62, 0x2d, 0xcb, 0xcf, 0xde, 0xcd, 0xfc, 0x6a, 0xa4, 0x61, 0xdc, 0x92, 0xf6, - 0x8a, 0x12, 0x94, 0x73, 0x7e, 0xb9, 0xcf, 0xfa, 0x4c, 0xe9, 0xa3, 0xd3, 0xb1, 0x76, 0xb5, 0xcf, - 0x58, 0xdf, 0x25, 0x15, 0x29, 0xf5, 0x86, 0x3b, 0x15, 0xec, 0x87, 0xca, 0xa4, 0xdf, 0x07, 0xe7, - 0xaa, 0xb6, 0x4d, 0x38, 0xef, 0x86, 0x03, 0xd2, 0xc6, 0x01, 0xf6, 0x60, 0x03, 0xcc, 0xed, 0x61, - 0x77, 0x48, 0x72, 0x5a, 0x49, 0x5b, 0x3b, 0xbb, 0x7e, 0xb1, 0xfc, 0x62, 0x02, 0xe5, 0x29, 0xa2, - 0x96, 0x3d, 0x1a, 0x17, 0x97, 0x42, 0xec, 0xb9, 0xb7, 0x74, 0x09, 0xd2, 0x91, 0x02, 0xdf, 0x4a, - 0x7f, 0xfb, 0x5d, 0x51, 0xd3, 0xbf, 0xd1, 0xc0, 0x92, 0xf2, 0xae, 0x33, 0x7f, 0x87, 0xf6, 0x61, - 0x07, 0x80, 0x01, 0x09, 0x3c, 0xca, 0x39, 0x65, 0xfe, 0x4c, 0x11, 0x56, 0x8e, 0xc6, 0xc5, 0xf3, - 0x2a, 0xc2, 0x14, 0xa9, 0xa3, 0x18, 0x0d, 0xbc, 0x0e, 0x16, 0xb0, 0xe3, 0x04, 0x84, 0xf3, 0x5c, - 0xb2, 0xa4, 0xad, 0x65, 0x6a, 0xf0, 0x68, 0x5c, 0x3c, 0xab, 0x30, 0xc7, 0x06, 0x1d, 0x4d, 0x5c, - 0x8e, 0x33, 0xfb, 0x3d, 0x09, 0xe6, 0x65, 0xbd, 0x1c, 0x32, 0x00, 0x6d, 0xe6, 0x10, 0x6b, 0x38, - 0x70, 0x19, 0x76, 0x2c, 0x2c, 0x63, 0xcb, 0xdc, 0xce, 0xac, 0x17, 0x5e, 0x95, 0x9b, 0xaa, 0xa7, - 0x76, 0xe9, 0xc9, 0xb8, 0x98, 0x38, 0x1a, 0x17, 0x57, 0x55, 0xb4, 0x93, 0x3c, 0x3a, 0xca, 0x46, - 0xca, 0xbb, 0x52, 0xa7, 0xa0, 0xf0, 0x2b, 0x0d, 0x14, 0xa8, 0xcf, 0x05, 0xf6, 0x05, 0xc5, 0x82, - 0x58, 0x0e, 0xd9, 0xc1, 0x43, 0x57, 0x58, 0xb1, 0xce, 0x24, 0x67, 0xe8, 0xcc, 0x95, 0xa3, 0x71, - 0xf1, 0x1d, 0x15, 0xf7, 0xf5, 0x6c, 0x3a, 0xba, 0x18, 0x73, 0x68, 0x28, 0x7b, 0x7b, 0xda, 0xbf, - 0x4d, 0x00, 0x3d, 0x3c, 0xb2, 0xa2, 0x10, 0x96, 0xac, 0x80, 0xd3, 0x47, 0x24, 0x97, 0x2a, 0x69, - 0x6b, 0xe9, 0xda, 0x5b, 0xd3, 0xe2, 0x4e, 0xfa, 0xe8, 0xe8, 0x9c, 0x87, 0x47, 0xf7, 0x30, 0xf7, - 0xea, 0xcc, 0x21, 0x1d, 0xfa, 0x48, 0xcd, 0x3d, 0xa1, 0x7f, 0xaf, 0x81, 0xc5, 0x48, 0x65, 0xfa, - 0x3b, 0x0c, 0xbe, 0x09, 0x32, 0x12, 0xb1, 0x8b, 0xf9, 0xae, 0x6c, 0xeb, 0x12, 0x5a, 0x8c, 0x14, - 0x1b, 0x98, 0xef, 0xc2, 0x1c, 0x58, 0xb0, 0x03, 0x82, 0x05, 0x0b, 0xd4, 0xec, 0xd0, 0x44, 0x84, - 0x1d, 0x00, 0xe3, 0x65, 0xd9, 0xb2, 0xe1, 0xb9, 0xb9, 0x99, 0xc6, 0x92, 0x8e, 0xc6, 0x82, 0xce, - 0xc7, 0xf0, 0xca, 0xb0, 0x99, 0x5e, 0x4c, 0x65, 0xd3, 0x9b, 0xe9, 0xc5, 0x74, 0x76, 0x4e, 0xff, - 0x25, 0x09, 0x96, 0xea, 0xcc, 0x17, 0x01, 0xb6, 0x85, 0x4c, 0xf4, 0x6d, 0xb0, 0x20, 0x13, 0xa5, - 0x8e, 0x4c, 0x33, 0x5d, 0x03, 0x87, 0xe3, 0xe2, 0xbc, 0xac, 0xa3, 0x81, 0xe6, 0x23, 0x93, 0xe9, - 0xbc, 0x26, 0xe1, 0x65, 0x30, 0x87, 0x1d, 0x8f, 0xfa, 0xb2, 0x73, 0x19, 0xa4, 0x84, 0x48, 0xeb, - 0xe2, 0x1e, 0x71, 0x73, 0x69, 0xa5, 0x95, 0x02, 0xbc, 0x7d, 0xcc, 0x42, 0x9c, 0xe3, 0x8a, 0x2e, - 0xbf, 0xa4, 0xa2, 0x1e, 0x67, 0xee, 0x50, 0x90, 0xee, 0xa8, 0xcd, 0x38, 0x15, 0x94, 0xf9, 0x68, - 0x02, 0x82, 0x37, 0xc0, 0x19, 0xda, 0xb3, 0xad, 0x01, 0x0b, 0x44, 0x94, 0xee, 0xbc, 0xbc, 0xf6, - 0xff, 0x3b, 0x1c, 0x17, 0x33, 0x66, 0xad, 0xde, 0x66, 0x81, 0x30, 0x1b, 0x28, 0x43, 0x7b, 0xb6, - 0x3c, 0x3a, 0x70, 0x0b, 0x64, 0xc8, 0x48, 0x10, 0x5f, 0xde, 0xad, 0x05, 0x19, 0x70, 0xb9, 0xac, - 0xb6, 0x42, 0x79, 0xb2, 0x15, 0xca, 0x55, 0x3f, 0xac, 0xad, 0xfe, 0xfa, 0xf3, 0x8d, 0x95, 0x78, - 0x53, 0x8c, 0x09, 0x0c, 0x4d, 0x19, 0x6e, 0xa5, 0xff, 0x8a, 0x9e, 0xd0, 0x3f, 0x1a, 0xc8, 0x4d, - 0x5c, 0xa3, 0x26, 0x6d, 0x50, 0x2e, 0x58, 0x10, 0x1a, 0xbe, 0x08, 0x42, 0xd8, 0x06, 0x19, 0x36, - 0x20, 0x01, 0x16, 0xd3, 0x77, 0xbe, 0x7e, 0xb2, 0xc4, 0x97, 0xc0, 0x5b, 0x13, 0x54, 0x74, 0xc7, - 0xd1, 0x94, 0x24, 0x3e, 0x9d, 0xe4, 0x2b, 0xa7, 0x73, 0x1b, 0x2c, 0x0c, 0x07, 0x8e, 0xec, 0x6b, - 0xea, 0xbf, 0xf4, 0xf5, 0x18, 0x04, 0xd7, 0x40, 0xca, 0xe3, 0x7d, 0x39, 0xab, 0xa5, 0xda, 0x1b, - 0xcf, 0xc7, 0x45, 0x88, 0xf0, 0xc3, 0x49, 0x96, 0x5b, 0x84, 0x73, 0xdc, 0x27, 0x28, 0x72, 0xd1, - 0x11, 0x80, 0x27, 0x89, 0xe0, 0x25, 0xb0, 0xd4, 0x73, 0x99, 0xfd, 0xc0, 0xda, 0x25, 0xb4, 0xbf, - 0x2b, 0xd4, 0x3d, 0x42, 0x67, 0xa4, 0x6e, 0x43, 0xaa, 0xe0, 0x2a, 0x58, 0x14, 0x23, 0x8b, 0xfa, - 0x0e, 0x19, 0xa9, 0x42, 0xd0, 0x82, 0x18, 0x99, 0x91, 0xa8, 0x53, 0x30, 0xb7, 0xc5, 0x1c, 0xe2, - 0xc2, 0x4d, 0x90, 0x7a, 0x40, 0x42, 0xf5, 0x58, 0x6a, 0x9f, 0x3c, 0x1f, 0x17, 0x3f, 0xec, 0x53, - 0xb1, 0x3b, 0xec, 0x95, 0x6d, 0xe6, 0x55, 0x04, 0xf1, 0x9d, 0xe8, 0xf1, 0xfa, 0x22, 0x7e, 0x74, - 0x69, 0x8f, 0x57, 0x7a, 0xa1, 0x20, 0xbc, 0xbc, 0x41, 0x46, 0xb5, 0xe8, 0x80, 0x22, 0x92, 0xe8, - 0x02, 0xaa, 0x7d, 0x9e, 0x94, 0x4f, 0x4f, 0x09, 0x57, 0xff, 0xd6, 0x00, 0x98, 0xee, 0x12, 0xf8, - 0x11, 0xb8, 0x50, 0xad, 0xd7, 0x8d, 0x4e, 0xc7, 0xea, 0x6e, 0xb7, 0x0d, 0xeb, 0x6e, 0xb3, 0xd3, - 0x36, 0xea, 0xe6, 0xa7, 0xa6, 0xd1, 0xc8, 0x26, 0xf2, 0xab, 0xfb, 0x07, 0xa5, 0x95, 0xa9, 0xf3, - 0x5d, 0x9f, 0x0f, 0x88, 0x4d, 0x77, 0x28, 0x71, 0xe0, 0x75, 0x00, 0xe3, 0xb8, 0x66, 0xab, 0xd6, - 0x6a, 0x6c, 0x67, 0xb5, 0xfc, 0xf2, 0xfe, 0x41, 0x29, 0x3b, 0x85, 0x34, 0x59, 0x8f, 0x39, 0x21, - 0xfc, 0x18, 0xe4, 0xe2, 0xde, 0xad, 0xe6, 0x67, 0xdb, 0x56, 0xb5, 0xd1, 0x40, 0x46, 0xa7, 0x93, - 0x4d, 0xbe, 0x18, 0xa6, 0xe5, 0xbb, 0x61, 0x55, 0xed, 0x6c, 0xb8, 0x0e, 0x56, 0xe2, 0x40, 0xe3, - 0x73, 0x03, 0x6d, 0xcb, 0x48, 0xa9, 0xfc, 0x85, 0xfd, 0x83, 0xd2, 0xff, 0xa7, 0x28, 0x63, 0x8f, - 0x04, 0x61, 0x14, 0x2c, 0xbf, 0xf8, 0xe5, 0x0f, 0x85, 0xc4, 0xe3, 0x1f, 0x0b, 0x89, 0xab, 0x3f, - 0xa5, 0x40, 0xe9, 0xb4, 0x9b, 0x06, 0x09, 0x78, 0xbf, 0xde, 0x6a, 0x76, 0x51, 0xb5, 0xde, 0xb5, - 0xea, 0xad, 0x86, 0x61, 0x6d, 0x98, 0x9d, 0x6e, 0x0b, 0x6d, 0x5b, 0xad, 0xb6, 0x81, 0xaa, 0x5d, - 0xb3, 0xd5, 0x7c, 0x59, 0x6b, 0x2a, 0xfb, 0x07, 0xa5, 0x6b, 0xa7, 0x71, 0xc7, 0x1b, 0x76, 0x0f, - 0x5c, 0x99, 0x29, 0x8c, 0xd9, 0x34, 0xbb, 0x59, 0x2d, 0xbf, 0xb6, 0x7f, 0x50, 0xba, 0x7c, 0x1a, - 0xbf, 0xe9, 0x53, 0x01, 0xef, 0x83, 0xeb, 0x33, 0x11, 0x6f, 0x99, 0x77, 0x50, 0xb5, 0x6b, 0x64, - 0x93, 0xf9, 0x6b, 0xfb, 0x07, 0xa5, 0xf7, 0x4e, 0xe3, 0xde, 0xa2, 0xfd, 0x00, 0x0b, 0x32, 0x33, - 0xfd, 0x1d, 0xa3, 0x69, 0x74, 0xcc, 0x4e, 0x36, 0x35, 0x1b, 0xfd, 0x1d, 0xe2, 0x13, 0x4e, 0x79, - 0x3e, 0x1d, 0x0d, 0xab, 0xb6, 0xf1, 0xe4, 0xcf, 0x42, 0xe2, 0xf1, 0x61, 0x41, 0x7b, 0x72, 0x58, - 0xd0, 0x9e, 0x1e, 0x16, 0xb4, 0x3f, 0x0e, 0x0b, 0xda, 0xd7, 0xcf, 0x0a, 0x89, 0xa7, 0xcf, 0x0a, - 0x89, 0xdf, 0x9e, 0x15, 0x12, 0x5f, 0xbc, 0x1b, 0x7b, 0x07, 0x75, 0xc6, 0xbd, 0x7b, 0x93, 0xdf, - 0x26, 0xa7, 0x32, 0x52, 0xbf, 0x4f, 0xf2, 0xdf, 0xa9, 0x37, 0x2f, 0xb7, 0xda, 0x07, 0xff, 0x06, - 0x00, 0x00, 0xff, 0xff, 0x18, 0x23, 0xa5, 0x9f, 0x5c, 0x09, 0x00, 0x00, -} - -func (this *AccessTypeParam) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*AccessTypeParam) - if !ok { - that2, ok := that.(AccessTypeParam) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Value != that1.Value { - return false - } - return true -} -func (this *AccessConfig) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*AccessConfig) - if !ok { - that2, ok := that.(AccessConfig) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Permission != that1.Permission { - return false - } - if this.Address != that1.Address { - return false - } - return true -} -func (this *Params) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Params) - if !ok { - that2, ok := that.(Params) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.CodeUploadAccess.Equal(&that1.CodeUploadAccess) { - return false - } - if this.InstantiateDefaultPermission != that1.InstantiateDefaultPermission { - return false - } - if this.MaxWasmCodeSize != that1.MaxWasmCodeSize { - return false - } - return true -} -func (this *CodeInfo) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*CodeInfo) - if !ok { - that2, ok := that.(CodeInfo) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !bytes.Equal(this.CodeHash, that1.CodeHash) { - return false - } - if this.Creator != that1.Creator { - return false - } - if !this.InstantiateConfig.Equal(&that1.InstantiateConfig) { - return false - } - return true -} -func (this *ContractInfo) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ContractInfo) - if !ok { - that2, ok := that.(ContractInfo) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.CodeID != that1.CodeID { - return false - } - if this.Creator != that1.Creator { - return false - } - if this.Admin != that1.Admin { - return false - } - if this.Label != that1.Label { - return false - } - if !this.Created.Equal(that1.Created) { - return false - } - if this.IBCPortID != that1.IBCPortID { - return false - } - if !this.Extension.Equal(that1.Extension) { - return false - } - return true -} -func (this *ContractCodeHistoryEntry) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ContractCodeHistoryEntry) - if !ok { - that2, ok := that.(ContractCodeHistoryEntry) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Operation != that1.Operation { - return false - } - if this.CodeID != that1.CodeID { - return false - } - if !this.Updated.Equal(that1.Updated) { - return false - } - if !bytes.Equal(this.Msg, that1.Msg) { - return false - } - return true -} -func (this *AbsoluteTxPosition) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*AbsoluteTxPosition) - if !ok { - that2, ok := that.(AbsoluteTxPosition) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.BlockHeight != that1.BlockHeight { - return false - } - if this.TxIndex != that1.TxIndex { - return false - } - return true -} -func (this *Model) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Model) - if !ok { - that2, ok := that.(Model) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !bytes.Equal(this.Key, that1.Key) { - return false - } - if !bytes.Equal(this.Value, that1.Value) { - return false - } - return true -} -func (m *AccessTypeParam) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AccessTypeParam) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AccessTypeParam) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Value != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Value)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *AccessConfig) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AccessConfig) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AccessConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0x12 - } - if m.Permission != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Permission)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Params) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Params) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.MaxWasmCodeSize != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.MaxWasmCodeSize)) - i-- - dAtA[i] = 0x18 - } - if m.InstantiateDefaultPermission != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.InstantiateDefaultPermission)) - i-- - dAtA[i] = 0x10 - } - { - size, err := m.CodeUploadAccess.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *CodeInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CodeInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CodeInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.InstantiateConfig.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0x12 - } - if len(m.CodeHash) > 0 { - i -= len(m.CodeHash) - copy(dAtA[i:], m.CodeHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.CodeHash))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ContractInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ContractInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ContractInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Extension != nil { - { - size, err := m.Extension.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - if len(m.IBCPortID) > 0 { - i -= len(m.IBCPortID) - copy(dAtA[i:], m.IBCPortID) - i = encodeVarintTypes(dAtA, i, uint64(len(m.IBCPortID))) - i-- - dAtA[i] = 0x32 - } - if m.Created != nil { - { - size, err := m.Created.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if len(m.Label) > 0 { - i -= len(m.Label) - copy(dAtA[i:], m.Label) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Label))) - i-- - dAtA[i] = 0x22 - } - if len(m.Admin) > 0 { - i -= len(m.Admin) - copy(dAtA[i:], m.Admin) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Admin))) - i-- - dAtA[i] = 0x1a - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0x12 - } - if m.CodeID != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.CodeID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ContractCodeHistoryEntry) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ContractCodeHistoryEntry) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ContractCodeHistoryEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Msg) > 0 { - i -= len(m.Msg) - copy(dAtA[i:], m.Msg) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Msg))) - i-- - dAtA[i] = 0x22 - } - if m.Updated != nil { - { - size, err := m.Updated.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.CodeID != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.CodeID)) - i-- - dAtA[i] = 0x10 - } - if m.Operation != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Operation)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *AbsoluteTxPosition) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AbsoluteTxPosition) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AbsoluteTxPosition) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.TxIndex != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.TxIndex)) - i-- - dAtA[i] = 0x10 - } - if m.BlockHeight != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.BlockHeight)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Model) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Model) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Model) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *AccessTypeParam) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Value != 0 { - n += 1 + sovTypes(uint64(m.Value)) - } - return n -} - -func (m *AccessConfig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Permission != 0 { - n += 1 + sovTypes(uint64(m.Permission)) - } - l = len(m.Address) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.CodeUploadAccess.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.InstantiateDefaultPermission != 0 { - n += 1 + sovTypes(uint64(m.InstantiateDefaultPermission)) - } - if m.MaxWasmCodeSize != 0 { - n += 1 + sovTypes(uint64(m.MaxWasmCodeSize)) - } - return n -} - -func (m *CodeInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.CodeHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = m.InstantiateConfig.Size() - n += 1 + l + sovTypes(uint64(l)) - return n -} - -func (m *ContractInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CodeID != 0 { - n += 1 + sovTypes(uint64(m.CodeID)) - } - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Admin) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Label) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Created != nil { - l = m.Created.Size() - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.IBCPortID) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Extension != nil { - l = m.Extension.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *ContractCodeHistoryEntry) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Operation != 0 { - n += 1 + sovTypes(uint64(m.Operation)) - } - if m.CodeID != 0 { - n += 1 + sovTypes(uint64(m.CodeID)) - } - if m.Updated != nil { - l = m.Updated.Size() - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Msg) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *AbsoluteTxPosition) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BlockHeight != 0 { - n += 1 + sovTypes(uint64(m.BlockHeight)) - } - if m.TxIndex != 0 { - n += 1 + sovTypes(uint64(m.TxIndex)) - } - return n -} - -func (m *Model) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *AccessTypeParam) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AccessTypeParam: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AccessTypeParam: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - m.Value = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Value |= AccessType(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AccessConfig) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AccessConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AccessConfig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Permission", wireType) - } - m.Permission = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Permission |= AccessType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Params) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Params: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CodeUploadAccess", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.CodeUploadAccess.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field InstantiateDefaultPermission", wireType) - } - m.InstantiateDefaultPermission = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.InstantiateDefaultPermission |= AccessType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxWasmCodeSize", wireType) - } - m.MaxWasmCodeSize = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxWasmCodeSize |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CodeInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CodeInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CodeInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CodeHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CodeHash = append(m.CodeHash[:0], dAtA[iNdEx:postIndex]...) - if m.CodeHash == nil { - m.CodeHash = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InstantiateConfig", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.InstantiateConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ContractInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ContractInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ContractInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CodeID", wireType) - } - m.CodeID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CodeID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Admin = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Label = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Created", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Created == nil { - m.Created = &AbsoluteTxPosition{} - } - if err := m.Created.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IBCPortID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IBCPortID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Extension", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Extension == nil { - m.Extension = &types.Any{} - } - if err := m.Extension.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ContractCodeHistoryEntry) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ContractCodeHistoryEntry: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ContractCodeHistoryEntry: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Operation", wireType) - } - m.Operation = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Operation |= ContractCodeHistoryOperationType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CodeID", wireType) - } - m.CodeID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CodeID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Updated", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Updated == nil { - m.Updated = &AbsoluteTxPosition{} - } - if err := m.Updated.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Msg = append(m.Msg[:0], dAtA[iNdEx:postIndex]...) - if m.Msg == nil { - m.Msg = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AbsoluteTxPosition) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AbsoluteTxPosition: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AbsoluteTxPosition: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) - } - m.BlockHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlockHeight |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TxIndex", wireType) - } - m.TxIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TxIndex |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Model) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Model: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Model: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTypes(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/wasm/types/validation.go b/wasm/types/validation.go deleted file mode 100644 index 374782c7..00000000 --- a/wasm/types/validation.go +++ /dev/null @@ -1,32 +0,0 @@ -package types - -import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -const ( - MaxWasmSize = 500 * 1024 - - // MaxLabelSize is the longest label that can be used when Instantiating a contract - MaxLabelSize = 128 -) - -func validateWasmCode(s []byte) error { - if len(s) == 0 { - return sdkerrors.Wrap(ErrEmpty, "is required") - } - if len(s) > MaxWasmSize { - return sdkerrors.Wrapf(ErrLimit, "cannot be longer than %d bytes", MaxWasmSize) - } - return nil -} - -func validateLabel(label string) error { - if label == "" { - return sdkerrors.Wrap(ErrEmpty, "is required") - } - if len(label) > MaxLabelSize { - return sdkerrors.Wrap(ErrLimit, "cannot be longer than 128 characters") - } - return nil -}